OpenRouter MCP Server 2026: 400+ Models in 5 Minutes From Claude Code, Codex, or Cursor
On June 27, 2026, OpenRouter shipped a first-party MCP (Model Context Protocol) server that exposes its entire 400+ model catalog as native tools inside Claude Code, Codex, Cursor, Cline, and any MCP-compatible client. The pitch is simple but powerful: instead of hand-editing model slugs and re-pasting curl snippets every time you want to compare GPT-5.5 against Claude Fable 5 against Gemini 3.1 Pro, your IDE now does it for you. This guide walks through what the server exposes, how to wire it into the three major coding agents, and how the architecture compares to manual routing and to building your own MCP proxy.
TL;DR: OpenRouter's MCP server is a remote endpoint at https://mcp.openrouter.ai/mcp that exposes five tools — model_search, model_info, pricing_compare, provider_routing, and chat_completion — over Streamable HTTP transport. Setup is a 5-line JSON config in ~/.claude/mcp_servers.json (or the Cursor/Codex equivalent). It works with Claude Code, OpenAI Codex CLI, Cursor, Cline, Continue.dev, and any other MCP host. The pricing data is live from OpenRouter's catalog, so tool calls reflect yesterday's price cuts, not last month's. The MCP server uses the standard OAuth 2.1 + PKCE flow and is free to use — you only pay for the underlying chat completions.
What the MCP Server Actually Exposes
The server is not a thin wrapper that proxies chat calls. It exposes five domain-specific tools that solve the specific pain points OpenRouter users hit when picking from 400+ models:
model_search— Free-text search across the live catalog. Filter by capability (vision, function calling, 1M+ context), provider, price band, or modality. Returns ranked model IDs plus one-line summaries.model_info— Detailed spec sheet for any model: context window, modalities, supported parameters (tools, structured outputs, response_format), latency p50/p95, and uptime stats.pricing_compare— Given a task profile (expected input/output tokens, with or without caching), return ranked pricing across the relevant models. Includes the 5.5% platform fee automatically.provider_routing— Given a model, list which underlying providers serve it and their individual pricing, uptime, and ZDR (zero data retention) availability. Useful when you want to pin to a specific vendor.chat_completion— A unified OpenAI-compatible chat call. Pass any model ID, get the response. This is what your IDE uses when you ask it to "switch to a cheaper model for this file."
The first four are read-only and don't consume credits. Only chat_completion bills against your OpenRouter PAYG balance. This separation matters for cost-controlled teams: an agent can browse the catalog freely, then route a chat call only when the user explicitly asks for inference.
Setup: Claude Code (5 lines)
Add this to ~/.claude/mcp_servers.json:
JSON config
{
"mcpServers": {
"openrouter": {
"url": "https://mcp.openrouter.ai/mcp",
"transport": "streamable-http"
}
}
} Restart Claude Code. The first time you invoke any of the five tools, you'll get an OAuth 2.1 + PKCE consent screen. Approve once and the token is cached. No API key to copy-paste — the OAuth flow handles key derivation per workspace.
Try it from Claude Code
/mcp openrouter model_search --query "vision model under $1 per million output tokens" Claude Code will call model_search, get back a ranked list (Gemini 3 Flash, GPT-4o-mini, Llama 3.3 70B, Claude Haiku 4.5, etc.), and present them inline. You can then chain a follow-up like "compare pricing for the top 3 on a 5K-in/1K-out task" — that triggers pricing_compare with the actual model IDs.
Setup: OpenAI Codex CLI
Codex CLI uses the same MCP config schema but lives at ~/.codex/mcp_servers.json:
{
"mcpServers": {
"openrouter": {
"url": "https://mcp.openrouter.ai/mcp",
"transport": "streamable-http"
}
}
} Once Codex loads the server, you can ask it the same questions. One thing Codex does particularly well here is the chat_completion fallback: when the default OpenAI model in Codex runs out of quota, you can tell it "switch this session to anthropic/claude-sonnet-4.5 via openrouter" and the MCP server handles the routing without any environment variable changes.
Setup: Cursor
Cursor exposes MCP servers through Settings → Models → Model Context Protocol → Add Server. Point it at:
https://mcp.openrouter.ai/mcp Use the Streamable HTTP transport. After saving, the five OpenRouter tools appear in Cursor's Agent mode. Cursor's tab-completion will suggest them when you type commands like "find a model that..." or "compare pricing on...".
Setup: Cline / Continue.dev / Zed
All MCP-compatible clients accept the same JSON config block. For Cline (VS Code extension), add to ~/.cline/mcp_settings.json:
{
"mcpServers": {
"openrouter": {
"url": "https://mcp.openrouter.ai/mcp",
"transport": "streamable-http"
}
}
} Continue.dev uses ~/.continue/config.json with the same schema. Zed (the Rust IDE) supports MCP natively as of 0.165; the config goes in ~/.config/zed/settings.json under context_servers with { "openrouter": { "url": "https://mcp.openrouter.ai/mcp" } }.
What It Looks Like in Practice
Here's a real workflow that demonstrates why the MCP server matters. You're writing a code-review bot and need to pick a model:
Without MCP (manual):
- Open browser → openrouter.ai/models
- Filter by "code"
- Skim 12 model cards
- Note prices from 3 of them
- Edit config file to test each one
- Run, check output, switch, repeat
With MCP:
/mcp openrouter model_search --query "code review, function calling, under $3/M output" Then:
/mcp openrouter pricing_compare --models "anthropic/claude-sonnet-4.5,openai/gpt-4.1,deepseek/deepseek-v3" --input-tokens 8000 --output-tokens 2000 The agent gets back a markdown table with cost-per-call, latency p50, and uptime for each model. From there, you can immediately invoke chat_completion to test the winner. Total time: under 90 seconds, all inside your IDE.
Architecture: How It Stays Fast and Fresh
Three things make the MCP server feel native instead of "yet another API to wrap":
1. Streamable HTTP, not stdio
Most MCP servers today use stdio transport — they run as local subprocesses that communicate via stdin/stdout. OpenRouter chose Streamable HTTP for a specific reason: the catalog is too large (400+ models, 60+ providers) to fit in a static tool list. With stdio, every model and price becomes a separate tool definition, blowing past the 100-tool limit most clients impose. Streamable HTTP lets the server describe tools on demand, and clients can call them with arbitrary arguments without pre-registering schemas.
2. Live pricing, not a static snapshot
OpenRouter's catalog updates several times a day as providers add models, change prices, or adjust rate limits. The MCP server reads from the same catalog endpoint the web UI uses, so pricing_compare returns yesterday's prices, not last month's. When Qwen 3.5-14B dropped to $0.06/M output on June 26, the MCP server reflected it within hours.
3. OAuth 2.1 + PKCE instead of static API keys
Static API keys in MCP configs are a security smell — they leak into shell history, config syncs, and dotfile repos. OAuth 2.1 with PKCE means each IDE session gets a short-lived bearer token scoped to the workspace, with refresh tokens that rotate. Revoking access is a one-click operation from your OpenRouter dashboard.
Comparison: MCP Server vs Manual Routing vs Custom MCP Proxy
| Approach | Setup time | Catalog freshness | Cost to run | Best for |
|---|---|---|---|---|
| OpenRouter MCP server | 5 min | Live (minutes) | Free + chat costs | Most users; standard IDE setups |
| Manual OpenRouter calls | 30 min initial | Manual updates | Free + chat costs | One-off scripts, CI pipelines |
| Custom MCP proxy | 4-8 hours | Whatever you build | Hosting + chat costs | Air-gapped environments, custom auth |
| Direct provider APIs | 1+ hours per provider | N/A | Provider-direct pricing | Single-provider shops |
The custom MCP proxy route is over-engineered for 95% of teams. The two cases where you'd still build one: (a) you need to enforce a custom approval flow (e.g., legal review before any chat call), or (b) you have an air-gapped environment with no internet egress from the IDE.
Limitations and Gotchas
- No streaming through MCP tools —
chat_completionreturns the full response. For streaming UIs, call the OpenRouter REST endpoint directly. - 5.5% platform fee is not exposed in tool descriptions — It's added to the
pricing_compareoutput, but the per-model fields don't include it. Plan for it when budgeting. - Tool count varies by client — Claude Code and Cursor show all 5 tools. Some lightweight MCP clients cap at 3-4 tools per server and will hide
provider_routing. - OAuth token expires after 30 days of inactivity — Re-consent is one click from the dashboard.
- No support for BYOK (bring your own key) — All calls route through OpenRouter's balance. If you have direct Anthropic/OpenAI credits, the MCP server won't use them.
FAQ
Q: Is the OpenRouter MCP server free to use?
A: Yes for the four read-only tools (model_search, model_info, pricing_compare, provider_routing). The chat_completion tool uses your PAYG balance at standard rates plus the 5.5% platform fee.
Q: Does this work with Claude Desktop (not Code)?
A: Yes. Claude Desktop supports remote MCP servers as of the 1.5 release. The config goes in ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent path on Windows/Linux.
Q: Can I use the MCP server with a free OpenRouter account?
A: You can install and explore the four read-only tools with a free account. chat_completion requires PAYG credits (minimum $5 top-up).
Q: How is this different from the OpenRouter REST API?
A: The REST API exposes chat completions and credit management. The MCP server exposes catalog discovery and routing intelligence. They complement each other: most workflows use MCP tools for browsing and comparison, then drop to REST for streaming production calls.
Q: Will the MCP server route through provider-direct endpoints (Anthropic, OpenAI) or always through OpenRouter's infra?
A: Always through OpenRouter's infra. If you need provider-direct routing (for lower latency or compliance reasons), use the provider_routing tool to discover which providers serve a model, then call their APIs directly.
Q: Does the MCP server support ZDR (zero data retention)?
A: The MCP tools themselves don't store any data. For chat completions, you can pass "zdr": true in the request body — the server forwards it to providers that support ZDR.
Conclusion
OpenRouter's MCP server is the missing piece that turns "aggregator with 400+ models" into "actual workflow tool." For the first time, your IDE can answer questions like "which model is cheapest for a 5K-token code review?" or "switch this session to a model that handles 1M context" without you ever leaving the editor or copying a curl snippet.
For most teams, the 5-minute setup is a clear win over maintaining a custom MCP proxy or hand-coding model comparisons. The OAuth flow keeps credentials out of dotfiles, the catalog stays live, and the five-tool surface area covers the 90% case for switching models mid-session.
If you want to try it, sign up at OpenRouter and add the 5-line config to your IDE. For teams that need multi-provider access with deterministic model selection and ZDR guarantees, aggregators like FreeModel provide OpenAI-compatible endpoints with China-direct routing — useful when OpenRouter's standard routing doesn't reach the regions you need.