One endpoint for chat + MCP: why we built MCP passthrough
If you've built a tool-calling agent in the last six months, you've probably run into the same wall: your app talks to an LLM gateway for chat completions, and it talks to your MCP servers for tool context. Two clients. Two protocols. Two sets of retries, rate limits, and auth headers to babysit.
We think that's silly. That's why Leanroute now carries MCP servers straight through to Anthropic — one endpoint, one request shape, one bill.
What's actually different
Every LLM gateway on the market — OpenRouter, LiteLLM, Portkey, Helicone — routes chat completions. That's the table-stakes feature. None of them (as of today) forward MCP tool-server references end-to-end to the model. If you want MCP in your stack, you're wiring it up yourself: a separate MCP client, a separate tool loop, and a separate integration to debug when something breaks.
Leanroute's MCP passthrough is a single field on your existing /v1/chat/completions request:
{
"model": "anthropic/claude-sonnet-5",
"messages": [{ "role": "user", "content": "What upcoming meetings do I have this week?" }],
"mcp_servers": [
{
"type": "url",
"url": "https://your-mcp-server.example.com/sse",
"name": "calendar",
"authorization_token": "eyJhbGciOi..."
}
],
"max_tokens": 1024
}
Leanroute forwards mcp_servers to Anthropic's Messages API verbatim, Claude connects to each server, calls tools as needed, and returns the final answer in OpenAI-compatible shape. No separate tool loop in your code. Your existing OpenAI SDK works unchanged.
Why Anthropic first
Anthropic's Messages API is currently the only chat-completion API that natively consumes mcp_servers. That gave us a clear v1 path: forward the field, add the anthropic-beta: mcp-client-2025-11-20 header, and let Claude do the heavy lifting server-side.
For v2 (planned for /v2), we're building a gateway-hosted MCP shim so the same request shape works for OpenAI, Google, xAI, DeepSeek, and every APAC provider we route to. The mcp_servers field on your request will be identical; we'll translate under the hood. Same API contract, cross-provider tool calling.
What you get today
Send mcp_servers to api.leanroute.dev/v1/chat/completions with an anthropic/* model. You get back:
- OpenAI-shape response with tool results already incorporated
x-gateway-mcp-passthrough: Nheader confirming how many servers were forwardedx-gateway-provider: anthropicheader confirming routing- The same flat $15/mo BYOK plan that covers your chat traffic
If you accidentally set mcp_servers on a non-Anthropic model, we refuse loudly with mcp_unsupported_provider rather than silently dropping the field. Silent drops are how tool-calling agents break in production.
Arbitrage + MCP
Requests with mcp_servers are excluded from same-tier cost arbitrage — swapping to a non-MCP-capable model would silently break your integration. If you pointed at anthropic/claude-sonnet-5, that's exactly what runs.
Try it
See the MCP passthrough docs for the full request/response shape, error codes, and provider support matrix. The sandbox at sandbox.leanroute.dev doesn't include MCP by design (real MCP servers need real auth tokens), but the docs page has runnable curl examples.
If you're building a tool-calling agent on Claude today and you'd rather not maintain your own MCP client, this is the shortcut.