OpenRouter MCP Server
MCP-сервер OpenRouter
MCP-сервер (Model Context Protocol) для поиска и запроса информации о более чем 300 ИИ-моделях, доступных на OpenRouter.
Возможности
Список моделей — Просмотр всех доступных моделей с указанием цен, лимитов контекста и возможностей
Поиск и фильтрация — Поиск моделей по провайдеру, цене, длине контекста, функциям (инструменты, зрение и т. д.)
Сравнение моделей — Сравнение нескольких моделей бок о бок
Получение подробной информации — Полные метаданные для любой конкретной модели
Кэширование ответов — 5-минутный кэш для сокращения количества вызовов API
Related MCP server: NanoBanana MCP Server
Установка
pip install openrouter-mcpИспользование
С OpenClaw
Добавьте в конфигурацию MCP-серверов openclaw.json:
{
"mcp": {
"servers": {
"openrouter-models": {
"command": "openrouter-mcp",
"env": {
"OPENROUTER_API_KEY": "your-api-key"
}
}
}
}
}Затем перезапустите шлюз. Теперь агенты могут использовать инструменты MCP для запроса моделей OpenRouter.
Примечание:
OPENROUTER_API_KEYявляется необязательным, но рекомендуется для повышения лимитов запросов (200 запросов/мин против 20 запросов/мин). Получите свой ключ здесь: https://openrouter.ai/keys
Пример использования агентом:
# Agent can now call MCP tools like:
list_models(sort_by="context_length")
search_models(query="claude", max_input_price=5.0)
get_model(model_id="anthropic/claude-sonnet-4.6")
compare_models(model_ids="qwen/qwen3.6-plus,anthropic/claude-sonnet-4.6")Автономно (stdio)
export OPENROUTER_API_KEY=your-key
python -m openrouter_mcp.serverДоступные инструменты
Инструмент | Описание |
| Список всех моделей с опциональной фильтрацией по модальности и сортировкой |
| Получение подробной информации о конкретной модели по ID |
| Поиск и фильтрация моделей по запросу, провайдеру, цене, контексту, функциям |
| Сравнение нескольких моделей бок о бок |
| Принудительное обновление кэша моделей из API OpenRouter |
Примеры
Список моделей, отсортированный по длине контекста
{
"name": "list_models",
"arguments": {
"modality": "text",
"sort_by": "context_length"
}
}Поиск моделей Claude дешевле $5 за 1 млн токенов
{
"name": "search_models",
"arguments": {
"query": "claude",
"provider": "anthropic",
"max_input_price": 5.0,
"requires_tools": true
}
}Сравнение 3 моделей
{
"name": "compare_models",
"arguments": {
"model_ids": "anthropic/claude-sonnet-4.6,qwen/qwen3.6-plus,openai/gpt-5.4"
}
}Получение подробной информации о модели
{
"name": "get_model",
"arguments": {
"model_id": "anthropic/claude-sonnet-4.6"
}
}Справочник API
list_models(modality, sort_by)
modality(str, по умолчанию: "text"): Фильтр по типу вывода. Варианты:text,image,audio,embeddings,allsort_by(str, по умолчанию: "name"): Сортировка по:name,created,price,context_length
get_model(model_id)
model_id(str, обязательно): Слаг модели, напримерanthropic/claude-sonnet-4.6
search_models(query, provider, max_input_price, min_context, requires_tools, requires_vision, free_only)
query(str): Поиск по тексту в имени/ID/описании моделиprovider(str): Фильтр по провайдеру (например,anthropic,google,openai)max_input_price(float): Максимальная цена за входные данные на 1 млн токенов (0 = без ограничений)min_context(int): Минимальный размер контекстного окнаrequires_tools(bool): Только модели, поддерживающие вызов инструментовrequires_vision(bool): Только модели с поддержкой зрения/ввода изображенийfree_only(bool): Только бесплатные модели
compare_models(model_ids)
model_ids(str, обязательно): Список ID моделей, разделенных запятыми
refresh_cache()
Принудительное обновление кэша моделей из API OpenRouter.
Лимиты запросов
Без API-ключа: 20 запросов/минуту
С API-ключом: 200 запросов/минуту
Данные о моделях кэшируются на 5 минут
Получите свой API-ключ здесь: https://openrouter.ai/keys
Лицензия
MIT
Участие в разработке
Вклад приветствуется! Пожалуйста, откройте issue или PR на GitHub.
Available Tools
5 toolscompare_modelsB
Compare multiple models side by side.
Args: model_ids: Comma-separated model IDs
Inputs: model_ids (required). Returns: result
get_modelA
Get detailed info for one model.
Args: model_id: Model slug, e.g. 'anthropic/claude-sonnet-4.6'
Inputs: model_id (required). Returns: result
list_modelsB
List models available on OpenRouter.
Args: modality: Filter by output type. Options: text, image, audio, embeddings, all sort_by: Sort by: name, created, price, context_length
Inputs: modality, sort_by. Returns: result
refresh_cacheA
Force refresh the model cache from OpenRouter.
Inputs: no named parameters. Returns: result
search_modelsA
Search and filter OpenRouter models.
Args: query: Free-text search in model name/id/description provider: Filter by provider (anthropic, google, openai, etc.) max_input_price: Max input price per 1M tokens, 0 = no limit min_context: Minimum context window size requires_tools: Only models supporting tool calling requires_vision: Only models with vision/image input free_only: Only free models
Inputs: query, provider, max_input_price, min_context, +3 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct purpose: get single model details, list with basic filters, search with advanced filters, compare multiple, and cache refresh. No overlapping functionality; descriptions clearly differentiate them.
All tool names follow a consistent verb_noun pattern using lowercase with underscores: list_models, search_models, get_model, compare_models, refresh_cache. No mixing of conventions.
With 5 tools, the server provides a focused set for model discovery and management. This is neither too few nor too many for the domain of querying model information from OpenRouter.
The tool set covers all essential operations for interacting with OpenRouter models: listing, searching, getting details, comparing, and cache management. No obvious gaps like missing model capability queries, as search covers those.
Maintenance
Related MCP Connectors
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that retrieves and provides AI model information from OpenAI, Anthropic, and Google through a unified interface.384 npmMIT
- FlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that wraps the OpenRouter API, enabling users to access diverse language models like Google Gemini 3 Pro for chat and image tasks. It provides tools for generating completions and listing available models within MCP-compatible clients.-
- AlicenseAqualityDmaintenanceAn MCP server that provides access to 400+ AI models via OpenRouter, enabling chat, comparison, and document analysis through Claude.5MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that helps AI assistants automatically find, filter, and rank the best AI models for a specific task using the OpenRouter API.1MIT