Skip to content

Commit 6dc1efa

Browse files
committed
Add docs for new thv run --tools flag.
This change adds a small section under the "Run MCP servers" page documenting how to filter tools exposed by a server. Fixes stacklok/toolhive#1007
1 parent 1952948 commit 6dc1efa

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/toolhive/guides-cli/run-mcp-servers.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,36 @@ specific proxy port instead, use the `--proxy-port` flag:
142142
thv run --proxy-port <PORT_NUMBER> <SERVER>
143143
```
144144

145+
### Run a server exposing only selected tools
146+
147+
ToolHive can filter the tools returned to the client as result of a `tools/list`
148+
command as well as block calls to tools that the user did not want to expose.
149+
150+
This can help reduce the amount of tools sent to the LLM while still using the
151+
same MCP server, but it is not meant as a security feature.
152+
153+
To filter the list of tools, use the `--tools` flag either once
154+
155+
```bash
156+
thv run --tools <TOOL_1>,<TOOL_2> <SERVER>
157+
```
158+
159+
Or multiple times
160+
161+
```bash
162+
thv run --tools <TOOL_1> --tools <TOOL_2> <SERVER>
163+
```
164+
165+
For example:
166+
167+
```bash
168+
thv run --tools list_issues,get_issue github
169+
```
170+
171+
If the server comes from the registry, ToolHive can validate the tool names
172+
against the list advertised in the image reference. An error is returned in case
173+
ToolHive cannot find one of the tools specified by the user.
174+
145175
## Run a custom MCP server
146176

147177
To run an MCP server that isn't in the registry, you can use a

0 commit comments

Comments
 (0)