
Context Proxy
io.github.kira-autonomaPublished by GitHub account kira-autonomav0.2.0Updated Oct 24, 2026
MCP proxy that lazy-loads tool schemas to cut context token overhead by 6-7x
Overview
A local MCP proxy that sits between an MCP client and upstream MCP servers, lazy-loading tool schemas to cut context token overhead by roughly 6-7x.
- What you can do
- Wrap one or more upstream MCP servers behind a single proxy endpoint, configured by CLI flag or JSON config file, including Claude Desktop setup via a config path argument. Serve compressed tool stubs (names and one-line descriptions) instead of full schemas, loading full schemas only when a tool is invoked. Cache schemas to disk with a 24-hour TTL and deduplicate identical schemas across servers. Compress large tool responses before they reach the model, summarizing JSON arrays and truncating long text, while leaving error responses intact. Log every interaction to a metrics file and print actual savings with a report command.
- When to use it
- Useful when several MCP servers are connected at once and their tool definitions consume a large share of the context window on every call. Also relevant when you want auditable evidence of token savings rather than vendor estimates.
- Requirements
- Runs locally over stdio as an npm package (mcp-lazy-proxy), so Node.js and npm are needed. A config file or CLI arguments listing each upstream server's command and arguments. No accounts, API keys, headers or environment variables are declared.
Installation
In SourceWeft
- Open Context Proxy in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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.
Source: README.md at commit d5897fd
Tools
0Version history
1- v0.2.0LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.