Skip to main content
Glama
praxeo

OpenRouter MCP Server

by praxeo

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 build

Configuration

  1. Get your OpenRouter API key from OpenRouter

  2. Copy .env.example to .env:

    cp .env.example .env
  3. Edit .env and 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 pricing

  • chat_with_model - Send a message to a specific model

    • Parameters: model, message, max_tokens, temperature, system_prompt

  • compare_models - Compare responses from multiple models

    • Parameters: models[], message, max_tokens

  • get_model_info - Get detailed information about a specific model

    • Parameters: model

  • analyze_document - Analyze large documents using parallel processing

    • Parameters: document, query, analysis_type (search/summarize/extract/qa), chunk_size, parallel_instances

    • Default model: google/gemma-3n-e4b-it (optimized for cost and performance)

Available MCP Resources

  • openrouter://models - List of all available models with pricing

  • openrouter://pricing - Current pricing information for all models

  • openrouter://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.js

Or 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 typecheck

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 attribution

  • OPENROUTER_APP_NAME - Application name for API headers

Security

  • API keys are stored in environment variables only

  • The .env file is excluded from version control

  • Never commit your API keys to the repository

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Available Tools

5 tools
analyze_documentA

Analyze large documents using parallel processing with multiple model instances

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoModel to use for analysisgoogle/gemma-3n-e4b-it
queryNoOptional query to focus the analysis
overlapNoOverlap between chunks in characters
documentYesDocument content to analyze
chunk_sizeNoSize of each chunk in characters
max_tokensNoMaximum tokens per chunk analysis
temperatureNoTemperature for response generation
analysis_typeNoType of analysis to performsummarize
parallel_instancesNoNumber of parallel instances (max 5)

TDQS

A3.7/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesOpenRouter model ID (e.g., 'openai/gpt-4')
messageYesMessage to send to the model
max_tokensNoMaximum tokens in response
temperatureNoTemperature for response randomness
system_promptNoSystem prompt for the conversation

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
modelsYesArray of model IDs to compare
messageYesMessage to send to all models
max_tokensNoMaximum tokens per response

TDQS

C2.6/5.0
Behavior1/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesModel ID to get information about

TDQS

C2.8/5.0
Behavior2/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

  1. 5 tool updatesv1.0.0
    • First observedanalyze_document
    • First observedchat_with_model
    • First observedcompare_models
    • First observedget_model_info
    • First observedlist_models

TDQS

A3.5/5.0
Disambiguation5/5

Each tool targets a distinct action: document analysis, chat, model comparison, model info retrieval, and listing. There is no overlap in purpose.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (e.g., analyze_document, chat_with_model), making the naming predictable and easy to understand.

Tool Count5/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

Latest Blog Posts

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