models-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@models-mcp find models under $0.01 per 1M tokens with 128k context"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Models MCP
Search, compare, and inspect AI models by pricing, context window, and capabilities. An MCP server over the models.dev catalog (models.dev/api.json), so your agent always has current model data without you hand-maintaining a list.
models.dev itself doesn't ship an MCP server, just a JSON API and a TypeScript SDK for reading it. This fills that gap.
Runs two ways from the same tool code:
stdio (
src/index.ts) for local MCP clientsCloudflare Worker (
src/worker.ts) as a remote Streamable HTTP endpoint at/models-mcp
Tools
Tool | What it does |
| Lists every provider (anthropic, openai, google, ...) with model counts |
| Filters models by name, provider, min context window, max input cost, or capability flags (reasoning, tool_call, attachment) |
| Full metadata for one model, by |
| Side-by-side diff of 2-6 models on pricing, context, and capabilities |
| Ranks models by cheapest input/output price, largest context, context-per-dollar, or newest release; supports the same filters as |
| Computes the USD cost of a request from a model's published per-million-token rates, including cache read/write components |
| Provider metadata: display name, AI SDK package, API base URL, docs link, and a compact list of its models |
| Forces a re-fetch, bypassing the 1-hour cache |
All search-style tools (find_models, top_models) share one filter schema, so filter semantics are identical everywhere. Ranking and estimation exclude models that lack the relevant data (e.g. unpriced local models) rather than guessing.
Related MCP server: model-version-mcp
Install
npm install
npm run buildRun standalone over stdio (for testing)
npm startIt speaks MCP over stdio, so you won't see much directly; use the MCP Inspector to poke at it:
npx @modelcontextprotocol/inspector node dist/index.jsHost on Cloudflare Workers
The Worker entry (src/worker.ts) serves the same tools over Streamable HTTP at /models-mcp, with:
Catalog caching in the Workers Cache API (
caches.default) with a 1-hour TTL, shared across requests and isolates.Per-IP rate limiting via a Workers rate limiting binding: 60 requests/minute per IP, enforced per Cloudflare location. Excess requests get
429withRetry-After: 60.
# local dev at http://localhost:8787/models-mcp
npm run dev:worker
# deploy
npm run deployAfter deploy, the canonical endpoint is https://mcp.dosa.dev/models-mcp. The generated https://models-mcp.<your-subdomain>.workers.dev/models-mcp URL stays live as a fallback.
Point MCP clients at it:
Claude Code:
claude mcp add --transport http models-mcp https://mcp.dosa.dev/models-mcpGeneric client config (anything that speaks Streamable HTTP):
{
"mcpServers": {
"models-mcp": {
"url": "https://mcp.dosa.dev/models-mcp"
}
}
}For stdio-only clients (Claude Desktop), bridge with mcp-remote:
{
"mcpServers": {
"models-mcp": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.dosa.dev/models-mcp"]
}
}
}No API keys required anywhere. All data comes from the public models.dev/api.json endpoint.
Try it out
With the dev server running (npm run dev:worker), the endpoint is http://localhost:8787/models-mcp.
Quick curl (MCP initialize):
curl -X POST http://localhost:8787/models-mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"manual","version":"1.0"}}}'Expect an SSE response with serverInfo.name: "models-mcp".
MCP Inspector (best for poking at tools interactively):
npx @modelcontextprotocol/inspectorSet Transport Type to Streamable HTTP and URL to http://localhost:8787/models-mcp, then call tools from the UI.
Claude Code against the local server:
claude mcp add --transport http models-mcp-local http://localhost:8787/models-mcpThen ask it something like "which anthropic models cost under $1 per million input tokens?" and watch it reach for find_models.
Rate limiting: fire 61 rapid requests at the endpoint and request 61 onwards returns 429 with Retry-After: 60.
Things worth trying in the Inspector:
find_modelswith combined filters, e.g.maxInputCost: 0.5together withminContext: 200000get_modelwith a bare id likegpt-5.2(resolves) and with a nonsense id (clean tool error)compare_modelswith one invalid id mixed in (it lands undernotFound)The first call fetches the live catalog (~200ms); repeat calls are cache hits
Tests
npm testCovers the catalog client (flattening, TTL caching, force refresh, stale-on-failure fallback, id resolution) and all eight tools end-to-end through a real MCP client session over an in-memory transport.
Notes on the data
The catalog is cached for 1 hour: in the Workers Cache API when hosted, in process memory over stdio. Call
refresh_catalogto force an update. If a refetch fails, the last good catalog keeps being served andrefresh_catalogreportsservedStale: trueso you can tell.A daily GitHub Actions workflow (
Catalog drift) fetches the liveapi.jsonand sanity-checks it against the flattening logic, since models.dev publishes no versioned schema. It opens acatalog-driftissue if upstream changes shape. Run it locally withnpm run build && npm run test:live.models.dev doesn't publish a versioned schema for consumers, so the types in
src/types.tsare intentionally loose (index signatures preserve any fields not explicitly typed).Model ids follow the
provider/modelconvention used by the AI SDK and OpenCode, e.g.anthropic/claude-sonnet-4-5.get_modelandcompare_modelsalso accept a bare model id when it names exactly one model across all providers; if the bare id is ambiguous (common with aggregator providers mirroring first-party models), the tool errors with the list of candidateprovider/modelids instead of silently picking one.get_provideremits fullprovider/modelids so its output round-trips throughget_modelunchanged.
Possible extensions
A
list_facetstool (modalities, tokenizers) similar to what other model-catalog MCPs expose.A
test_modeltool that makes a live call through whichever provider key you have configured, for latency/cost sanity checks.OAuth or Cloudflare Access in front of the Worker, if you want it private.
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.
Maintenance
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
- AlicenseAqualityFmaintenanceProvides AI assistants with real-time access to 1000+ AI models including their latest pricing, context windows, capabilities, and specifications. Supports model search, comparison, recommendations, and live testing.390 npm1MIT
- 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.794 npmMIT