
pro-vi/mcp-filter
Analytics & monitoringこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
pro-vi/mcp-filter は [https://github.com/pro-vi/mcp-filter.] からインポートされた MCP サーバーの候補です
概要
pro-vi/mcp-filter は [https://github.com/pro-vi/mcp-filter.] からインポートされた MCP サーバーの候補です
概要(AI 翻訳)
MCP フィルター プルオキシ MCP (Model Context Protocol) サーバは、上流のツール面をフィルタリングし、必要なツールだけをフィルタリングします。 トークンコストを削減しながら、複数の重要なツール(例えば、Supabase の execute sql )を 1 つまたは 2 つ露出し、上流の実装を変更する必要はありません。
前後
前に: フィルタリングされていないMCPサーバーは、新しいClaudeコードセッションで~50kトークンを消費しました
以降: mcp-filter では、必要なすべてのツールを保ちながら、~13.7k トークン(72% 削減)に削減されます。
必要なツールだけをフィルタリングし、コンテキストを長期間保存します。
トークンの使用状況を見る: Claudeコードを開き、[/context]を実行して、ブレイクダウンを表示します。
何と理由
-Static allowlist は、ツールのスキーマをシリアライズするクライアントのコンテキスト使用量を小さくし、切断します。 -Drop-in proxy: stdio または HTTP/SSE を話す MCP サーバーの前で、呼び出しを透過的に転送します。
- 安全ガードレール:オプションのレグックスベースのディニーリスト、オプションのプレフィックス、および保守性のためのオプションのヘルスツール。
インストール
Python 3.10+ がサポートされています。 3.11 が推奨されます。
##pip の使用
uv の使用 (高速、モダンな代替)
**ソース(開発):**から
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Before & After
Before: Unfiltered MCP servers consumed ~50k tokens on a fresh Claude Code session
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ claude-sonnet-4-5 · 112k/200k tokens (56%)
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ System: 2.3k tokens
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ System tools: 11.8k tokens
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ MCP tools: 50.1k tokens (25%) ← Large!
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Free space: 88k (44%)
After: With mcp-filter, reduced to ~13.7k tokens (72% reduction) while keeping all necessary tools.
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛶ ⛶ claude-sonnet-4-5 · 80k/200k tokens (40%)
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System: 2.3k tokens
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 11.8k tokens
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ MCP tools: 13.7k tokens (6.9%) ← Filtered!
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Free space: 120k (60%) ← +32k gained
Filter only the tools you need, save context for longer sessions.
To see your token usage: Open Claude Code and run /context to view the breakdown.
What & Why
- Static allowlist keeps the exposed tool list tiny, cutting context usage for clients that serialize tool schemas.
- Drop-in proxy: stands in front of any MCP server that speaks stdio or HTTP/SSE, forwarding calls transparently.
- Safety guardrails: optional regex-based deny list, optional prefix, and optional health tool for observability.
Installation
Python 3.10+ is supported; 3.11 is recommended.
Using pip
pip install mcp-filter
Using uv (faster, modern alternative)
# Run directly without installing (like npx)
uvx mcp-filter --version
# Or install globally
uv tool install mcp-filter
From source (development):
pyenv install 3.11.9
pyenv local 3.11.9
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
Quick Start
mcp-filter run \
-t stdio \
--stdio-command npx \
--stdio-arg=-y \
--stdio-arg @supabase/mcp-server-supabase@latest \
--stdio-arg=--access-token \
--stdio-arg YOUR_TOKEN \
-a "execute_sql,list_tables,get_project"
Shorthand flags: -t (transport), -a (allow-tool), -d (deny-pattern), -p (prefix)
Note: Each repeatable --stdio-arg value is forwarded as one literal argument. Use --stdio-arg=value when the value begins with -. Tool allowlists passed with -a may be comma-separated.
How to Wrap Your MCP
Concept
Transform any existing MCP server config by wrapping it with mcp-filter. The filter proxies your original command and only exposes the tools you specify with -a.
インストール
npx -y @supabase/mcp-server-supabase@latest --access-token YOUR_TOKEN設定
{
"mcpServers": {
"supabase": {
"command": "npx",
"args": [
"-y",
"@supabase/mcp-server-supabase@latest",
"--access-token",
"YOUR_TOKEN"
]
}
}
}