MCP server for OpenRouter.ai integration
MCP server for OpenRouter.ai integration. Exposed over MCP by the openrouterai mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.
A Model Context Protocol (MCP) server providing seamless integration with OpenRouter.ai's diverse model ecosystem. Access various AI models through a unified, type-safe interface with built-in caching, rate limiting, and error handling.
The server ships on npm as @mcpservers/openrouterai, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.
Everything the assistant can do here goes through one of these:
Prerequisites — 1. Get your OpenRouter API key from OpenRouter Keys 2. Choose a default model (optional)Setup — Add to your MCP settings configuration file (cline_mcp_settings.json or claude_desktop_config.json):chat_completion — This example requests a completion from anthropic/claude-3-haiku, limits the response to 500 tokens. It specifies provider routing options: prefersearch_models — The search_models tool exposed by this serverget_model_info — The get_model_info tool exposed by this servervalidate_model — // Response: // Success: { isError: false, valid: true } // Error: { isError: true, error: "Model not found" }You will need 5 environment variables: OPENROUTER_API_KEY, OPENROUTER_DEFAULT_MODEL, OPENROUTER_MAX_TOKENS, OPENROUTER_PROVIDER_QUANTIZATIONS, OPENROUTER_PROVIDER_IGNORE. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
This sits in the AI and media services group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Openrouterai's toolset — Prerequisites, Setup, chat_completion and 3 more — is a fair guide to whether it matches your workflow. It is maintained by heltonteixeira; worth a glance at recent repository activity before you build anything load-bearing on it.
We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.
| Tool | What it does |
|---|---|
| Prerequisites | 1. Get your OpenRouter API key from [OpenRouter Keys](https://openrouter.ai/keys) 2. Choose a default model (optional) |
| Setup | Add to your MCP settings configuration file (cline_mcp_settings.json or claude_desktop_config.json): |
| chat_completion | This example requests a completion from anthropic/claude-3-haiku, limits the response to 500 tokens. It specifies provider routing options: prefer fp16 quantized models, ignore openai providers, sort remaining providers |
| search_models | The search_models tool exposed by this server. |
| get_model_info | The get_model_info tool exposed by this server. |
| validate_model | // Response: // Success: { isError: false, valid: true } // Error: { isError: true, error: "Model not found" } |
{
"mcpServers": {
"openrouterai": {
"command": "npx",
"args": ["@mcpservers/openrouterai"],
"env": {
"OPENROUTER_API_KEY": "your-api-key-here",
"OPENROUTER_DEFAULT_MODEL": "optional-default-model",
"OPENROUTER_MAX_TOKENS": "1024",
"OPENROUTER_PROVIDER_QUANTIZATIONS": "fp16,int8",
"OPENROUTER_PROVIDER_IGNORE": "openai,anthropic"
}
}
}
}
## Response Format
All tools return responses in a standardized structure:Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| OPENROUTER_API_KEY | Credential the server authenticates with. | Yes |
| OPENROUTER_DEFAULT_MODEL | Configuration value read at startup. | Optional |
| OPENROUTER_MAX_TOKENS | Credential the server authenticates with. | Yes |
| OPENROUTER_PROVIDER_QUANTIZATIONS | Configuration value read at startup. | Optional |
| OPENROUTER_PROVIDER_IGNORE | Configuration value read at startup. | Optional |
Build a programmable telecommunications stack for connecting telephony services with the Internet via a cloud-based utility.
Search built for AI, not humans — semantic web search that returns model-ready content, plus code context.
Answers, not links — delegate questions to Perplexity's search-grounded models and get cited responses back.
Give your assistant a voice — text-to-speech, voice cloning and audio tools from the ElevenLabs API.
Give your assistant a real code sandbox — isolated cloud VMs for actually running the code it writes.
The ML hub in your context window — search models, datasets, papers and run Spaces from the official server.