# TokCalc MCP Server [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/stevecrates489-commits/tokcalc.git  
**GitHub Stars:** 1  
**npm Downloads (last month):** 626  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/tokcalc-mcp-server

## Description
LLM capacity planning tools to estimate VRAM, compute, latency, and GPU topology for agents.

## Tools
Capabilities this server exposes over MCP:

- **estimate_capacity** — Estimate whether an LLM-serving configuration fits in memory and can meet throughput and latency targets. Returns VRAM/KV-cache breakdown, throughput and latency ranges, concurrency, cost, confidence, assumptions, and sources.
- **compare_gpus** — Compare supported GPU or cloud SKU options for the same LLM workload. Use before recommending hardware.
- **recommend_topology** — Recommend feasible GPU/topology designs including tensor parallelism and context parallel (RingAttention) when needed.
- **estimate_api_vs_self_host** — Compare monthly token-based API costs with self-hosted GPU infrastructure under stated utilization assumptions.
- **list_models** — List tokcalc-supported model IDs and metadata. Use before estimating if the requested model is ambiguous or unknown.
- **list_gpus** — List GPU and cloud SKU IDs, memory, bandwidth, pricing, and categories.
- **get_mlperf_benchmarks** — Retrieve curated MLPerf Inference v4.1 LLM benchmark reference configurations. Throughput is computed by tokcalc formulas (confidence_tier=derived). Use to cross-validate theoretical estimates against audited system configurations.
- **find_config_for_slo** — INVERSE planner: given model + context + traffic volume + optional TTFT/cost/throughput ceilings, search every GPU × topology (1/2/4/8 GPUs) and return feasible configurations ranked by cost, throughput, or value. Use when the user knows their SLOs but not the hardware.
- **plan_deployment** — One-call deployment decision brief for a specific config: memory breakdown with KV headroom, performance, rig cost, blended build-vs-buy with break-even, concrete risks (no-NVLink TP, tight headroom, long context), and next steps. Chains what would otherwise take 4 separate tool calls.
- **fetch_model_spec** — Fetch a model's real config.json from HuggingFace and diff it against tokcalc's catalog (layers, KV heads, head_dim, vocab, max context). Catches catalog drift before it corrupts KV-cache math. Cached 24h locally; use forceRefresh to re-fetch. Works offline via cache fallback.
- **record_measured** — Record a real-world measurement (observed tok/s, TTFT, ITL) for a model+GPU+quantization cell. Compares against the model's prediction, stores a measured/predicted ratio, and future estimate_capacity / find_config_for_slo results for that cell are annotated with your calibration. The estimator improves as you use it.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "tokcalc-mcp-server": {
    "command": "npx",
    "args": ["-y","@tokcalc/mcp-server"]
  }
}
```

## Documentation

## What TokCalc MCP Server does

TokCalc MCP Server brings tokcalc’s LLM serving capacity planner into MCP-based agent workflows. It turns a selected model, accelerator, quantization format, context length, concurrency, and latency or traffic assumptions into a deployment estimate.

The calculations cover more than decode speed. Results can include model and KV-cache fit, per-stream and aggregate throughput, prefill speed, time to first token, inter-token latency, maximum concurrency at long context lengths, recommended multi-GPU topology, and operating cost. Cost outputs can extend from GPU hourly pricing to cost per million output tokens, cost per request, and monthly estimates.

The planner also supports build-versus-buy analysis. Self-hosted configurations can be compared with API pricing across providers, including a break-even assessment based on request volume.

## How it works

The MCP package uses the shared tokcalc calculation engine used by the web application and command-line interface. Its estimates are based on a catalog of models, accelerators, quantization formats, API prices, and cloud GPU prices. The catalog includes 44 models, 31 accelerators, and 16 quantization formats.

Long-context planning accounts for KV memory per request and the increasing prefill cost of larger contexts. Capacity views cover contexts from 4K through 1M tokens and can recommend single-GPU, tensor-parallel, or context-parallel arrangements. The calculator also models configurable effects such as continuous batching, speculative decoding, prompt caching, and hidden reasoning tokens.

GPU pricing can be retrieved from Azure, AWS, GCP, and Vast.ai. Provider requests are handled independently, so a failed provider lookup does not prevent other pricing sources from returning results.

## Setup and configuration

The package is published as `@tokcalc/mcp-server`. Its command-line interface can create a plan from a `.tokcalc.json` file or from command-line arguments. A basic configuration can specify fields such as:

- `model`
- `gpu`
- `quantization`
- `numGpus`
- `contextTokens`
- `concurrency`

For example, the package supports commands such as `npx @tokcalc/mcp-server plan --config .tokcalc.json` and direct planning with model, GPU, quantization, and output-format flags. JSON output is available for automation. The CLI returns exit code `0` for a fitting plan, `2` when the plan is infeasible, and `1` for a usage error.

GCP live pricing uses the optional `GCP_API_KEY` environment variable. Other listed pricing providers use public endpoints described by the project, and provider results are cached for either 24 hours or, for Vast.ai spot pricing, 5 minutes.

## Tools and capabilities

- Estimate VRAM and KV-cache requirements.
- Calculate decode, aggregate, and prefill throughput.
- Split latency into first-token and inter-token components.
- Recommend tensor-parallel and context-parallel GPU layouts.
- Compare self-hosted economics with API pricing and break-even volume.
- Calibrate estimates against vLLM, SGLang, or TensorRT-LLM benchmark JSON.
- Retrieve and compare live GPU prices across supported providers.

## Limitations and notes

The outputs are planning estimates rather than deployment measurements. Benchmark calibration is available for observed runtime data, but accuracy depends on the supplied benchmark and workload assumptions. Catalog records and static cloud prices are curated data, while live provider pricing depends on successful upstream requests and any required provider credentials. Pricing and performance should therefore be reviewed against the target serving stack before committing to hardware.

_Full upstream README: https://allmcps.com/mcp/tokcalc-mcp-server/readme_

