toolc blog

How to combine multiple MCP servers into one endpoint

2026-09-01

Anyone running agents seriously ends up with a pile of MCP servers: a filesystem server, GitHub, one or two internal APIs, a search provider, a weather or data API. Three problems show up on cue.

  1. Config sprawl. Every client (Claude Desktop, an IDE, a headless agent) needs the full server list, credentials included, duplicated and drifting.
  2. Context bloat. Each server adds its whole tool surface to every request. Costs scale with the union, not with what the task needs. We measured this in the tool-overload post.
  3. Overlap. Servers written independently expose lookalike tools, and the model must arbitrate between them from descriptions alone.

Option 1: keep listing servers in the client

Fine at two or three servers. Past that, every new client multiplies setup work, secrets live in N places, and nothing anywhere sees the whole surface, so nothing can fix the overlap problem.

Option 2: a passthrough gateway

One endpoint that proxies many servers solves config sprawl and centralizes credentials and logging. Genuinely useful. But a passthrough forwards the surface as-is: 137 tools in, 137 tools out. The context bloat and the arbitration errors ride straight through.

Option 3: compile

The compiler view treats the combined surface as source code. Introspect every server (MCP servers directly; REST APIs via their OpenAPI spec, or drafted straight from their docs page), build an intermediate representation, then run passes over the whole pool: prune dead tools, rewrite descriptions with cross-server knowledge so lookalikes explicitly say when to use which, consolidate near-duplicate families into routed facades, optionally merge capabilities across servers into single tools. Serve the result as one MCP endpoint with credential injection, full call logging, and per-tool kill switches.

Measured against the raw federation on 60 tasks: same accuracy for a frontier agent at one fifth the cost per completed task, and multi-source arbitration up from 90% to 100%. The numbers, and the case where compilation hurts (small agent models behind heavy indirection), are in the paper.

Try it in two minutes

The engine is open source. Describe your servers in a config file, then run npx @toolc/cli compile and npx @toolc/cli serve for a local endpoint, or use the hosted console at toolc.dev, which adds observability with live tail, error-driven fix recommendations, and usage-based billing with a free tier.

toolc compiles your MCP servers and REST APIs into one lean MCP endpoint. The engine is open source; the hosted console is free to start. Try it or read the paper.