Tool Filter MCP — Claude Code MCP server: setup
The Tool Filter MCP MCP server for Claude Code and Codex filters tools exposed by an upstream MCP server with regex allow and deny rules. It can hide selected tools from the agent.
MIT ★ 37 updated 2026-11-01
claude mcp add tool-filter-mcp -- npx -y @respawn-app/tool-filter-mcpWhat Tool Filter MCP does
Tool Filter MCP proxies an upstream MCP server and exposes only the tools that pass its filters. HTTP/SSE sources use an upstream URL, while local stdio sources run after --upstream-stdio. Regex rules go into --allow and --deny; --list-tools shows the available or filtered tool names.
When both lists are present, deny rules win. Matching is case-sensitive, and a pattern without ^ or $ can match part of a tool name. Several patterns can be comma-separated; an escaped \, keeps a comma inside one pattern.
The proxy runs through npx and needs an upstream MCP server, either an HTTP/SSE endpoint or a stdio command. Authentication headers can be forwarded to an HTTP/SSE server, while stdio processes can receive environment variables through --env. Claude Code adds it with claude mcp add tool-filter-mcp -- npx -y @respawn-app/tool-filter-mcp.
What it helps with
- hide dangerous tools with a regex pattern
- expose only reading and search tools
- inspect available tools before starting the proxy
- forward authentication headers to an upstream server
- filter a local stdio MCP server
Example prompts for the agent
- Connect
http://localhost:3000/ssethrough Tool Filter MCP and hide tools matching.*_file$. - Expose only
read_fileandsearch_codewith an--allowrule. - Run a local server through the filter with
npx @respawn-app/tool-filter-mcp --upstream-stdio --deny "dangerous_.*" -- npx my-mcp-server.
How to install Tool Filter MCP
Platform CLI
claude mcp add tool-filter-mcp -- npx -y @respawn-app/tool-filter-mcpPlatform CLI
codex mcp add tool-filter-mcp -- npx -y @respawn-app/tool-filter-mcpConfig file
{
"mcpServers": {
"tool-filter-mcp": {
"command": "npx",
"args": [
"-y",
"@respawn-app/tool-filter-mcp"
]
}
}
}Config file
{
"servers": {
"tool-filter-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@respawn-app/tool-filter-mcp"
]
}
}
}Platform CLI
gemini mcp add tool-filter-mcp npx -y @respawn-app/tool-filter-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Tool Filter MCP
How do I install Tool Filter MCP in Claude Code?
Run claude mcp add tool-filter-mcp -- npx -y @respawn-app/tool-filter-mcp.
What does Tool Filter MCP do?
It places a filtering proxy in front of an upstream MCP server and applies regex-based allow and deny rules to its tools. The available set can be inspected with --list-tools.
What does Tool Filter MCP need to run?
It needs npx and an upstream MCP server, supplied as an HTTP/SSE endpoint or a stdio command. Protected endpoints can use authentication headers, and stdio servers can receive variables such as API_KEY through --env.