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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

chat

Send a chat completion request to any OpenRouter model.

ParameterTypeDescription
assistant_prefillText to prefill the assistant response with
frequency_penaltyPenalize repeated tokens (-2 to 2)
json_modebooleanIf True, request JSON-formatted response (backward compat)
max_tokensMaximum tokens in response (model default if not specified)
messagesMulti-turn conversation as a list of {role, content} dicts (provide either prompt or messages, not both)
modelModel identifier (e.g., "anthropic/claude-sonnet-4", "openai/gpt-4o"). If not specified, uses DEFAULT_TEXT_MODEL environment variable.
presence_penaltyPenalize tokens already present (-2 to 2)
promptUser message to send (provide either prompt or messages, not both)
providerProvider routing control (e.g., {"order": ["Anthropic", "Google"]})
reasoning_effortReasoning effort level: "minimal", "medium", or "high"
response_formatResponse format spec, e.g. {"type": "json_schema", ...}. Supersedes json_mode if both provided.
seedRandom seed for deterministic outputs
stopList of stop sequences
systemOptional system prompt to set context
temperatureSampling temperature 0-2 (model default if not specified)
top_kTop-k sampling (number of top tokens to consider)
top_pNucleus sampling threshold 0-1

generate_image

Generate an image using an OpenRouter image generation model.

ParameterTypeDescription
prompt *stringImage description - be specific about style, colors, composition
aspect_ratiostringAspect ratio - 1:1, 16:9, 9:16, 4:3, 3:4, or 21:9
backgroundBackground setting (e.g., "transparent" for PNG/WebP)
modelImage model (e.g., "google/gemini-3-pro-image-preview"). If not specified, uses DEFAULT_IMAGE_MODEL environment variable.
output_formatOutput format (e.g., "png", "webp", "jpeg")
output_pathOptional absolute file path to save the image. Must be an absolute path if provided (e.g., "/Users/name/output.png").
qualityQuality setting (e.g., "high", "medium", "low")
sizestringImage size - 1K, 2K, or 4K

embed

Generate embeddings for text input using an OpenRouter embedding model.

ParameterTypeDescription
input *Text string or list of strings to embed
dimensionsCustom embedding dimensions (model-dependent)
encoding_formatOutput format: "float" or "base64" (default: float)
modelEmbedding model (e.g., "mistralai/mistral-embed-2312"). If not specified, uses DEFAULT_EMBEDDING_MODEL environment variable.

list_models

List available OpenRouter models, optionally filtered by capability.

ParameterTypeDescription
capabilityFilter by capability: - "vision": Models that can analyze images - "image_gen": Models that can generate images - "embedding": Models that can generate embeddings - "tools": Models that support tool/f…

find_models

Search for models by name or slug.

ParameterTypeDescription
search_term *stringText to search for in model names (e.g., "claude", "gpt", "gemini")