← Back to directory
O

OpenRouter MCP Server

Community
MCP server for OpenRouter.ai integration
GitHub source repository ↗
★ 63 Stars Category · Dev Tools Popular Source revision 3678d309d893
49FMRS · D
Reliability
6/20
Security and permissions
10/20
Maintenance
8/20
Documentation
14/20
Setup experience
11/20

This server provides a clear unified response format and error handling, with flexible configuration, but depends on the OpenRouter service.

Read the FMRS scoring method →

The OpenRouter MCP server provides 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.

Tools

chat_completion
Sends a request to the OpenRouter Chat Completions API, supporting model selection, messages, temperature, max_tokens, and provider routing configuration.
search_models
Search and filter available models by query, provider, minimum context length, and capabilities.
get_model_info
Get detailed information about a specific model.
validate_model
Check if a model ID is valid.

Setup

  1. Install Node.js and pnpm. 2. Run pnpm install @mcpservers/openrouterai. 3. Obtain an OpenRouter API key. 4. Configure your MCP client (e.g., Claude Desktop or Cline) with the environment variable OPENROUTER_API_KEY. Optionally set OPENROUTER_DEFAULT_MODEL and others.
claude_desktop_config.json
{
  "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"
      }
    }
  }
}

Fit and risk

Best for

  • Developers
  • AI applications needing access to multiple AI models
  • MCP client users

Not for

  • Fully offline environments
  • Users needing a native OpenAI API-compatible endpoint (though this server provides a unified wrapper)

Required permissions

  • Requires OPENROUTER_API_KEY
  • Network access to OpenRouter API
  • Local Node.js process running

Risks and side effects

  • API key leakage risk
  • Dependency on OpenRouter service availability
  • Misconfiguration of models could cause request failures

Troubleshooting

  1. Ensure OPENROUTER_API_KEY is valid and not expired
  2. Check network connectivity and proxy settings
  3. Verify model IDs are correct using the validate_model tool
  4. Inspect error categories (Validation, API, Rate Limit, Internal) to take appropriate action

Use cases

Call multiple AI models on OpenRouter from MCP clients
Centralize model routing, provider selection, and parameter configuration
Build AI applications requiring flexible model selection and fallback mechanisms

Supported clients

Claude DesktopFull support
ClineFull support