MCP Proxy with tool filtering for Claude Code
Обзор
Intercepts MCP server requests and filters tools based on configuration to reduce token consumption. https://github.com/user-attachments/assets/549f05da-75e2-47b8-b100-9aa3b5f1ccec Wrap your MCP server command with mcproxy: Configure your .mcp.json to use mcproxy as a wrapper. This allows you to control which tools are exposed to Claude. mcproxy automatically creates a .mcproxy.json file in your workspace to manage tool settings. - : Tools are automatically added to the config on first use (default: true). - : Set any tool to false to block it. - : Keys are derived from serverInfo.name@version in the MCP initialize response. 1. : mcproxy intercepts the MCP initialize response to identify the server. 2. : On tools/list, it filters out tools marked as false in .mcproxy.json. 3. : On tools/call, it prevents execution of disabled tools. Set DEBUG=1 to enable verbose logging for troubleshooting:
README
🎥 Demo
https://github.com/user-attachments/assets/549f05da-75e2-47b8-b100-9aa3b5f1ccec
🚀 Installation
run directly with npx (recommended):
npx @team-attention/mcproxy
Or install globally:
npm install -g @team-attention/mcproxy
🛠 Usage
Basic Usage
Wrap your MCP server command with mcproxy:
mcproxy npx -y @modelcontextprotocol/server-filesystem /path/to/dir
With Claude Code (.mcp.json)
Configure your .mcp.json to use mcproxy as a wrapper. This allows you to control which tools are exposed to Claude.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y", "@team-attention/mcproxy",
"--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"
]
},
"linear": {
"command": "npx",
"args": [
"-y", "@team-attention/mcproxy",
"--",
"npx", "-y", "mcp-remote", "https://mcp.linear.app/mcp",
"--header", "Authorization: Bearer ${LINEAR_API_KEY}"
]
}
}
}
⚙️ Configuration
mcproxy automatically creates a .mcproxy.json file in your workspace to manage tool settings.
{
"version": "1.0",
"servers": {
"[email protected]": {
"tools": {
"list_issues": true,
"create_issue": true,
"delete_issue": false
}
}
}
}
- Auto-registration: Tools are automatically added to the config on first use (default:
true). - Disable Tools: Set any tool to
falseto block it. - Server Identity: Keys are derived from
serverInfo.name@versionin the MCP initialize response.
🧩 How It Works
graph LR
A[Claude Code] |stdio| B(mcproxy)
B |subprocess| C[MCP Server]
B -.-> D[.mcproxy.json]
style B fill:#f9f,stroke:#333,stroke-width:2px
- Intercept:
mcproxyintercepts the MCPinitializeresponse to identify the server. - Filter: On
tools/list, it filters out tools marked asfalsein.mcproxy.json. - Block: On
tools/call, it prevents execution of disabled tools.
⚡ Options
| Option | Description |
|---|---|
--config |
Path to workspace root for .mcproxy.json (default: current directory) |
🐞 Debugging
Set DEBUG=1 to enable verbose logging for troubleshooting:
DEBUG=1 mcproxy npx -y @some/mcp-server
License
MIT
Установка
npx -y @team-attention/mcproxy -- npx -y @modelcontextprotocol/server-filesystem /path/to/dirКонфигурация
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y", "@team-attention/mcproxy",
"--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"
]
},
"linear": {
"command": "npx",
"args": [
"-y", "@team-attention/mcproxy",
"--",
"npx", "-y", "mcp-remote", "https://mcp.linear.app/mcp",
"--header", "Authorization: Bearer ${LINEAR_API_KEY}"
]
}
}
}