Openrouterai MCP Server

MCP server for OpenRouter.ai integration

Local serverstdioTypeScript

What is the Openrouterai MCP server?

MCP server for OpenRouter.ai integration. Exposed over MCP by the openrouterai mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

A Model Context Protocol (MCP) server providing seamless integration with OpenRouter.ai's diverse model ecosystem. Access various AI models through a unified, type-safe interface with built-in caching, rate limiting, and error handling.

  • Model Access —
  • Direct access to all OpenRouter.ai models
  • Automatic model validation and capability checking
  • Default model configuration support
  • Performance Optimization —
  • Smart model information caching (1-hour expiry)

Adding it to your client

The server ships on npm as @mcpservers/openrouterai, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Its toolset

Everything the assistant can do here goes through one of these:

  • Prerequisites — 1. Get your OpenRouter API key from OpenRouter Keys 2. Choose a default model (optional)
  • Setup — Add to your MCP settings configuration file (cline_mcp_settings.json or claude_desktop_config.json):
  • chat_completion — This example requests a completion from anthropic/claude-3-haiku, limits the response to 500 tokens. It specifies provider routing options: prefer
  • search_models — The search_models tool exposed by this server
  • get_model_info — The get_model_info tool exposed by this server
  • validate_model — // Response: // Success: { isError: false, valid: true } // Error: { isError: true, error: "Model not found" }

Configuration

You will need 5 environment variables: OPENROUTER_API_KEY, OPENROUTER_DEFAULT_MODEL, OPENROUTER_MAX_TOKENS, OPENROUTER_PROVIDER_QUANTIZATIONS, OPENROUTER_PROVIDER_IGNORE. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  1. Get your OpenRouter API key from OpenRouter Keys 2. Choose a default model (optional)

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the openrouterai mcp server does with a few real requests.

When to reach for it

This sits in the AI and media services group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Openrouterai's toolset — Prerequisites, Setup, chat_completion and 3 more — is a fair guide to whether it matches your workflow. It is maintained by heltonteixeira; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
Prerequisites1. Get your OpenRouter API key from [OpenRouter Keys](https://openrouter.ai/keys) 2. Choose a default model (optional)
SetupAdd to your MCP settings configuration file (cline_mcp_settings.json or claude_desktop_config.json):
chat_completionThis example requests a completion from anthropic/claude-3-haiku, limits the response to 500 tokens. It specifies provider routing options: prefer fp16 quantized models, ignore openai providers, sort remaining providers
search_modelsThe search_models tool exposed by this server.
get_model_infoThe get_model_info tool exposed by this server.
validate_model// Response: // Success: { isError: false, valid: true } // Error: { isError: true, error: "Model not found" }

How to install the Openrouterai MCP server

{
  "mcpServers": {
    "openrouterai": {
      "command": "npx",
      "args": ["@mcpservers/openrouterai"],
      "env": {
        "OPENROUTER_API_KEY": "your-api-key-here",
        "OPENROUTER_DEFAULT_MODEL": "optional-default-model",
        "OPENROUTER_MAX_TOKENS": "1024",
        "OPENROUTER_PROVIDER_QUANTIZATIONS": "fp16,int8",
        "OPENROUTER_PROVIDER_IGNORE": "openai,anthropic"
      }
    }
  }
}

## Response Format

All tools return responses in a standardized structure:

Configuration as documented by the project. Restart the client after saving.

Configuration

  1. Get your OpenRouter API key from OpenRouter Keys 2. Choose a default model (optional)
VariableDescriptionRequired
OPENROUTER_API_KEYCredential the server authenticates with.Yes
OPENROUTER_DEFAULT_MODELConfiguration value read at startup.Optional
OPENROUTER_MAX_TOKENSCredential the server authenticates with.Yes
OPENROUTER_PROVIDER_QUANTIZATIONSConfiguration value read at startup.Optional
OPENROUTER_PROVIDER_IGNOREConfiguration value read at startup.Optional

Example prompts to try

  • Use Openrouterai to Prerequisites.
  • Use Openrouterai to Setup.
  • Use Openrouterai to chat completion.

Frequently asked questions

It connects Openrouterai to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (Prerequisites, Setup, chat_completion, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Openrouterai directly.