mcp-facade
mcp-facade
汎用 MCP ファサード: 1 つの stdio プロセスが上流の MCP サーバーの前に立ち、設定されたツールの一部だけを、スキーマを圧縮して公開します。さらに、カタログの残りをオンデマンドで利用可能にする 3 つのメタツール(discover, describe, call)を備えています。
なぜ
MCP サーバーが公開するすべてのツールは、すべてのリクエストで JSON スキーマとしてモデルのコンテキストに注入されます。40 個のツールを持つ大きなサーバーは、実際の作業を行う前に、セッションごとに数万トークンを消費します。その大半は、呼び出さないツールです。
このファサードは経済性を逆転させます。実際に使うツール(used に列挙)にだけ、完全なスキーマのトークンを支払い、しかもそれを要点まで圧縮します。その他はすべてメタツール経由で発見可能なままであり、メタツールは合計 3 つの小さなスキーマしか使いません。
Related MCP server: @zhangzwd/mcp-gateway
動作
stdio MCP サーバーとして実行します:
bun run facade.ts --server <name>。上流サーバーごとに 1 プロセスです。facade.servers.json(facade.tsの隣)を読み込み、<name>エントリを選択します。最初の
tools/listで上流カタログを取得してディスクにキャッシュします(~/.omp/agent/mcp-facade/catalogs/<name>.json、TTL 7 日)。上流接続は遅延で、最初の使用まで何も接続しません。
各
usedツールを、圧縮されたスキーマで配信します:すべての
description文字列(ツールレベルと JSON スキーマ内)は最初の一文だけにし、最大 140 文字に短縮します。$comment、examples、defaultキーは再帰的に削除します。構造(types、properties、required、enums)はそのまま保持します。
ツール名は小文字化されます。ルックアップは大文字小文字を区別しません。
常に 3 つのメタツールを追加します(下記参照)。
tools/listの時点でカタログを取得できない場合、メタツールのみを提供することにフォールバックし、理由を stderr に記録します。呼び出しを上流に転送します。
credentialIdを持つ HTTP 上流で、401/不正/トークン有効期限切れエラーが発生した場合、トークンの強制リフレッシュを 1 回行い、再試行を 1 回だけ実行します。
メタツール
Tool | 目的 |
| 上流カタログ全体をキーワード検索します(名前と説明の部分文字列一致、最大 10 件)。 |
| 小文字の名前を指定して、1 つのツールの完全なオリジナルのスキーマとドキュメントを返します。慣れていないツールを呼ぶ前に使います。 |
|
|
典型的なエージェントの流れ: discover "worklog" → describe addworklog → call { tool: "addworklog", args: { ... } }
要件
Bun(ファサードが TypeScript を直接実行します)。
OAuth で保護された HTTP 上流の場合:
~/.bun/bin/ompに OMPompCLI がインストールされ、その資格情報が認証済みであるか必要です。ファサードはomp token <credentialId>(再試行時はomp token --force-refresh <credentialId>)でトークンを取得します。秘密情報は設定に一切保存されません。環境変数(API キー、トークン)を必要とする stdio 上流の場合:
~/.claude.jsonに Claude ホスト設定が存在し、そのサーバーのenvブロックを含んでいる必要があります(後述のenvFromを参照)。
インストール
bun install
cp facade.servers.example.json facade.servers.json # then editfacade.servers.json は gitignore されています。ローカルパスを含む可能性があるためです。
設定
facade.servers.json はサーバー名を、上流サーバーと使用ツールのリストにマッピングします:
{
"<name>": {
"upstream": {
// HTTP upstream (Streamable HTTP transport):
"url": "https://mcp.example.com/v1/mcp",
"credentialId": "mcp_oauth:profile:default:https://mcp.example.com/v1/mcp" // optional
// …or stdio upstream:
// "command": "/usr/local/bin/npx",
// "args": ["-y", "@example/mcp-server"],
// "envFrom": "claude:<server-name>", // optional: pull env from ~/.claude.json mcpServers.<server-name>.env
// "env": { "EXTRA": "value" } // optional: merged on top
},
"used": ["tool_one", "tool_two"] // exposed directly; everything else via meta-tools
}
}注意:
usedエントリは大文字小文字を区別せずマッチし、小文字で配信されます。envFromは現在claude:<name>プレフィックスのみサポートしています。usedが空リストでも有効です。その場合、ファサードはメタツールのみを公開します。
ホストへの登録
ホストの MCP 設定をファサードに向けます。上流サーバーごとに 1 エントリを置きます:
{
"mcpServers": {
"acme": {
"command": "/path/to/bun",
"args": ["run", "/path/to/mcp-facade/facade.ts", "--server", "acme-http"]
}
}
}⚠️ stdout はプロトコル
stdio トランスポートは stdout を専有します。絶対にログ、診断、デバッグ出力を stdout に書き出さないでください。stdout 上の出力は JSON-RPC ストリームを破壊し、ホストを on 固まらせます。ファサードは stderr にのみログを出力します(console.error)。フォークした場合もそのようにしてください。
制限
ハードコードされたパス: カタログキャッシュは
~/.cache/agent/mcp-facade/catalogs/、OMP バイナリは~/.bun/bin/omp、envFromは~/.claude.jsonのみを読みます。カタログは 1 回の
listTools呼び出しで取得されます。ページネーションもtools/list_changedの処理もありません。最新の上流ツール変更を取り込むには、ファサードを再起動する(または 7 日間の TTL の期限が切れるのを待つ)必要があります。discoverは単純な文字列部分一致で、最大 10 件の結果です。認証失敗時の再試行は 1 回のみです。それ以外の上流のエラーはそのまま伝播します。
上流の prompts、resources、sampling には対応していません。ツールのみです。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Search, inspect and invoke every public tool on Invokera through one MCP connection.
Related MCP Servers
- AlicenseAqualityDmaintenanceA stdio MCP proxy that connects to one or more upstream MCP servers and exposes their tools, resources, and prompts through a single endpoint with a configurable middleware pipeline.14163MIT
- AlicenseNot gradedqualityBmaintenanceA lightweight MCP gateway that aggregates multiple MCP services into a unified stdio interface, automatically prefixing tool names with the service name to avoid conflicts.18MIT
- AlicenseNot gradedqualityBmaintenanceServes any OpenAPI 3.x/Swagger 2.x API as a local MCP server over stdio, converting every operation into a tool that proxies requests to the upstream API with configurable headers and fixed parameters.11MIT
- AlicenseNot gradedqualityBmaintenanceA deterministic MCP tool-list relay that lets operators filter tools by include/exclude rules and exposes a filtered stdio MCP server to local clients.18MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Jardelvorpagel/mcp-facade'
If you have feedback or need assistance with the MCP directory API, please join our Discord server