Local multi-backend LLM gateway. One process speaks four backends through three API protocols, so existing client code works unchanged.
ClaudeMCP
Open sourceLocal multi-backend LLM gateway. One process speaks four backends through three API protocols, so existing client code works unchanged.
- Node.js 20+
- TypeScript
- Express
- Zod
- Vitest
- SQLite
- Busboy
- zstd
- async iterables
- OpenAI-compatible HTTP
The problem
AI engineering workflows hit three friction points that compound. First, you pay for Claude Max or a Gemini subscription, and your agentic tooling wants to charge you again to use the same models via API, doubling the bill for using your own subscription. Second, you have local models running in Ollama or LM Studio but they are not addressable through the same client code that already talks to cloud APIs, so workflows fragment by where the model lives. Third, you want to mix and match: send the easy stuff to a local model for free, send the hard reasoning to Claude, send vision work to Gemini, but every client SDK assumes a single provider.
The result for most teams is either pay twice, fork the codebase per backend, or pick one backend and live with its weaknesses.
The approach
ClaudeMCP is a single local gateway process serving four backends through three API protocols simultaneously. Existing first-party SDKs (Anthropic, OpenAI, Google) work unchanged when pointed at the gateway. Underneath are two normalized internal types: a backend-agnostic NormalizedRequest shape modeled on the Anthropic Messages API so content blocks pass through translation without renaming, and a NormalizedEvent streaming union that backends emit as async iterables.
The Claude and Gemini backends invoke the CLI tools rather than the cloud APIs, which reuses the subscription auth already on disk and eliminates double billing for users with a Max or paid subscription. LM Studio and Ollama backends each support multiple named instances, so a local fast instance and a remote workstation instance with larger models can both be addressed naturally: ollama:local/llama-3.1-8b versus ollama:remote-workstation/llama-3.1-70b. The router probes local backends on an interval to keep the model registry current as models are loaded and unloaded.
A compatibility test suite exercises the real first-party SDKs against the running server with mock backends. If a wire envelope drifts during translation, the SDK's own parser throws. That keeps the protocol shims honest without requiring a real installation of every cloud provider to test against.
Status
Working tool with API key authentication, response cache (in-memory plus disk-backed), SQLite-backed archive with zstd compression for debugging and downstream analysis, file store with TTL eviction, and a localhost-bound admin UI. The compat suite runs in CI.
Scope is personal use or trusted small-team local deployments. It will sit behind a reverse proxy on a LAN for trusted teams, but it does not aim to be a multi-tenant SaaS gateway and does not implement rate limiting, quotas, or per-user accounting. The original use case (Claude Code CLI usage with no extra API cost on top of a Claude Max subscription) still works, and the architecture generalizes cleanly to additional backends and protocols as needed.
Continue reading
Want this approach for your organization?
The patterns shown in this case study apply directly to client engagements in AI Adoption and Digital Transformation. If you are evaluating whether this approach fits your situation, the fastest path is a short conversation.