Back to tokcalc

tokcalc MCP Server

v0.3.4

11 planning tools for AI agents (Cursor, Claude Desktop, Cline). Ask your AI: "How many H100s do I need for Llama 70B at 32K context?" — get a transparent, formula-based answer with confidence intervals.

What you get — 11 tools
10 read-only planning tools, plus one calibration writer (record_measured) that stores a real measurement so future estimates self-calibrate. Every tool declares its access level in the Access column below, and in the MCP behaviour hints on the wire.
ToolWhat it doesAccess
estimate_capacityVRAM/KV/throughput/latency for one config. Returns feasibility, performance ranges, cost, confidence.read-only
compare_gpusRanked GPU comparison for one workload. Sort by lowest cost, highest throughput, or best value.read-only
recommend_topologyTP/CP topology recommendation. Returns feasible GPU + topology designs for a context length.read-only
estimate_api_vs_self_hostBreak-even analysis. Compares monthly API costs vs self-hosted GPU infrastructure.read-only
list_modelsDiscover supported model IDs. Filter by family, category, MoE.read-only
list_gpusDiscover supported GPU IDs. Filter by vendor, category, min VRAM.read-only
get_mlperf_benchmarksCurated MLPerf Inference v4.1 audited configs. Cross-validate estimates against reference systems.read-only
find_config_for_sloInverse planner. Given model + context + traffic + SLO ceilings (TTFT, $/M, tok/s), searches every GPU × topology and returns feasible configs ranked by cost, throughput, or value.read-only
plan_deploymentOne-call decision brief: memory + KV headroom, performance, rig cost, blended build-vs-buy with break-even, concrete risks, and next steps.read-only
fetch_model_specFetches the model's real config.json from HuggingFace and diffs it against tokcalc's catalog (layers, KV heads, head_dim). Catches catalog drift before it skews KV math. 24h cache.read-only
record_measuredCalibration loop. Record real tok/s / TTFT from your serving run; future estimates for that model+GPU+quantization are annotated with your measured/predicted ratio.writes state
Get your API key (free, instant)
Enter your email — we'll generate a bearer API key instantly. No credit card, no waiting. Keys are rate-limited at 120 req/min and expire after 90 days of inactivity.

By requesting a key, you agree to the rate limit (120 req/min per key, 30 req/min per IP). We store your email + key hash in Upstash Redis (90-day TTL). We don't send marketing emails. Limit: 5 key requests per IP per day.

Install in Cursor / Claude Desktop (stdio transport — alternative)
Run tokcalc locally as a stdio MCP server (Cursor spawns the process). Use this if you prefer local install over the hosted endpoint above.
  • Cursor: ~/.cursor/mcp.json (global) or .cursor/mcp.json (project)
  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
  • Cline: uses VS Code MCP settings
{
  "mcpServers": {
    "tokcalc": {
      "command": "npx",
      "args": ["-y", "@tokcalc/mcp-server"]
    }
  }
}

Restart your editor. The 11 tools will appear in your MCP tool list within seconds. No API key needed for stdio (local install).

Self-host the HTTP server (advanced)
For air-gapped deployments, custom rate limits, or running on your own infra. Same code as the public endpoint — just on your own server.
# Install globally (or use npx)
npm install -g @tokcalc/mcp-server

# Run the HTTP server (defaults to port 3000)
tokcalc-mcp-http

# Or with a custom port:
PORT=8080 tokcalc-mcp-http
✓ Self-hosted:v0.2.0 includes bearer API key auth + Upstash Redis rate limiting. Set MCP_API_KEY, UPSTASH_REDIS_REST_URL, and UPSTASH_REDIS_REST_TOKENenv vars before deploying to your own server.
Example prompts to ask your AI
Once installed, your AI agent can call tokcalc tools. Try these natural-language prompts.
"How many H100s do I need to serve Llama 3.3 70B at 32K context for 100 concurrent users?"
"Compare H100 vs H200 for serving Llama 3.3 70B FP8 at 8K context — which is better value?"
"What's the break-even request volume for self-hosting Llama 70B vs using GPT-4o API at 50% utilization?"
"Show me MLPerf v4.1 audited configurations for H200 with FP8 quantization"
"Recommend a topology for serving Llama 3.3 70B at 128K context with batch size 8"
Roadmap
✓ shipped
v0.1.4 — stdio transport with 7 tools
Cursor / Claude Desktop / Cline local installs
✓ shipped
v0.2.0-alpha.1 → beta.1 — HTTP transport + auth + rate limit
Stateless Streamable HTTP + bearer API key + Upstash Redis rate limiting
✓ shipped
v0.2.0 — public hosted endpoint + self-serve API keys
Live at tokcalc.vercel.app/api/mcp + instant key generation at /mcp
✓ shipped
v0.2.6 → v0.2.7 — 4 new tools + unified core
find_config_for_slo, plan_deployment, fetch_model_spec, record_measured (self-calibration); npm + hosted endpoint now share one tool core
✓ shipped
v0.2.8 → v0.2.9 — QA battery + SLO cost fix
35-check published-tarball battery; find_config_for_slo now quotes true dedicated-rig monthly cost with right-sizing tiers
v0.3.0
v0.3.0 — OAuth 2.1 with PKCE
Multi-user auth, scopes, dynamic registration