OpenRouter logo

OpenRouter

Connects MCP hosts to OpenRouter for chat, image generation, embeddings, and model discovery.

Install OpenRouter

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "openrouter-2": {
      "command": "uvx",
      "args": [
        "mcp-openrouter"
      ],
      "env": {
        "OPENROUTER_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 5 tools correctly (6d ago).

Overview

The OpenRouter MCP server gives MCP hosts local stdio tools for calling OpenRouter models, generating images, creating embeddings, and discovering available models. It runs as a Python FastMCP process and requires an OpenRouter API key for tool calls. Use it when an agent needs access to multiple OpenRouter model types through one MCP configuration. The package includes an installer for supported hosts and optional environment variables for default models.

Use cases

  • Send agent prompts to selected OpenRouter chat models
  • Generate and save images from an MCP workflow
  • Create embeddings for one or more strings
  • Filter models by supported capabilities
  • Search OpenRouter model identifiers

Key features

  • Chat requests through OpenRouter models
  • Image generation with optional local output
  • Embeddings for strings or string lists
  • Capability-filtered model listing
  • Model name and slug search
  • Optional default model configuration

Tools5

What OpenRouter lets your agent do. Expand a tool for its parameters.

Verified live~1.4k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

7/7 checks healthy over the last 45d

What it can do

From the 5 tools this server returned when we ran it.

Makes network requests · 1Read-only tools · 5
Network at startup2 connections
Files written at startup30

Observed 2026-10-17 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · mcp-openrouter (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed5Callable tools this server registers over MCP.
Directory activity8 viewsConfig copies, upvotes, and views on AllMCPs.

How OpenRouter works

What the OpenRouter MCP server does

The OpenRouter MCP server exposes a local MCP interface to OpenRouter’s model API. Agents can send chat prompts, request image generation, create embeddings, inspect the available model catalog, and search model names or slugs. This makes the server suitable for workflows that need to select models at runtime or use different model capabilities from one MCP connection.

The server is implemented in Python with FastMCP. It communicates with MCP hosts over standard input and output, while requests are sent to OpenRouter. Retry handling is included in the server runtime. The published package can be launched with uvx, or a local checkout can be run with uv.

How it works

An MCP host starts the server as a local process. The host then discovers the five exposed tools and can call them with model-specific arguments. chat accepts either a prompt or a message list. generate_image creates one image and can write it to a local file. When an output path is supplied, it must be absolute.

embed accepts one string or a list of strings. list_models can filter results by capabilities such as vision, image generation, embeddings, tool use, or long context. find_models searches model names and slugs and returns up to 20 matches.

Setup and configuration

Python 3.10 or newer is required. The simplest published-package setup is:

bash
uvx mcp-openrouter install --yes

The installer can target selected supported clients, including Codex, Claude Code, and opencode. Running uvx mcp-openrouter without arguments starts the stdio server; uv run mcp-openrouter serve is the explicit equivalent for a local environment.

Set OPENROUTER_API_KEY before using any tool. For a checkout using the included keyenv configuration, keyenv set OPENROUTER_API_KEY stores the value and keyenv doctor checks it. The key remains available to Python through the normal process environment.

Optional variables can provide defaults for text, image, embedding, code, or vision model conventions. The current tool implementations use DEFAULT_TEXT_MODEL, DEFAULT_IMAGE_MODEL, and DEFAULT_EMBEDDING_MODEL. The API key should not be placed in a committed .env file.

Tools and capabilities

The OpenRouter MCP server provides:

  • chat for conversational model requests.
  • generate_image for one image-generation request and optional local saving.
  • embed for vector representations of one or more strings.
  • list_models for capability-based model discovery.
  • find_models for searching model identifiers.

Model selection is passed to the relevant tool unless a supported default environment variable supplies it. This allows an agent to use a fixed model for a workflow while retaining model discovery for cases that need a different capability.

Limitations and notes

The server requires a live OpenRouter API key for real tool calls. The test suite mocks network requests, although the tool tests require a live key. After changing local server code, restart the MCP host so it launches a new process. The image output parameter accepts absolute paths only. The project is licensed under MIT.

The OpenRouter MCP server’s documented installer targets are Codex, Claude Code, and opencode. Other MCP hosts may require manual stdio registration using their own configuration format.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about OpenRouter

OpenRouter is an MCP server that connects MCP hosts to OpenRouter’s model API. Its main tools send chat requests, generate images, create embeddings, list models by capability, and search model names or slugs. It runs locally over stdio and requires an OPENROUTER_API_KEY for tool calls.

Run `uvx mcp-openrouter install --yes` to install it into detected MCP clients. You can target specific supported clients with `--clients codex,claude,opencode`, or run a local checkout with `uv run mcp-openrouter`.

Set `OPENROUTER_API_KEY` before making tool calls. Optional `DEFAULT_TEXT_MODEL`, `DEFAULT_IMAGE_MODEL`, and `DEFAULT_EMBEDDING_MODEL` variables can supply model defaults for supported tools.

Yes, `generate_image` creates one image and can save it to a local path. The `output_path` value must be an absolute path, such as `/Users/you/output.png`.

The documented installer supports Codex, Claude Code, and opencode. The server uses local stdio, so other MCP hosts may be configured manually if they support standard MCP process connections.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewOpenRouter AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/openrouter-2?style=directory)](https://allmcps.com/mcp/openrouter-2)
HTML Embed
<a href="https://allmcps.com/mcp/openrouter-2"><img src="https://allmcps.com/api/badge/openrouter-2?style=directory" alt="OpenRouter on AllMCPs" /></a>