
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 分
请在仓库或注册中心条目中声明许可证。