Skip to main content
Glama

Tool Filter MCP

by respawn-app

tool-filter-mcp

npm version

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

npx @respawn-app/tool-filter-mcp --upstream <url> --deny <patterns>

Usage

Basic Example

Filter tools matching .*_file$ pattern:

npx @respawn-app/tool-filter-mcp \ --upstream http://localhost:3000/sse \ --deny ".*_file$"

Multiple Patterns

Use comma-separated patterns:

npx @respawn-app/tool-filter-mcp \ --upstream http://localhost:3000/sse \ --deny "get_file_text,create_new_file,replace_text"

With Claude Code

Add to your .mcp.json:

{ "mcpServers": { "filtered-server": { "command": "npx", "args": [ "@respawn-app/tool-filter-mcp", "--upstream", "http://localhost:3000/sse", "--deny", "dangerous_tool_1,dangerous_tool_2" ], "type": "stdio" } } }

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

-
security - not tested
F
license - not found
-
quality - not tested

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.

  1. Maintained: ✅ Yes (Fall 2025)
    1. Why use this?
      1. Features
        1. Installation
          1. Usage
            1. Basic Example
            2. Multiple Patterns
            3. With Claude Code
          2. CLI Options
            1. Requirements
              1. License

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/respawn-app/tool-filter-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server