# OpenRouter [Health: Active]

**Category:** 🗣️ Conversational AI  
**Repository:** https://github.com/tsilva/mcp-openrouter  
**GitHub Stars:** 1  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/openrouter-2

## Description
MCP server providing access to 300+ AI models via OpenRouter

## Tools
Capabilities this server exposes over MCP:

- **chat** — Send a chat completion request to any OpenRouter model.
- **generate_image** — Generate an image using an OpenRouter image generation model.
- **embed** — Generate embeddings for text input using an OpenRouter embedding model.
- **list_models** — List available OpenRouter models, optionally filtered by capability.
- **find_models** — Search for models by name or slug.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "openrouter": {
    "command": "uvx",
    "args": ["mcp-openrouter"],
    "env": {
      "OPENROUTER_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `OPENROUTER_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/openrouter-2/readme_

