tool-filter-mcp
MCP proxy server that filters tools from upstream MCP servers via regex-based deny list.
Maintained: ✅ Yes (Fall 2025)
Why use this?
For effective context engineering, we want to minimize useless tokens. Most major agents right now (e.g. Claude Code) do NOT remove tool descriptions from the context. Even though the tool is completely denied and unused, the model will still get its entire description and still try to call the tool (and get error messages). For big MCPs, such as github, supabase, jetbrains IDE, atlassian, this is catastrophic to the context and leads to context pollution by 40-60k of useless tokens. You wanted your agent to be able to see jira ticket descriptions? Please also have these 44 useless tools to edit assignees on confluence pages.
This MCP completely solves the issue without introducing any overhead. This project is fully vibe-coded with claude. Contributions welcome!
Features
Tool Filtering: Block specific tools using regex patterns
Zero Latency: Cached tool list, minimal overhead
Fail-Fast: Immediate error on connection issues or invalid patterns
Transparent Proxying: Forwards allowed tool calls to upstream without modification
Installation
Usage
Basic Example
Filter tools matching .*_file$
pattern:
Multiple Patterns
Use comma-separated patterns:
With Claude Code
Add to your .mcp.json
:
CLI Options
--upstream <url>
(required): Upstream MCP server URL (SSE transport)--deny <patterns>
: Comma-separated regex patterns for tools to filter
Requirements
Node.js >= 20.0.0
Upstream MCP server with SSE transport
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Filters and blocks specific tools from upstream MCP servers using regex patterns to reduce context pollution and remove unwanted tools from AI agent interactions.