OpenRouter MCP Server
Click on "Install 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 ServerCompare 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
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use for analysis | google/gemma-3n-e4b-it |
| query | No | Optional query to focus the analysis | |
| overlap | No | Overlap between chunks in characters | |
| document | Yes | Document content to analyze | |
| chunk_size | No | Size of each chunk in characters | |
| max_tokens | No | Maximum tokens per chunk analysis | |
| temperature | No | Temperature for response generation | |
| analysis_type | No | Type of analysis to perform | summarize |
| parallel_instances | No | Number of parallel instances (max 5) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description is the sole source of behavioral info. It mentions parallel processing and multiple instances, which is useful but does not cover potential side effects like cost, latency, or result aggregation. It adds value beyond the schema but remains incomplete.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that conveys the core functionality without extraneous words. Every element serves a purpose, achieving maximum conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 9 parameters and no output schema, the description provides only a high-level overview. It lacks detail on output format, error handling, or prerequisites, leaving gaps that could hinder correct invocation in complex scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with parameter descriptions, setting a baseline of 3. The tool description adds cohesive context by explaining the parallel chunking approach, which gives meaning to parameters like chunk_size, overlap, and parallel_instances, elevating understanding beyond individual schema entries.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (analyze), the resource (large documents), and the method (parallel processing with multiple model instances). This precisely identifies the tool's function and distinguishes it from sibling tools like chat_with_model, compare_models, etc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not indicate when to use this tool versus alternatives or when not to use it. It lacks any usage context or prerequisites, leaving the agent to infer applicability without guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
chat_with_modelB
Send a message to a specific OpenRouter model
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | OpenRouter model ID (e.g., 'openai/gpt-4') | |
| message | Yes | Message to send to the model | |
| max_tokens | No | Maximum tokens in response | |
| temperature | No | Temperature for response randomness | |
| system_prompt | No | System prompt for the conversation |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility for disclosing behavior. It only states that the tool sends a message, without explaining whether the operation is idempotent, what side effects exist, rate limits, or the nature of the response. For a tool with no annotations, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no wasted words. However, it is overly brief and could benefit from a brief note on usage or behavior. Still, it achieves clarity without verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there is no output schema, the description should explain what the tool returns (e.g., the model's response). It also fails to address the complexity of 5 parameters, such as how system_prompt interacts with message. The description is incomplete for a tool of this nature.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, meaning each parameter is already described in the schema. The description does not add extra meaning beyond the schema. Baseline score of 3 is appropriate because the schema handles documentation, but the description contributes no additional parameter context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Send a message to a specific OpenRouter model' uses a specific verb (send) and identifies the resource (message to model). It clearly distinguishes from sibling tools like analyze_document, compare_models, get_model_info, and list_models.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites, when to choose chat_with_model over other tools, or any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
compare_modelsC
Compare responses from multiple models
| Name | Required | Description | Default |
|---|---|---|---|
| models | Yes | Array of model IDs to compare | |
| message | Yes | Message to send to all models | |
| max_tokens | No | Maximum tokens per response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description only says 'compare responses' without disclosing behavioral traits such as whether it is read-only, how errors are handled, or the format of the output (e.g., does it return all responses or a summary?). This is a critical gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short sentence, which is concise but lacks necessary detail. It is not verbose, but the under-specification reduces informativeness, balancing to a mediocre score.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that compares models, agents need return format, ordering, and error handling information. The description provides none of this, and with no output schema or annotations, the completeness is poor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema coverage is 100% with descriptions for all three parameters (models, message, max_tokens). The tool description adds no additional meaning beyond what the schema already provides, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it compares responses from multiple models, distinguishing it from sibling tools like chat_with_model (single model) and list_models (model listing). However, it lacks specificity about the comparison mechanism (e.g., side-by-side display).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like chat_with_model. Does not mention scenarios where comparing responses is beneficial or when a different tool would be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_model_infoC
Get detailed information about a specific model
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model ID to get information about |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. Description does not disclose any behavioral traits, side effects, or what 'detailed information' entails.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded, but lacks detail. Could be more informative without being verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 1 parameter, no output schema, and no annotations, description is too sparse. Does not specify what information is returned.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters with descriptions. Description adds no extra meaning beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it gets info about a specific model. Sibling tools like list_models or compare_models have different purposes, so purpose is clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. No context about prerequisites or use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_modelsB
Get list of available OpenRouter models
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It fails to disclose essential behaviors like whether authentication is required, if the list is paginated, what fields are returned, or any rate limits. The minimal description leaves agents with unclear expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words, but it sacrifices important information. Conciseness is acceptable, but the lack of structure (e.g., no separation of core behavior from usage notes) reduces usefulness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no parameters, no annotations, and no output schema, the description should provide context about the returned data (e.g., model IDs, names) and prerequisites. It fails to do so, resulting in an incomplete tool definition for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the baseline is 4. The description adds minimal meaning ('Get list of available OpenRouter models') beyond the empty schema, confirming the purpose of the tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get list') and the resource ('available OpenRouter models'), which distinguishes it from siblings like 'get_model_info' (detailed info on a specific model) and 'compare_models' (comparison).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for retrieving the model list but offers no guidance on when to use it versus alternatives (e.g., 'get_model_info' for details, 'compare_models' for comparison). No explicit context provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v1.0.0- First observed
analyze_document - First observed
chat_with_model - First observed
compare_models - First observed
get_model_info - First observed
list_models
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
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.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that retrieves and provides AI model information from OpenAI, Anthropic, and Google through a unified interface.322MIT
- FlicenseAqualityCmaintenanceAn 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 gradedqualityAmaintenanceMCP server that bridges ChatGPT Plus/Pro to Claude Code, enabling chat, deep research, and image generation via your own account.47MIT
- 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
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/praxeo/openrouter-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server