Tool Filter MCP
tool-filter-mcp
正規表現ベースの拒否リストを使用して、アップストリームのMCPサーバーからツールをフィルタリングするMCPプロキシサーバー。
メンテナンス状況: ✅ はい (2026年春/夏)
なぜこれを使うのか?
効果的なコンテキストエンジニアリングのために、無駄なトークンを最小限に抑える必要があります。現在、主要なエージェントのほとんど(例: Claude Code)は、コンテキストからツール説明を削除しません。 ツールが完全に拒否され使用されていない場合でも、モデルは依然としてその説明全体を受け取り、それでもそのツールを呼び出そうとします(そしてエラーメッセージを受け取ります)。github、supabase、jetbrains IDE、atlassianなどの大規模なMCPの場合、これはコンテキストにとって壊滅的であり、40〜60kの無駄なトークンによるコンテキスト汚染につながります。 エージェントにJiraチケットの説明を表示させたいだけなのに、Confluenceページで担当者を編集するための44個の無駄なツールも一緒に表示されてしまいます。
このMCPは、オーバーヘッドを導入することなく、この問題を完全に解決します。貢献を歓迎します!
Related MCP server: mcp-schema-bloat-fixer
インストール
# For HTTP/SSE MCP servers
npx @respawn-app/tool-filter-mcp --upstream <url> --deny <patterns>
# For stdio MCP servers
npx @respawn-app/tool-filter-mcp --upstream-stdio --deny <patterns> -- <command> [args...]使用方法
基本的な例 (HTTP/SSE)
HTTP MCPサーバーから .*_file$ パターンに一致するツールをフィルタリングします:
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--deny ".*_file$"基本的な例 (stdio)
ローカルのstdio MCPサーバーからツールをフィルタリングします:
npx @respawn-app/tool-filter-mcp \
--upstream-stdio \
--deny "dangerous_.*" \
-- npx my-mcp-server環境変数を使用する場合 (stdio)
アップストリームのstdioサーバーに環境変数を渡します:
npx @respawn-app/tool-filter-mcp \
--upstream-stdio \
--env "API_KEY=secret123" \
--env "DEBUG=true" \
--deny "admin_.*" \
-- npx my-mcp-server複数のパターン
カンマ区切りのパターンを使用します:
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--deny "get_file_text,create_new_file,replace_text"認証ヘッダーを使用する場合
認証用のカスタムヘッダーを追加します:
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--header "Authorization: Bearer your-token-here" \
--header "X-API-Key: your-api-key"ヘッダーは環境変数の展開をサポートしています(アプリ側でまだ展開されていない場合):
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--header "Authorization: Bearer $AUTH_TOKEN"利用可能なツールの一覧表示
フィルターを設定する前に、利用可能なツールを確認します:
# Default table format
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--list-tools
# Get comma-separated names for copy-paste
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--list-tools --format=names
# Get full JSON with schemas
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--list-tools --format=json
# Preview filtered results
npx @respawn-app/tool-filter-mcp \
--upstream http://localhost:3000/sse \
--deny ".*_file$" \
--list-tools --format=namesClaude Code での使用
HTTP/SSE アップストリームサーバー
.mcp.json に追加します:
{
"mcpServers": {
"filtered-http-server": {
"command": "npx",
"args": [
"@respawn-app/tool-filter-mcp",
"--upstream",
"http://localhost:3000/sse",
"--deny",
"dangerous_tool_1,dangerous_tool_2"
],
"type": "stdio"
}
}
}認証ヘッダーを使用する場合(環境変数の展開をサポート):
{
"mcpServers": {
"filtered-http-server": {
"command": "npx",
"args": [
"@respawn-app/tool-filter-mcp",
"--upstream",
"http://localhost:3000/sse",
"--header",
"Authorization: Bearer ${API_TOKEN}",
"--header",
"X-Custom-Header: $CUSTOM_VALUE",
"--deny",
"sensitive_.*"
],
"type": "stdio"
}
}
}Stdio アップストリームサーバー
{
"mcpServers": {
"filtered-zen": {
"command": "npx",
"args": [
"@respawn-app/tool-filter-mcp",
"--upstream-stdio",
"--deny",
"dangerous_.*,sensitive_.*",
"--",
"npx",
"my-mcp-server"
],
"type": "stdio"
}
}
}アップストリームサーバーに複数の引数を渡す場合:
{
"mcpServers": {
"filtered-stdio-server": {
"command": "npx",
"args": [
"@respawn-app/tool-filter-mcp",
"--upstream-stdio",
"--deny",
"admin_.*",
"--",
"node",
"my-mcp-server.js",
"--config=config.json",
"--verbose"
],
"type": "stdio"
}
}
}ダッシュで始まる引数(uvxなど)を使用する場合:
{
"mcpServers": {
"filtered-uvx-server": {
"command": "npx",
"args": [
"@respawn-app/tool-filter-mcp",
"--upstream-stdio",
"--deny",
"test_.*",
"--",
"uvx",
"--from",
"git+https://github.com/BeehiveInnovations/zen-mcp-server.git",
"zen-mcp-server"
],
"type": "stdio"
}
}
}アップストリームのstdioサーバーに環境変数を使用する場合:
{
"mcpServers": {
"filtered-server-with-env": {
"command": "npx",
"args": [
"@respawn-app/tool-filter-mcp",
"--upstream-stdio",
"--env",
"API_KEY=${MY_API_KEY}",
"--env",
"DEBUG=true",
"--deny",
"admin_.*",
"--",
"npx",
"my-mcp-server"
],
"type": "stdio"
}
}
}CLI オプション
ツールリスト
プロキシサーバーを起動せずに、利用可能なツールの一覧を表示します
--list-tools: アップストリームから利用可能なツールを一覧表示して終了します--format <type>:--list-toolsの出力形式(デフォルト:table)table: 説明付きの人間が読める形式のテーブル(100文字で切り詰められます)json: 完全なスキーマを含むJSON出力names: コピー&ペーストしやすいカンマ区切りのツール名
接続モード (相互排他)
プロキシサーバーを起動するには、以下のいずれかを正確に指定する必要があります:
--upstream <url>: アップストリームのHTTP/SSE MCPサーバーに接続します--upstream-stdio: アップストリームのstdio MCPサーバーを起動して接続します--セパレーターの後にコマンドと引数が必要です例:
--upstream-stdio -- npx zen-mcp-server
共通オプション
--deny <patterns>: フィルタリングするツールのカンマ区切り正規表現パターン
HTTP/SSE モードオプション
--upstream を使用する場合のみ適用されます:
--header <name:value>: アップストリームサーバーに渡すカスタムHTTPヘッダー(複数のヘッダーに対して繰り返すことができます)形式:
--header "Header-Name: value"環境変数の展開をサポート:
$VARまたは${VAR}例:
--header "Authorization: Bearer $TOKEN"
Stdio モードオプション
--upstream-stdio を使用する場合のみ適用されます:
--env <KEY=value>: アップストリームのstdioサーバーに渡す環境変数(複数の変数に対して繰り返すことができます)形式:
--env "KEY=value"例:
--env "API_KEY=secret" --env "DEBUG=true"
--セパレーターの後に、コマンドとそのすべての引数を指定します--以降のすべてがアップストリームサーバーに渡されますダッシュで始まる引数(
--from、--configなど)をサポートしています例:
--upstream-stdio -- uvx --from git+https://... package-name
要件
Node.js >= 20.0.0
アップストリームのMCPサーバー:
SSE またはストリーム可能なHTTPトランスポート (
--upstreamの場合)、またはstdioトランスポート (
--upstream-stdioの場合)
ライセンス
MIT
Copyright (c) 2026 Respawn LLC
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Zero-LLM guardrail MCP to detect prompt injections, redact/HMAC PII, and validate tool args.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA generic MCP proxy that filters which tools are exposed from a remote MCP server, reducing context window token usage by only loading the tools you actually need.9 npm1MIT
- AlicenseNot gradedqualityDmaintenanceReduces token costs from MCP tool schemas by analyzing bloat, compressing descriptions, and selecting only relevant tools for AI agents.MIT
- FlicenseNot gradedqualityDmaintenanceScopes MCP tool definitions and strips Markdown from outputs to minimize token usage, improving agent cost and accuracy.-
- FlicenseNot gradedqualityCmaintenanceEnables safe use of any MCP server by proxying and live-scanning all tool requests and responses, blocking or redacting poison descriptions, indirect prompt injection, malicious arguments, and unauthorized destinations.-