models-mcp
Models MCP
Ищите, сравнивайте и изучайте ИИ-модели по цене, размеру контекстного окна и возможностям. MCP-сервер поверх каталога models.dev (models.dev/api.json), так что ваш агент всегда имеет актуальные данные о моделях без ручного ведения списка.
Сам models.dev не поставляет MCP-сервер, только JSON API и TypeScript SDK для чтения. Этот репозиторий закрывает этот пробел.
Из одного и того же кода инструмента работает двумя способами:
stdio (
src/index.ts) для локальных MCP-клиентовCloudflare Worker (
src/worker.ts) как удалённая конечная точка Streamable HTTP на/mcp
Инструменты
Инструмент | Что делает |
| Перечисляет всех провайдеров (anthropic, openai, google, ...) с количеством моделей |
| Фильтрует модели по имени, провайдеру, минимальному контекстному окну, max входной цене или флагам возможностей (reasoning, tool_call, attachment) |
| Полные метаданные одной модели по идентификатору |
| Построчное сравнение 2–6 моделей по цене, контексту и возможностям |
| Принудительно перезапрашивает каталог, игнорируя 1-часовой кэш |
Related MCP server: TokenLab Model Explorer
Install
npm install
npm run buildЗапуск автономно через stdio (для тестирования)
npm startОн говорит на MCP через stdio, поэтому напрямую вы многого не увидите; используйте MCP Inspector, чтобы пощупать его:
npx @modelcontextprotocol/inspector node dist/index.jsРазмещение на Cloudflare Workers
Точка входа Worker (src/worker.ts) предоставляет те же инструменты через Streamable HTTP на /mcp, со следующими возможностями:
Кэширование каталога в Workers Cache API (
caches.default) с TTL 1 час, общим для запросов и изолятов.Ограничение запросов на IP через привязку rate limiting Workers: 60 запросов/мин на IP, которое применяется для каждой локации Cloudflare. Избыточные запросы получают
429сRetry-After: 60.
# local dev at http://localhost:8787/mcp
npm run dev:worker
# deploy
npm run deployПосле развёртывания ваша конечная точка: https://models-mcp.<your-subdomain>.workers.dev/mcp.
Направьте MCP-клиенты на неё:
Claude Code:
claude mcp add --transport http models-mcp https://models-mcp.<your-subdomain>.workers.dev/mcpКонфигурация универсального клиента (всё, что поддерживает Streamable HTTP):
{
"mcpServers": {
"models-mcp": {
"url": "https://models-mcp.<your-subdomain>.workers.dev/mcp"
}
}
}Для клиентов, работающих только через stdio (Claude Desktop), используйте мост через mcp-remote:
{
"mcpServers": {
"models-mcp": {
"command": "npx",
"args": ["mcp-remote", "https://models-mcp.<your-subdomain>.workers.dev/mcp"]
}
}
}Никаких API-ключей нигде не требуется. Все данные берутся из публичной конечной точки models.dev/api.json.
Тесты
npm testПокрывают клиент каталога (уплощение, TTL-кэширование, принудительное обновление, запасной вариант на устаревшие данные при сбое, разрешение идентификаторов) и все пять инструментов в комплексной проверке через реальную сессию MCP-клиента по транспорту в памяти.
Примечания к данным
Каталог кэшируется на 1 час: в Workers Cache API при размещении и в памяти процесса при работе через stdio. Вызовите
refresh_catalog, чтобы принудительно обновить. Если повторный запрос не удастся, будет продолжать отдаваться последний успешный каталог.models.dev не публикует версионированную схему для пользователейопросных, поэтому типы в
src/types.tsнамеренно слабые типизированные (индексные сигнатуры сохраняют любые поля, не описанные явно).Идентификаторы моделей используют соглашение
provider/model, принятое в AI SDK и OpenCode, напримерanthropic/claude-sonnet-4-5. Инструментыget_modelиcompare_modelsтакже принимают голый идентификатор модели, если он не является неоднозначным среди провайдеров.
Возможные расширения
Инструмент
list_facets(модальности, токенизаторы), похожий на то, что предоставляют другие каталоги модельных задач.Инструмент
test_model, который делает живой вызов через ваш настроенный ключ провайдера, для проверки задержки и стоимости.OAuth или Cloudflare Access перед Worker, если вы хотите сделать его приватным.
Available Tools
8 toolscompare_modelsCompare modelsA
Diff 2-6 models side by side on pricing, context window, and capabilities. Accepts 'provider/model' ids, or bare model ids when unambiguous across providers. Ids resolving to the same model are compared once.
Inputs: ids (required).
estimate_costEstimate costA
Estimate the USD cost of a request to one model from its published per-million-token rates. Use get_model first if you need to pick an id.
Inputs: id (required), inputTokens, outputTokens, cacheReadTokens, +1 more.
find_modelsFind modelsA
Search and filter models across all providers by name, provider, capability, context window, or price. Returns a compact summary per model; use get_model for full details on one.
Inputs: limit, query, provider, minContext, +4 more.
get_modelGet modelA
Fetch full metadata for one model. Accepts 'provider/model' (preferred, e.g. 'anthropic/claude-sonnet-4-5') or a bare model id if unambiguous across providers.
Inputs: id (required).
get_providerGet providerA
Fetch metadata for one provider: display name, AI SDK package name, API base URL, docs link, and a compact list of its models. Accepts the provider id ('anthropic') or display name ('Anthropic'). Use get_model for full per-model detail.
Inputs: id (required).
list_providersList providersA
List every provider in the models.dev catalog (e.g. anthropic, openai, google) with its model count. Use this to see what's available before narrowing with find_models.
Inputs: no named parameters.
refresh_catalogRefresh catalogA
Force a fresh fetch of the models.dev catalog, bypassing the in-memory cache. Use if you suspect the data is stale. If the refetch fails, the last good catalog keeps being served and servedStale is reported as true.
Inputs: no named parameters.
top_modelsTop modelsA
Rank models by one criterion: cheapest input/output price per million tokens, largest context window, most context per input dollar, or newest release. Supports the same filters as find_models.
Inputs: sortBy (required), limit, query, provider, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct operation: listing providers, searching models, fetching details, comparing, refreshing, estimating cost, ranking, and provider metadata. Even where two tools support similar filters, their purposes are clearly differentiated by descriptions.
Tool names mostly follow a clear verb_noun pattern such as list_providers, find_models, get_model, and estimate_cost. The exception is top_models, which reads more like a noun phrase than an imperative verb action, a minor deviation from the otherwise consistent convention.
Eight tools is a well-scoped size for a model catalog server. Each tool covers a meaningful workflow without redundancy or bloat, from discovery and search to comparison and cost estimation.
The surface covers the full read-only lifecycle of interacting with the models.dev catalog: list, search, detail, compare, rank, and cost estimation, plus provider-level metadata and cache refresh. No obvious dead ends or missing core operations are present.
Related MCP Connectors
Live registry of AI model specs, context windows, and per-token pricing.
Compare LLM API prices, search models and providers, and access reviewed benchmark results.
Look up, compare and track AI model API prices from an AI assistant. No sign-in needed.
Search curated open-weight AI model releases, licenses, architectures, and primary sources.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides up-to-date AI model names and pricing from models.dev, solving model hallucination by fetching recently released models.1-
- AlicenseNot gradedqualityCmaintenanceEnables browsing TokenLab models, comparing pricing, and generating cURL examples for various AI endpoints.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to browse, inspect, and compare LLMs from OpenRouter's catalog with normalized per-million-token pricing, context windows, and modalities. Supports filtering by search, free-only status, minimum context, or modality.316 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables checking OpenAI, Claude, Gemini and other LLM model IDs against a live catalog to identify deprecated or unknown names and suggest newer replacements. Also lets users search current models by provider, price, context size or tool support, and scan files or folders for outdated IDs.72 npmMIT