[metadata]
apple-mobile-web-app-title: OpenRouter | Documentation
application-name: OpenRouter | Documentation
description: Connect your AI coding tools to OpenRouter over MCP
generator: Mintlify
msapplication-TileColor: #7624F4
msapplication-config: /docs/_mintlify/favicons/openrouter-d02e98a0/EmhfYwFO2tvnkuV-/_generated/favicon/browserconfig.xml
og:description: Plug OpenRouter into the AI tools you already use. Pull live model, pricing, credit, and ranking data, search the docs, and send test messages, all from your editor.
og:image: https://openrouter.ai/dynamic-og?title=OpenRouter%20MCP%20Server&description=Connect%20your%20AI%20tools%20to%20OpenRouter
og:image:height: 630
og:image:width: 1200
og:site_name: OpenRouter Documentation
og:title: OpenRouter MCP Server - OpenRouter
og:type: website
og:url: https://openrouter.ai/docs/guides/overview/mcp-server
twitter:card: summary_large_image
twitter:description: Plug OpenRouter into the AI tools you already use. Pull live model, pricing, credit, and ranking data, search the docs, and send test messages, all from your editor.
twitter:image: https://openrouter.ai/dynamic-og?title=OpenRouter%20MCP%20Server&description=Connect%20your%20AI%20tools%20to%20OpenRouter
twitter:image:height: 630
twitter:image:width: 1200
twitter:title: OpenRouter MCP Server - OpenRouter
viewport: width=device-width, initial-scale=1, viewport-fit=cover

[canonical-links]
https://openrouter.ai/docs/guides/overview/mcp-server

[document-links]
/docs/llms.txt: /docs/llms.txt
API Reference: /docs/api_reference/overview
Agent SDK: /docs/agent-sdk/overview
Anthropic Agent SDK: /docs/guides/community/anthropic-agent-sdk
App Attribution: /docs/app-attribution
Apps: https://openrouter.ai/apps
Arize AX: /docs/guides/community/arize
Auto Exacto: /docs/guides/routing/auto-exacto
Awesome OpenRouter: /docs/guides/community/awesome-openrouter
Batch Beta: /docs/batch-quickstart
Benchmarks: https://openrouter.ai/benchmarks
Chat: https://openrouter.ai/chat
Client SDKs: /docs/client-sdks/overview
Cookbook: /docs/cookbook/get-started/quickstart
Custom Classifiers: /docs/guides/features/classifiers
Data Collection: /docs/guides/privacy/data-collection
Docs: /docs/quickstart
Docs: https://openrouter.ai/docs
Effect AI SDK: /docs/guides/community/effect-ai-sdk
FAQ: /docs/faq
For Providers: /docs/guides/community/for-providers
Frameworks and Integrations Overview: /docs/guides/community/frameworks-and-integrations-overview
Infisical: /docs/guides/community/infisical
Input & Output Logging: /docs/guides/features/input-output-logging
LangChain: /docs/guides/community/langchain
Langfuse: /docs/guides/community/langfuse
Latency and Performance: /docs/guides/best-practices/latency-and-performance
LiveKit: /docs/guides/community/livekit
MCP: /docs/guides/overview/mcp-server
Mastra: /docs/guides/community/mastra
Message Transforms: /docs/guides/features/message-transforms
Model Fallbacks: /docs/guides/routing/model-fallbacks
Models: /docs/guides/overview/models
Models: https://openrouter.ai/models
OpenAI SDK: /docs/guides/community/openai-sdk
OpenRouter | Documentation home page: https://openrouter.ai
Ori Eval: /docs/guides/ori/eval
Ori Harness: /docs/guides/ori/harness
Overview: /docs/guides/overview/multimodal/overview
Presets: /docs/guides/features/presets
Principles: /docs/guides/overview/principles
Private Models: /docs/guides/routing/private-models
Prompt Caching: /docs/guides/best-practices/prompt-caching
Provider Logging: /docs/guides/privacy/provider-logging
Provider Selection: /docs/guides/routing/provider-selection
PydanticAI: /docs/guides/community/pydantic-ai
Quickstart: /docs/quickstart
Rankings: https://openrouter.ai/rankings
Reasoning Tokens: /docs/guides/best-practices/reasoning-tokens
Render: /docs/guides/community/render
Replit: /docs/guides/community/replit
Report Feedback: /docs/guides/overview/report-feedback
Response Caching: /docs/guides/features/response-caching
Router Metadata: /docs/guides/features/router-metadata
SCIM Group Mappings: /docs/guides/features/scim-mappings
Service Tiers: /docs/guides/features/service-tiers
Single Sign-On (SSO): /docs/guides/features/sso
Sovereign AI: /docs/guides/features/sovereign-ai
Stripe Projects: /docs/guides/overview/stripe-projects
Structured Outputs: /docs/guides/features/structured-outputs
Switching Workspaces: /docs/guides/features/workspaces/switching
TanStack AI: /docs/guides/community/tanstack-ai
Tool Calling: /docs/guides/features/tool-calling
Uptime Optimization: /docs/guides/best-practices/uptime-optimization
Vercel AI SDK: /docs/guides/community/vercel-ai-sdk
Where Ori writes files: /docs/guides/ori/files
Workspace Budgets: /docs/guides/features/workspaces/workspace-budgets
Workspaces: /docs/guides/features/workspaces
Xcode: /docs/guides/community/xcode
ZDR: /docs/guides/features/zdr
Zapier: /docs/guides/community/zapier
Zero Completion Insurance: /docs/guides/features/zero-completion-insurance
dashboard: https://openrouter.ai/settings/keys

[structured-data]
{"@context":"https://schema.org","@graph":[{"@id":"https://openrouter.ai/#organization","@type":"Organization","logo":{"@type":"ImageObject","url":"https://mintcdn.com/openrouter-d02e98a0/ksNSeB_K7gD-BUDh/assets/logo-v2-light.svg?fit=max&auto=format&n=ksNSeB_K7gD-BUDh&q=85&s=690e45873843519efe02bcbe45795dac"},"name":"OpenRouter | Documentation","url":"https://openrouter.ai"},{"@id":"https://openrouter.ai/docs#website","@type":"WebSite","name":"OpenRouter | Documentation","publisher":{"@id":"https://openrouter.ai/#organization"},"url":"https://openrouter.ai/docs"},{"@id":"https://openrouter.ai/docs/guides/overview/mcp-server#webpage","@type":"WebPage","breadcrumb":{"@id":"https://openrouter.ai/docs/guides/overview/mcp-server#breadcrumb"},"dateModified":"2026-08-08T19:05:56.352Z","description":"Connect your AI coding tools to OpenRouter over MCP","isPartOf":{"@id":"https://openrouter.ai/docs#website"},"name":"MCP","url":"https://openrouter.ai/docs/guides/overview/mcp-server"},{"@id":"https://openrouter.ai/docs/guides/overview/mcp-server#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","item":"https://openrouter.ai/docs/quickstart","name":"Overview","position":1},{"@type":"ListItem","item":"https://openrouter.ai/docs/guides/overview/mcp-server","name":"MCP","position":2}]},{"@id":"https://openrouter.ai/docs/guides/overview/mcp-server#article","@type":["Article","TechArticle"],"dateModified":"2026-08-08T19:05:56.352Z","description":"Connect your AI coding tools to OpenRouter over MCP","headline":"MCP","image":"https://openrouter.ai/dynamic-og?title=OpenRouter%20MCP%20Server&description=Connect%20your%20AI%20tools%20to%20OpenRouter","isPartOf":{"@id":"https://openrouter.ai/docs#website"},"mainEntityOfPage":{"@id":"https://openrouter.ai/docs/guides/overview/mcp-server#webpage"},"name":"MCP","publisher":{"@id":"https://openrouter.ai/#organization"},"url":"https://openrouter.ai/docs/guides/overview/mcp-server"}]}

[content]
OpenRouter MCP Server - OpenRouter
Documentation Index
Fetch the complete documentation index at:
/docs/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
OpenRouter | Documentation
home page
Search...
⌘
K
Ask Assistant
Models
Benchmarks
Chat
Rankings
Apps
Docs
Search...
Navigation
Overview
MCP
Docs
API Reference
Client SDKs
Agent SDK
Cookbook
Overview
Quickstart
Batch
Beta
Principles
Models
MCP
Multimodal
Authentication
Stripe Projects
FAQ
Report Feedback
Models & Routing
Model Fallbacks
Provider Selection
Auto Exacto
Private Models
Model Variants
Routers
Features
Workspaces
Workspace Budgets
Switching Workspaces
Single Sign-On (SSO)
SCIM Group Mappings
Presets
Custom Classifiers
Response Caching
Tool Calling
Server Tools
Plugins
Structured Outputs
Message Transforms
Zero Completion Insurance
ZDR
App Attribution
Guardrails
Service Tiers
Sovereign AI
Router Metadata
Input & Output Logging
Broadcast
Ori
Ori Eval
Ori Harness
Where Ori writes files
Privacy
Data Collection
Provider Logging
Best Practices
Latency and Performance
Prompt Caching
Uptime Optimization
Reasoning Tokens
Community
For Providers
Frameworks and Integrations Overview
Awesome OpenRouter
Effect AI SDK
Arize AX
LangChain
LiveKit
Langfuse
Mastra
OpenAI SDK
Anthropic Agent SDK
PydanticAI
Render
Replit
TanStack AI
Vercel AI SDK
Xcode
Zapier
Infisical
On this page
Connect your agent
What you can do
Pick the right model for a task
More things you can do
How it works
Troubleshooting
Overview
MCP
Copy page
Copy page
Connect your AI coding tools to OpenRouter over MCP
Copy page
Copy page
The
OpenRouter MCP server
plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
It’s a remote server hosted by OpenRouter (nothing is installed locally). You connect by adding one URL to your MCP client and approving an OAuth login in your browser.
Use this MCP while you build. It lets your coding assistant pull live OpenRouter info (which models exist, what they cost, your credit balance) and send quick test messages, without leaving your editor. To actually run models in your app, keep calling the OpenRouter API directly.
​
Connect your agent
Claude Code
Codex CLI
OpenCode
Cursor CLI
Claude Desktop / Web
claude
mcp
add
--transport
http
openrouter
https://mcp.openrouter.ai/mcp
claude
mcp
login
openrouter
You can also authenticate from inside a session: run
/mcp
, select
openrouter
, and click
Authenticate
.
codex
mcp
add
openrouter
--url
https://mcp.openrouter.ai/mcp
codex
mcp
login
openrouter
# opens the browser OAuth flow
Add this to
~/.config/opencode/opencode.json
. OpenCode runs the OAuth flow automatically on first use, with no separate login step:
{
"mcp"
: {
"openrouter"
: {
"type"
:
"remote"
,
"url"
:
"https://mcp.openrouter.ai/mcp"
,
"enabled"
:
true
}
}
}
The Cursor CLI (
cursor-agent
) reads the same config as the IDE. Add this to
~/.cursor/mcp.json
, then verify with
cursor-agent mcp list
. Authenticate from the Cursor MCP settings, or it prompts on first tool use:
{
"mcpServers"
: {
"openrouter"
: {
"url"
:
"https://mcp.openrouter.ai/mcp"
}
}
}
OpenRouter isn’t in Claude’s connector directory, so add it as a custom connector:
Go to
Settings > Connectors > Customize > Connectors
, click the
+
, then choose
Add custom connector
.
Enter the
Name
OpenRouter MCP
and set the
Remote MCP server URL
to
https://mcp.openrouter.ai/mcp
. Leave the OAuth fields blank.
Click
Add
, then open the connector and
Connect
to run the OAuth flow.
Some organizations don’t allow adding custom connectors, so this option may not appear for everyone. If you don’t see it, talk to your admin.
Not all clients pop up the auth automatically; some need a one-time login step after you add the server. When you trigger it, an OpenRouter consent page opens in your browser where you approve a
dedicated key just for this connection
, separate from your other keys. The key expires after 7 days and starts with a
$10
spend cap (editable on the approval screen). You can disconnect anytime.
​
What you can do
The MCP exposes these tools. Most are read-only lookups against live OpenRouter data. Two exceptions exist.
send-message
and
generate-image
make billable inference calls, and
send-feedback
writes feedback on one of your own generations.
Tool
What it does
send-message
Send a message to any model and get its reply, to test a prompt or compare models
generate-image
Generate an image from a text prompt and get it back inline as an image content block
list-models
Search OpenRouter’s live model catalog: free-text search, sort (including by Artificial Analysis intelligence, coding, and agentic indexes and Design Arena ELO), and filter by use case, prompt/completion price, minimum context, model age, benchmark index ranges, tool-calling success rate, model family, author, provider, input/output modality, supported parameters, and ZDR or region
get-model
Full details for one model by
author/slug
(supports
:variant
suffixes and aliases)
list-model-endpoints
Which providers serve a model, and their price, latency, throughput, and data policy
list-providers
List available providers for routing preferences
list-daily-model-rankings
Which models are most used and trending by token volume
list-app-rankings
Which apps drive the most OpenRouter traffic, filterable by category
get-credits
Your remaining account credit
get-generation
Cost, token counts, and serving provider for a specific generation id
list-benchmarks
Third-party quality scores from Artificial Analysis (intelligence, coding, agentic indexes) and Design Arena (head-to-head elo, win rate)
list-task-classifications
What OpenRouter traffic is used for: market share by task type (code generation, web search, summarization, …) with the top models for each and macro-category (Code, Data, Agent, General) aggregates
search-docs
Search the full OpenRouter docs to answer “how do I…” questions
send-feedback
Report a problem with one of your own generations (category + optional comment), sent to the OpenRouter team
spawn-ori-eval
Get the instructions for running a model eval with Ori (your own agent on your own prompts, on a pinned harness and model), then follow them
install-ori-harness
Get the argument-free recipe for installing the Ori harness and follow it
ping
Health check to verify the connection
​
Pick the right model for a task
You describe a task and the assistant recommends a model for it, with the recommendation backed by live data rather than the model’s stale training knowledge.
send-message
is grounded so the assistant won’t name a model from memory. For any “which model should I use” question, it defers to the live
list-benchmarks
,
list-daily-model-rankings
, and
list-models
tools. The right pick might be the cheapest, the smartest, the fastest, a specific modality, or a particular provider.
By task and trade-off:
“What’s the best model for coding right now?”
“Smartest model for hard reasoning, money no object?”
“Best value model for summarizing long documents?”
By modality (OpenRouter supports far more than text):
“What embedding models are available, and which is best?”
“Do you support reranking models? Recommend one.”
“Best text-to-speech model? What about speech-to-text?”
By benchmark and provider:
“Which model tops the Artificial Analysis intelligence index?”
“What’s the best model for landing page design?”
“Recommend a model and tell me which provider to route to.”
​
More things you can do
“How much credit do I have left on OpenRouter?”
“Which apps send the most traffic to OpenRouter?”
“How do I pin a model to a specific provider, e.g. Bedrock?”
“Send a test message to GPT-5.5 and tell me what it cost.”
“Compare the answers for the same prompt across Opus 4.8, DeepSeek v4 Pro, Gemini 3.5 Flash, and GLM-5.2.”
send-message
understands model slug suffixes: add
:online
for web search,
:nitro
for speed,
:floor
for the lowest price, or
:free
for a free endpoint where one exists. Every reply includes the call’s generation id, which you can pass to
get-generation
to see exactly what it cost and which provider served it. Pin a provider only when you need zero variance, for example when running evals or reproducing a result.
​
How it works
Discovery & auth.
An unauthenticated request returns a
401
that points your client to OpenRouter’s OAuth authorization server. The client registers, you approve the consent page, and a token is issued via PKCE.
Dedicated key.
The issued token is a standard OpenRouter API key labeled
OpenRouter MCP: <app name>
, minted with a 7-day expiry and a
$10
default spend limit so you can find and revoke it from your
dashboard
.
Live data, no local state.
Tools proxy the public OpenRouter API with your key. Nothing is installed locally, and no source code is sent anywhere unless you call
send-message
,
generate-image
, or
send-feedback
.
​
Troubleshooting
Tool calls fail with an auth error.
Re-run the authenticate step for your client. The key may have expired (7-day lifetime) or been disconnected.
The login didn’t pop automatically.
Some clients require a manual trigger. Use the per-client step above.
Models
Overview
⌘
I
Assistant
Responses are generated using AI and may contain mistakes.
