Skip to main content
Glama
TokensWatch MCP server

TokensWatch MCP server

by CoryMink

TokensWatch MCP server

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.

Related MCP server: statlyte

Tools

Tool

What it does

list_models

Prices for every model; filter by provider, tier or context window, sort by price

get_model_pricing

Full pricing for one model: cache, batch, long-context, off-peak, limits, upcoming changes

estimate_cost

Cost per request, day and 30-day month; compare named models or rank the cheapest

price_changes

Dated 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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables assistants to access up-to-date LLM pricing, context windows, and model identifiers, with tools to estimate costs, find cheapest models, and check scheduled price changes.
      53 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to fetch live, dated prices for LLM models and cloud compute instances across providers, compare and recommend models, and estimate monthly costs based on workload-specific token shapes and constraints.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables agents to query live AI model pricing, compare providers, and calculate token workload costs from current published prices.
      MIT