tsilva avatar

OpenRouter

tsilva/mcp-openrouter

Wraps the entire OpenRouter catalog in a single MCP server so you can call any of 300+ models from Claude, Codex, or other MCP hosts. Exposes chat, image generation, embeddings, model listing, and model search as tools. Ships with a slick installer that auto-detects your MCP clients and writes the config for you, or you can pass your API key on the command line for CI scenarios. Includes optional default model environment variables so you can skip the model parameter for common tasks. Retry handling is built in. If you're already paying for OpenRouter credits and want one unified interface to GPT, Claude, Gemini, Mistral, and the long tail without juggling individual API integrations, this is the cleanest way to wire it up.

GitHub stars
1
tools
5
auth
Secret needed
transport
STDIO
env vars
6
last updated
Apr 29, 2026

Tools

5 tools

Public tool metadata for what this MCP can expose to an agent.

chatSend a prompt or message list to an OpenRouter chat model.

Send a prompt or message list to an OpenRouter chat model.

No parameter schema in public metadata yet.

generate_imageGenerate one image and optionally save it to an absolute local path.

Generate one image and optionally save it to an absolute local path.

No parameter schema in public metadata yet.

embedGenerate embeddings for a string or list of strings.

Generate embeddings for a string or list of strings.

No parameter schema in public metadata yet.

list_modelsList models, optionally filtered by vision, image_gen, embedding, tools, or long_context.

List models, optionally filtered by vision, image_gen, embedding, tools, or long_context.

No parameter schema in public metadata yet.

find_modelsSearch model names and slugs, returning up to 20 matches.

Search model names and slugs, returning up to 20 matches.

No parameter schema in public metadata yet.

Sponsors

Configuration

OPENROUTER_API_KEY*secret

OpenRouter API key used to authenticate tool requests.

DEFAULT_TEXT_MODEL

Default model slug for chat tool calls when no model is provided.

DEFAULT_IMAGE_MODEL

Default model slug for image generation tool calls.

DEFAULT_CODE_MODEL

Default model slug for code-oriented tasks.

DEFAULT_VISION_MODEL

Default model slug for vision-capable tool calls.

DEFAULT_EMBEDDING_MODEL

Default model slug for embedding tool calls when no model is provided.

Readme

mcp-openrouter
🚀 One MCP server for OpenRouter models 🚀

mcp-openrouter is a Python MCP server that lets Codex, Claude Code, opencode, and other MCP hosts call OpenRouter models from local stdio tools.

It exposes chat, image generation, embeddings, model listing, and model search through a small FastMCP server with retry handling, host-aware installation, and optional default model environment variables.

Install

Install the published server into every detected MCP client:

uvx mcp-openrouter install --yes

Install into selected clients:

uvx mcp-openrouter install --yes --clients codex,claude,opencode

Run from a local checkout:

git clone https://github.com/tsilva/mcp-openrouter.git
cd mcp-openrouter
uv sync --dev
uv run mcp-openrouter

mcp-openrouter with no arguments starts the stdio server. The explicit command is uv run mcp-openrouter serve.

Commands


View the full README on GitHub

Details

Repository
github.com/tsilva/mcp-openrouter
Package
mcp-openrouter
Transport
STDIO
Auth
Required
Registry
MCP registry, active