OpenRouter MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenRouter MCP Server Compare gpt-4 and claude-3-opus on climate change solutions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
📄 NEW: Parallel document analysis with smart chunking and synthesis
🔧 Seamless integration with Claude Desktop and Claude Code
Related MCP server: OpenRouter MCP Server
Installation
# Clone the repository
git clone https://github.com/th3nolo/openrouter-mcp.git
cd openrouter-mcp
# Install dependencies
npm install
# or
yarn install
# Build the TypeScript code
npm run build
# or
yarn buildConfiguration
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
analyze_document- Analyze large documents using parallel processingParameters:
document,query,analysis_type(search/summarize/extract/qa),chunk_size,parallel_instancesDefault model:
google/gemma-3n-e4b-it(optimized for cost and performance)
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:
claude mcp add openrouter -s user \
-e OPENROUTER_API_KEY=your_api_key_here \
-- node /path/to/openrouter-mcp/dist/server.jsOr add it manually to your Claude Desktop configuration:
{
"mcpServers": {
"openrouter": {
"command": "node",
"args": ["/path/to/openrouter-mcp/dist/server.js"],
"env": {
"OPENROUTER_API_KEY": "your_api_key_here"
}
}
}
}Example Usage
Once configured, you can use these commands in Claude:
"List all available Gemma models"
"Chat with gpt-4 and ask it to explain quantum computing"
"Compare responses from claude-3-opus and gpt-4 about climate change"
"Get detailed information about google/gemini-pro"
"Analyze this document and extract all key dates and milestones"
"Search this research paper for information about methodology"
"Summarize this 100-page report focusing on recommendations"Document Analysis Examples
The new analyze_document tool supports:
Summarization: Create comprehensive summaries of large documents
Search: Find specific information across document sections
Extraction: Extract structured data like dates, names, or custom targets
Q&A: Answer multiple questions about document content
Example: Analyzing a 100K character document costs only ~$0.0005 using Gemma!
Development
# Run in development mode
npm run dev
# Run tests
npm test
# Lint code
npm run lint
# Type check
npm run typecheckEnvironment 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.
Available Tools
5 toolsanalyze_documentA
Analyze large documents using parallel processing with multiple model instances
Inputs: document (required), model, query, overlap, +5 more.
chat_with_modelB
Send a message to a specific OpenRouter model
Inputs: model (required), message (required), max_tokens, temperature, +1 more.
compare_modelsC
Compare responses from multiple models
Inputs: models (required), message (required), max_tokens.
get_model_infoC
Get detailed information about a specific model
Inputs: model (required).
list_modelsB
Get list of available OpenRouter models
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action: document analysis, chat, model comparison, model info retrieval, and listing. There is no overlap in purpose.
All tool names follow a consistent verb_noun pattern (e.g., analyze_document, chat_with_model), making the naming predictable and easy to understand.
Five tools is a concise yet comprehensive set for interacting with an AI model provider like OpenRouter. Each tool serves a clear role without unnecessary duplication.
The tools cover core operations (listing, info, chat, comparison, document analysis). A minor gap is the lack of streaming or parameter configuration options, but the set is functional for typical use cases.
Maintenance
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for building and testing AI agents with multi-model experimentation and insights.
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that retrieves and provides AI model information from OpenAI, Anthropic, and Google through a unified interface.322 npmMIT
- FlicenseAqualityDmaintenanceAn MCP server for discovering and querying over 300 AI models available on OpenRouter. It enables users to list, search, filter, compare, and get detailed information about models with pricing, context limits, and capabilities.51-
- AlicenseNot gradedqualityBmaintenanceMCP server that bridges ChatGPT Plus/Pro to Claude Code, enabling chat, deep research, and image generation via your own account.41 PyPI51MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that helps AI assistants automatically find, filter, and rank the best AI models for a specific task using the OpenRouter API.1MIT