MCP server providing access to 300+ AI models via OpenRouter
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
π 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 the published server into every detected MCP client:
Install into selected clients:
Run from a local checkout:
mcp-openrouter with no arguments starts the stdio server. The explicit command is uv run mcp-openrouter serve.
| Tool | Purpose |
|---|---|
chat | Send a prompt or message list to an OpenRouter chat model. |
generate_image | Generate one image and optionally save it to an absolute local path. |
embed | Generate embeddings for a string or list of strings. |
list_models | List models, optionally filtered by vision, image_gen, embedding, tools, or long_context. |
find_models | Search model names and slugs, returning up to 20 matches. |
Example MCP prompts:
OPENROUTER_API_KEY is required for all tool calls. For a local checkout, its .keyenv.toml maps the variable to macOS Keychain: use keyenv set OPENROUTER_API_KEY to replace it, keyenv doctor to verify it, and keyenv run -- ... to launch the server or live tests. Python still reads the value normally from os.environ.
Optional defaults make the model parameter optional for matching tools:
The current tools read DEFAULT_TEXT_MODEL, DEFAULT_IMAGE_MODEL, and DEFAULT_EMBEDDING_MODEL. DEFAULT_CODE_MODEL and DEFAULT_VISION_MODEL are available for client conventions. Non-secret defaults may remain in .env; the API key must not.
uvx mcp-openrouter.generate_image.output_path must be absolute, for example /Users/you/output.png.tests/test_tools.py requires a live OPENROUTER_API_KEY.server.json, CHANGELOG.md, and the package version in sync before release. The Makefile release helper is make release-x.y.z.Register a local checkout when you want an MCP host to run your working tree instead of the published PyPI package.
Claude Code:
Codex:
opencode:

No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/openrouter-2)<a href="https://allmcps.com/mcp/openrouter-2"><img src="https://allmcps.com/api/badge/openrouter-2?style=directory" alt="OpenRouter on AllMCPs" /></a>