OpenRouter AI

v1.0.0Coding Agentsstable

MCP server for OpenRouter.ai integration

openrouteraimcpai-integration
Share:
62
Stars
0
Downloads
0
Weekly
0/5

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

Access OpenRouter.ai models
heltonteixeira

Maintainer

LicenseApache-2.0
Languagetypescript
Versionv1.0.0
UpdatedApr 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx openrouterai

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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)
1

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.

2

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/openrouterai
3

Configure 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.

4

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.

5

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.

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.

Quick Config Preview

{ "mcpServers": { "openrouterai": { "command": "npx", "args": ["-y", "openrouterai"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides