OpenRouter AI
MCP server for OpenRouter.ai integration
What is OpenRouter AI?
OpenRouter AI is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for openrouter.ai integration
MCP server for OpenRouter.ai integration
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP server for OpenRouter.ai integration
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx openrouteraiConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use OpenRouter AI
The OpenRouter MCP server gives any MCP-compatible AI client a unified gateway to hundreds of AI models available on OpenRouter.ai, including models from OpenAI, Anthropic, Google, Mistral, and many others. It provides tools for sending chat completion requests, searching the model catalog, and retrieving detailed model information, all with built-in caching, rate-limit management, and exponential backoff. Developers use it to compare models, route requests to the cheapest or fastest provider, and access models not directly available through a single vendor.
Prerequisites
- Node.js 18+ and npm/npx installed
- An OpenRouter API key from https://openrouter.ai/keys
- An MCP-compatible client such as Claude Desktop or Cline
- Basic familiarity with OpenRouter model identifiers (e.g. openai/gpt-4o)
Obtain an OpenRouter API key
Sign up at openrouter.ai and navigate to the Keys section to create a new API key. This key is required for all requests through the MCP server.
Install the package
Install the OpenRouter MCP server package globally or use it via npx. The npm package name is @mcpservers/openrouterai.
npm install -g @mcpservers/openrouteraiConfigure your MCP client
Add the server to your MCP client configuration file. Set OPENROUTER_API_KEY at minimum; optionally set a default model and provider routing preferences.
Choose a default model (optional)
Set OPENROUTER_DEFAULT_MODEL to avoid specifying a model on every request. Use openrouter/auto to let OpenRouter pick the best available model automatically. You can also set OPENROUTER_MAX_TOKENS to cap response length by default.
Start your MCP client and verify tools
Launch your MCP client. GoDoctor exposes three tools: chat_completion for sending messages, search_models for filtering the model catalog, and get_model_info for fetching details on a specific model.
OpenRouter AI Examples
Client configuration
Add this block to claude_desktop_config.json or cline_mcp_settings.json. Replace the API key and adjust optional env vars to suit your preferences.
{
"mcpServers": {
"openrouterai": {
"command": "npx",
"args": ["-y", "@mcpservers/openrouterai"],
"env": {
"OPENROUTER_API_KEY": "your-api-key-here",
"OPENROUTER_DEFAULT_MODEL": "openrouter/auto",
"OPENROUTER_MAX_TOKENS": "2048",
"OPENROUTER_PROVIDER_SORT": "price"
}
}
}
}Prompts to try
Example prompts that use the chat_completion, search_models, and get_model_info tools:
- "Use openrouterai to send 'Explain transformer architecture' to google/gemini-pro"
- "Search for vision-capable models with a context length over 100,000 tokens"
- "Get the pricing and context window details for anthropic/claude-3-haiku"
- "Compare responses from mistralai/mistral-7b-instruct and openai/gpt-4o-mini for this prompt: 'What is RAG?'"
- "Send my prompt to the cheapest available model that supports function calling"Troubleshooting OpenRouter AI
Error: Model validation failed — model not found
Use the search_models tool to list available models and verify the exact identifier (e.g. openai/gpt-4o, not gpt-4o). Model IDs on OpenRouter include the provider prefix.
Rate limit errors or 429 responses
The server implements exponential backoff automatically, but your OpenRouter account may have credit or rate limits. Check your account balance at openrouter.ai and consider setting OPENROUTER_PROVIDER_ALLOW_FALLBACKS=true to use alternative providers when one is rate-limited.
OPENROUTER_API_KEY not picked up by the server
Ensure the env block is inside the server entry in the JSON config, not at the top level. Restart the MCP client after saving the config file.
Frequently Asked Questions about OpenRouter AI
What is OpenRouter AI?
OpenRouter AI is a Model Context Protocol (MCP) server that mcp server for openrouter.ai integration It connects AI assistants to external tools and data sources through a standardized interface.
How do I install OpenRouter AI?
Follow the installation instructions on the OpenRouter AI GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with OpenRouter AI?
OpenRouter AI works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is OpenRouter AI free to use?
Yes, OpenRouter AI is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
OpenRouter AI Alternatives — Similar Coding Agents Servers
Looking for alternatives to OpenRouter AI? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up OpenRouter AI in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use OpenRouter AI?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.