OpenRouter MCP Server

OpenRouter MCP Server

Provides access to 400+ AI models from OpenRouter, enabling users to chat with models like GPT-4, Claude, Gemini, and Llama, compare responses across multiple models, and retrieve model information with pricing details.

Category
Visit Server

README

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

# 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

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"

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured