mcp-injector is a local MCP daemon that compresses your codebase before sending it to Claude Code, Cursor, or VS Code — using AST body folding and canonical determinism for maximum prompt cache hits.
Free for codebases under 100,000 lines. No signup required.
Run mcp-benchmark on your own repo to see your exact savings.
* Based on Claude Sonnet pricing: $3.00/1M input tokens. Compression tier 3 (fold + strip). Reproducible: clone any repo above and run mcp-benchmark yourself.
Runs as a persistent local daemon. Builds a SQLite index via file watchers — inotify on Linux, FSEvents on Mac. First query is sub-millisecond on any size codebase.
Strips function bodies, keeps signatures and imports. Supports Go, Python, TypeScript, JavaScript, Java, Rust. Compression is fully reversible — Claude can retrieve full source when needed.
Files sorted alphabetically, volatile metadata stripped. Output is byte-identical on every run so Anthropic's KV prompt cache fires instead of invalidating. This is the feature other compressors miss.
Fewer tokens sent. More cache hits. Two separate cost levers working simultaneously. No cloud, no telemetry, runs entirely on your machine.
curl -fsSL https://foldwork.dev/install | sh
{
"mcpServers": {
"mcp-injector": {
"command": "/usr/local/bin/mcp-injector",
"env": {
"MCP_WORKSPACE": "${workspaceFolder}"
}
}
}
}
Free for personal projects. Pay only when it makes financial sense.
At $12/month, mcp-injector pays for itself if you run a 100K+ line codebase through Claude just once.
No. mcp-injector runs entirely on your machine. Your code never leaves your computer. The daemon reads files locally, compresses them locally, and serves them to your IDE via stdio transport. No cloud, no telemetry, no external API calls.
Headroom compresses context on demand. mcp-injector pre-indexes your codebase into a SQLite catalog so the first query is sub-millisecond on any size repo. More importantly, mcp-injector guarantees byte-identical prompt output on every run through canonical determinism — alphabetical file sorting and metadata stripping — so Anthropic's KV prompt cache fires on every session. Headroom's on-demand architecture makes this impossible. You save tokens AND maximise cache hits simultaneously.
Claude Desktop, Cursor, and VS Code with Continue. The installer auto-detects which are installed and configures them automatically.
Go, Python, TypeScript, JavaScript, Java, and Rust. Other file types pass through unmodified.
mcp-injector exposes an injector_retrieve tool. When Claude needs the complete implementation of a compressed function, it calls this tool to fetch the full original source. Compression is always reversible.
Yes. Pro includes 3 seats. Each developer runs their own local daemon — there's no shared server to manage.