Repository avatar
AI Tools
v1.0.1
active

mcp

net.tokenswatch/mcp

Current LLM API prices with cache, batch and long-context rates, cost estimates and change history.

Documentation

TokensWatch MCP server

TokensWatch

A free, remote MCP server that gives AI assistants current LLM API prices: standard input/output plus prompt-cache, Batch API, long-context and off-peak rates for models from Anthropic, OpenAI, Google, xAI, DeepSeek and Mistral. Prices are re-verified twice a day against each provider's own pricing page.

Connect

Claude Code:

claude mcp add --transport http tokenswatch https://mcp.tokenswatch.net/mcp

Cursor, VS Code and other mcp.json clients:

{ "mcpServers": { "tokenswatch": { "url": "https://mcp.tokenswatch.net/mcp" } } }

Claude.ai / ChatGPT: Settings → Connectors → add a custom connector with the endpoint URL.

Tools

ToolWhat it does
list_modelsPrices for every model; filter by provider, tier or context window, sort by price
get_model_pricingFull pricing for one model: cache, batch, long-context, off-peak, limits, upcoming changes
estimate_costCost per request, day and 30-day month; compare named models or rank the cheapest
price_changesDated history of price changes, filtered by model or date

Example questions: "Cheapest model with a 1M-token context window?", "Compare Claude Sonnet 5.5 and GPT-6.2 Sol for 3,000 input and 800 output tokens, 20,000 requests a day."

Cost estimates leave out cache-write charges, tool/search fees and image or audio tokens.

How it works

A stateless Cloudflare Worker using the official MCP TypeScript SDK (WebStandardStreamableHTTPServerTransport, JSON responses):

  • src/index.js: request handling, CORS, per-IP rate limit, a fresh server per request.
  • src/tools.js: tool schemas (zod) and handlers.
  • src/pricing.js: pure cost logic (unit-tested).
  • src/data.js: loads https://tokenswatch.net/data/v1/*.json, memoised for 5 minutes.

Develop

npm install
npm test                                   # unit tests
npm run dev                                # local server on :8787
node test/e2e.mjs http://127.0.0.1:8787    # end-to-end MCP check

wrangler.jsonc contains the production bindings (service binding to the site Worker, custom domain); remove those to deploy your own copy.

Licence

Code: MIT. Pricing data: CC BY 4.0, credit TokensWatch.

No installation packages available.

Remote