Skip to main content
Glama
minovap
by minovap
README.md
# openrouter-mcp

MCP server for consulting AI models via OpenRouter. Designed for AI assistants like Claude Code to ask other models for help.

## Installation

```bash
npm install -g openrouter-mcp
```

## Configuration

### Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `OPENROUTER_API_KEY` | Yes | Your OpenRouter API key |
| `OPENROUTER_ALLOWED_MODELS` | Yes | Comma-separated list of allowed model IDs |
| `OPENROUTER_SYSTEM_PROMPT` | No | Default system prompt for all requests |

### Example MCP Config

```json
{
  "mcpServers": {
    "openrouter": {
      "command": "npx",
      "args": ["-y", "openrouter-mcp"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-...",
        "OPENROUTER_ALLOWED_MODELS": "anthropic/claude-3.5-sonnet,openai/gpt-4o,google/gemini-2.0-flash-001",
        "OPENROUTER_SYSTEM_PROMPT": "You are helping an AI coding assistant. Be direct and provide code examples when relevant."
      }
    }
  }
}
```

## Tool: `ask_model`

Consult another AI model for help with coding tasks.

### Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `model` | string | Yes | Model ID from the allowed list |
| `message` | string | Yes | Your question or request |
| `system_prompt` | string | No | Override the default system prompt |
| `append_files` | string[] | No | File paths to read and include as context |

### Limits

- Max 10 files per request
- Max 150KB per file
- Text files only (no binary)
- 2 minute timeout per request

## License

MIT

TDQS

A3.9/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no risk of confusion between tools. The single tool is clearly distinct by default.

Naming Consistency5/5

The tool name 'ask_model' follows a clear verb_noun convention, which is appropriate and consistent though there is only one tool.

Tool Count3/5

A single tool feels thin for a server named 'openrouter-mcp', which implies broader model access capabilities. However, it may be scoped to just querying models, making it borderline acceptable.

Completeness3/5

The tool covers the core action of asking a model, but lacks supporting tools like listing available models or retrieving model metadata, which are notable gaps for a server focused on model access.

Maintenance

ActivityInactive
ResponsivenessNo issues