OpenRouter MCP Server
A Model Context Protocol (MCP) server that provides access to OpenRouter's extensive collection of 400+ AI models through Claude.
Features
🤖 Access to 400+ language models including GPT-4, Claude, Gemini, Llama, and more
🔍 List and search available models with pricing information
💬 Chat with any model through a unified interface
🔄 Compare responses from multiple models side-by-side
📊 Get detailed model information including context limits and capabilities
🔧 Seamless integration with Claude Desktop and Claude Code
Installation
Configuration
Get your OpenRouter API key from OpenRouter
Copy
.env.exampleto.env:cp .env.example .envEdit
.envand add your API key:OPENROUTER_API_KEY=your_api_key_here
Usage
Available MCP Tools
list_models- Get a list of all available models with pricingchat_with_model- Send a message to a specific modelParameters:
model,message,max_tokens,temperature,system_prompt
compare_models- Compare responses from multiple modelsParameters:
models[],message,max_tokens
get_model_info- Get detailed information about a specific modelParameters:
model
Available MCP Resources
openrouter://models- List of all available models with pricingopenrouter://pricing- Current pricing information for all modelsopenrouter://usage- Your OpenRouter usage statistics
Claude Code Integration
Add the server to Claude Code:
Or add it manually to your Claude Desktop configuration:
Example Usage
Once configured, you can use these commands in Claude:
Development
Environment Variables
OPENROUTER_API_KEY- Your OpenRouter API key (required)OPENROUTER_BASE_URL- API base URL (default: https://openrouter.ai/api/v1)OPENROUTER_SITE_URL- Your site URL for API attributionOPENROUTER_APP_NAME- Application name for API headers
Security
API keys are stored in environment variables only
The
.envfile is excluded from version controlNever commit your API keys to the repository
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.