# Tool Filter MCP

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 37 repo stars
- Author: respawn-llc
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/respawn-llc/tool-filter-mcp
- Updated: 2026-11-01
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/tool-filter-mcp

## What it 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`.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add tool-filter-mcp -- npx -y @respawn-app/tool-filter-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add tool-filter-mcp -- npx -y @respawn-app/tool-filter-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "tool-filter-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@respawn-app/tool-filter-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "tool-filter-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@respawn-app/tool-filter-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add tool-filter-mcp npx -y @respawn-app/tool-filter-mcp
```

## When to use it
- 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
- Connect `http://localhost:3000/sse` through Tool Filter MCP and hide tools matching `.*_file$`.
- Expose only `read_file` and `search_code` with an `--allow` rule.
- Run a local server through the filter with `npx @respawn-app/tool-filter-mcp --upstream-stdio --deny "dangerous_.*" -- npx my-mcp-server`.

## Similar
- [openai-privacy-filter](https://affpapa.org/en/nevibecode/skills/openai-privacy-filter.md) — skill · 376 installs
- [Aletheia Runtime Safety & Scope Creep Filter](https://affpapa.org/en/nevibecode/mcp/aletheia-runtime-safety-scope-creep-filter.md) — MCP server · ★ 12 repo stars
- [guardrails-safety-filter-builder](https://affpapa.org/en/nevibecode/skills/guardrails-safety-filter-builder.md) — skill · 299 installs
- [writing-hookify-rules](https://affpapa.org/en/nevibecode/skills/writing-hookify-rules.md) — skill · 6941 installs
- [perl-security](https://affpapa.org/en/nevibecode/skills/perl-security.md) — skill · 6800 installs
- [hookify](https://affpapa.org/en/nevibecode/commands/hookify.md) — command · ★ 48129 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
