diff --git a/docs/toolhive/guides-cli/run-mcp-servers.mdx b/docs/toolhive/guides-cli/run-mcp-servers.mdx index e8b4535..419b2f0 100644 --- a/docs/toolhive/guides-cli/run-mcp-servers.mdx +++ b/docs/toolhive/guides-cli/run-mcp-servers.mdx @@ -142,6 +142,36 @@ specific proxy port instead, use the `--proxy-port` flag: thv run --proxy-port ``` +### Run a server exposing only selected tools + +ToolHive can filter the tools returned to the client as result of a `tools/list` +command as well as block calls to tools that you don't want to expose. + +This can help reduce the amount of tools sent to the LLM while still using the +same MCP server, but it is not meant as a security feature. + +To filter the list of tools, use the `--tools` flag either once + +```bash +thv run --tools , +``` + +Or multiple times + +```bash +thv run --tools --tools +``` + +For example: + +```bash +thv run --tools list_issues,get_issue github +``` + +If the server comes from the registry, ToolHive can validate the tool names +against the list advertised in the image reference. An error is returned in case +ToolHive cannot find one of the specified tools. + ## Run a custom MCP server To run an MCP server that isn't in the registry, you can use a