Allows deployment and management of the MCP server using Docker containers with utilities for building, starting, stopping, and accessing logs.
Uses .env file for configuration of API keys, model settings, and server parameters.
Supports cloning the repository as part of the installation process.
Provides repository access and issue tracking for the MCP server.
Enables use of Google Gemini 2.5 Pro Preview with automatic web search integration for accessing current information.
Uses Python 3.12+ for server implementation and management scripts.
OpenRouter MCP Server
Use 400+ AI models (Claude, GPT-4, Gemini, etc.) directly in Claude Code
Intelligent model selection • 1M+ token support • Multi-model collaboration
🚀 Complete Setup Guide
Follow these steps exactly to get up and running in 5 minutes:
Prerequisites
Docker installed and running (Get Docker)
Python 3.8+ installed (Get Python)
Claude Code desktop app (Get Claude Code)
OpenRouter API key (Get API Key)
Step 1: Clone Repository
Step 2: Get Your OpenRouter API Key
Go to OpenRouter.ai
Sign up or log in to your account
Navigate to "Keys" in your dashboard
Create a new API key
Copy the key (starts with
sk-or-v1-
)
Step 3: Configure Environment
Create your .env
file with your API key:
⚠️ IMPORTANT: Replace sk-or-v1-your_actual_api_key_here
with your actual OpenRouter API key!
Step 4: Build and Start
Step 5: Connect to Claude Code
Step 6: Verify Setup
Test that everything is working:
🎉 Success! You can now use any OpenRouter model in Claude Code.
✨ Key Features
🧠 Intelligent Model Selection
Context-Aware: Automatically chooses the best model based on your request
Smart Qwen Handling:
model: "qwen"
intelligently selects between qwen3-max (general) or qwen3-coder-plus (coding)No More Errors: Eliminates fuzzy matching failures with LLM-powered decisions
🔧 Advanced Capabilities
400+ AI Models: Access to all OpenRouter models including GPT-4, Claude, Gemini, DeepSeek, etc.
1M+ Token Support: Send massive files without errors (1,048,576 token limit)
Web Search Integration: Gemini automatically searches for current information
Conversation Memory: Continue conversations with full context preservation
Multi-Model Collaboration: Use
/call-openrouter
command for structured workflows
🛡️ Production Ready
Graceful Shutdown Protection: Survives Claude Code disconnects without breaking
Rate Limiting: Built-in protection against API limits
Error Handling: Comprehensive error recovery and logging
Docker Containerized: Isolated, reproducible environment
🎯 Quick Test
Try these commands in Claude Code to verify everything works:
Step 7: Install Claude Code Command (Optional)
For enhanced multi-model collaboration, copy the command script:
🔑 Get Your API Key
Go to OpenRouter.ai
Sign up and get an API key
Add it to your
.env
file:OPENROUTER_API_KEY=your_key_here
🎯 What You Get
400+ AI Models: DeepSeek R1, GPT-4, Gemini Pro Preview, Kimi K2, Grok 4, and hundreds more
Large File Support: Send multiple large files (1,048,576 token limit) without errors
Web Search Integration: Gemini automatically searches the internet for current information
Conversation Memory: Continue conversations across multiple requests with full context
Model Switching: Change models mid-conversation seamlessly
Multi-Model Collaboration: Use
/call-openrouter
command for structured model collaboration workflowsEasy Management: Interactive Docker manager for build/start/logs/shell
No Duplicates: Single persistent container (no more container proliferation)
💬 Usage Examples
Chat with different models:
Attach files for analysis:
Multi-Model Collaboration:
🤖 Available Models
Just use simple names:
gemini
→ Google Gemini 2.5 Pro Preview (with web search)deepseek
→ DeepSeek R1 (reasoning & analysis)deepseek-v3.1
→ DeepSeek Chat v3.1 (latest version with 163K context)kimi
→ Moonshot Kimi K2 (advanced reasoning)grok
→ X.AI Grok 4 (creative & analytical)gpt-5
→ OpenAI GPT-5 (latest flagship model with 400K context)Plus 400+ other models available by full name
🛠️ Management Commands
Check status:
View logs:
Restart container:
Interactive shell:
Manual Docker commands:
🆘 Troubleshooting Guide
Common Issues & Solutions
🔧 Setup Issues
"No such file or directory" when running scripts:
Docker not found or permission denied:
Python command not found:
🔌 Connection Issues
MCP server not connecting to Claude Code:
Container won't start:
🚫 API Issues
OpenRouter API errors (401 Unauthorized):
Rate limiting errors (429 Too Many Requests):
Large file errors (413 Request Too Large):
✅ This is fixed in the latest version with 1M+ token support
Update to latest:
git pull && python3 tools/docker_manager.py build && python3 tools/docker_manager.py restart
🐛 Model Selection Issues
"Model not found" errors:
🔍 Diagnostic Commands
Full system check:
Reset everything:
🆘 Still Need Help?
Check logs first:
python3 tools/docker_manager.py logs
Verify your .env file has a valid OpenRouter API key
Make sure Docker is running and accessible
Try the diagnostic commands above
Open an issue with:
Your operating system
Error messages from logs
Steps you've already tried
📄 License
Apache 2.0 License - see LICENSE
Made with ❤️ for Claude Code users
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that provides unified access to 400+ AI models from 30+ providers through OpenRouter's API, enabling seamless integration with Claude Code.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that enables Claude users to access specialized OpenAI agents (web search, file search, computer actions) and a multi-agent orchestrator through the MCP protocol.Last updated -49
- -securityFlicense-qualityA Model Context Protocol server that gives Claude access to multiple AI models (Gemini, OpenAI, OpenRouter) for enhanced code analysis, problem-solving, and collaborative development through AI orchestration with conversations that continue across tasks.Last updated -7,222
- AsecurityAlicenseAqualityA secure Model Context Protocol server that enables Claude Code to connect with OpenAI and Google Gemini models, allowing users to query multiple AI providers through a standardized interface.Last updated -32MIT License
- -securityFlicense-qualityAn enhanced Model Context Protocol server that enables Claude to seamlessly collaborate with multiple AI models (Gemini, OpenAI, local models) for code analysis and development tasks, maintaining context across conversations.Last updated -4533