OpenRouter

v1.1.8
io.github.tsilva/mcp-openrouter Checked 4 days ago Published 7 months ago

MCP server providing access to 300+ AI models via OpenRouter

Values you need

VariableWhat it is
OPENROUTER_API_KEYrequired secret OpenRouter API key used to authenticate tool requests.
DEFAULT_TEXT_MODELoptional Default model slug for chat tool calls when no model is provided.
DEFAULT_IMAGE_MODELoptional Default model slug for image generation tool calls.
DEFAULT_CODE_MODELoptional Default model slug for code-oriented tasks.
DEFAULT_VISION_MODELoptional Default model slug for vision-capable tool calls.
DEFAULT_EMBEDDING_MODELoptional Default model slug for embedding tool calls when no model is provided.

PyPI (uvx) discovery passed

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add mcp-openrouter -e 'OPENROUTER_API_KEY=<OPENROUTER_API_KEY>' -- uvx mcp-openrouter==1.1.8
Add to claude_desktop_config.json
{
  "mcpServers": {
    "mcp-openrouter": {
      "args": [
        "mcp-openrouter==1.1.8"
      ],
      "command": "uvx",
      "env": {
        "OPENROUTER_API_KEY": "<OPENROUTER_API_KEY>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "mcp-openrouter": {
      "args": [
        "mcp-openrouter==1.1.8"
      ],
      "command": "uvx",
      "env": {
        "OPENROUTER_API_KEY": "<OPENROUTER_API_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "OPENROUTER_API_KEY",
      "id": "openrouter-api-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "mcp-openrouter": {
      "args": [
        "mcp-openrouter==1.1.8"
      ],
      "command": "uvx",
      "env": {
        "OPENROUTER_API_KEY": "${input:openrouter-api-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.mcp-openrouter]
command = "uvx"
args = ["mcp-openrouter==1.1.8"]
env = { "OPENROUTER_API_KEY" = "<OPENROUTER_API_KEY>" }

For AI agents

  1. Ask the user for: OPENROUTER_API_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: chat, generate_image, embed, list_models, find_models.
  5. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json