Skip to content

Add docs for new thv run --tools flag. #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/toolhive/guides-cli/run-mcp-servers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,36 @@ specific proxy port instead, use the `--proxy-port` flag:
thv run --proxy-port <PORT_NUMBER> <SERVER>
```

### 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 <TOOL_1>,<TOOL_2> <SERVER>
```

Or multiple times

```bash
thv run --tools <TOOL_1> --tools <TOOL_2> <SERVER>
```

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
Expand Down
Loading