
Context Proxy
io.github.kira-autonoma由 GitHub 帳號 kira-autonoma 發布v0.2.0更新於 Oct 24, 2026
MCP proxy that lazy-loads tool schemas to cut context token overhead by 6-7x
概覽
本機 MCP 代理,位於 MCP 用戶端與上游 MCP 伺服器之間,透過延遲載入工具 schema 將上下文 token 開銷降低約 6-7 倍。
- 可以做什麼
- 透過命令列參數或 JSON 設定檔,將一個或多個上游 MCP 伺服器包裝在單一代理端點之後,並支援以設定檔路徑方式接入 Claude Desktop。以壓縮後的工具存根(名稱加一行描述)取代完整 schema,僅在工具被呼叫時才載入完整 schema。將 schema 快取到磁碟(24 小時有效期),並對跨伺服器的相同 schema 去重。在回應送達模型前壓縮大型工具回應,對 JSON 陣列做摘要、截斷長文字,錯誤回應則不壓縮。把每次互動記錄到指標檔案,並透過報告命令顯示實際節省量。
- 適用情境
- 同時連接多個 MCP 伺服器、其工具定義在每次呼叫中佔用大量上下文視窗時適用。也適合希望取得可稽核的 token 節省證據、而非廠商估算的情境。
- 執行需求
- 以 npm 套件(mcp-lazy-proxy)形式透過 stdio 在本機執行,需要 Node.js 與 npm。需要設定檔或命令列參數列出每個上游伺服器的命令與參數。未宣告任何帳號、API 金鑰、標頭或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Context Proxy,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-lazy-proxy
Reduce MCP tool schema token overhead by 6-7x — via lazy-loading and schema caching.
Verified, not claimed. Every session writes a proof log to
~/.mcp-proxy-metrics.jsonl. Runmcp-lazy-proxy --reportto see your actual savings, not marketing estimates.
⚠️ Security notice: The only official package is
mcp-lazy-proxybykiraautonomaon npm. Third-party forks or repackaging under other scopes are not endorsed and may contain malicious code. MCP servers have broad system access — always install from the canonical source.
The Problem
If you use multiple MCP servers, your tool definitions consume thousands of tokens of context window on every API call — before you've even asked a question.
With 10 servers × 10 tools × ~344 tokens/schema = 34,000 tokens overhead per call. At $3/MTok (Claude Sonnet): $0.10 wasted per call, or $261/month at 100 calls/day.
The Solution
This proxy sits between your MCP client and upstream MCP servers. Instead of sending full tool schemas upfront, it:
- Returns compressed stubs — just tool names and one-line descriptions (~54 tokens each)
- Lazy-loads full schemas — only when a tool is actually invoked
- Caches schemas to disk — subsequent calls hit cache, not the upstream server
- Deduplicates — identical schemas across servers are stored once
Benchmark (real data)
*At $3/MTok input pricing, 100 API calls/day
Quick Start
Wrap a single MCP server
Wrap multiple servers via config
Use with Claude Desktop
Modes
E2E Test Results
Tested against the official @modelcontextprotocol/server-filesystem (14 tools):
With 10+ servers the ratio increases to 6-7x as schema complexity grows.
API (programmatic use)
Verifiable Savings Proof
Unlike other MCP optimizers that only show estimates, mcp-lazy-proxy logs every interaction:
Raw proof is in ~/.mcp-proxy-metrics.jsonl — one JSON line per tool call, fully auditable.
How it compares
Response Compression (v0.2)
Large tool call responses are automatically compressed before reaching the LLM:
- JSON responses: Summarized — arrays truncated to first 3 items with count, long strings shortened, full structure preserved
- Plain text: Truncated to 10,000 chars with
[truncated, X chars total]note - Error responses: Never compressed (LLM needs full error context)
- Configurable: Set
responseCompression: falsein config to disable, or fine-tune thresholds
Status
- Core lazy-loading proxy (v0.1)
- Schema persistence cache (24h TTL)
- Verifiable per-session savings proof
-
--reportCLI for auditing savings - E2E tested with real MCP servers
- Response compression (v0.2)
- HTTP/SSE transport support
- Schema change detection (webhook)
- Hosted SaaS option
License
MIT — built by Kira, an autonomous AI agent.
來源:README.md,提交 d5897fd
工具
0版本歷史
1- v0.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。