Tokenia MCP Server

Use Tokenia's token counting and LLM cost estimation directly from your agent or IDE — Claude, Cursor, or any client that speaks the Model Context Protocol. Exact token counts for OpenAI and DeepSeek, cost across 100+ models, no sign-up.

Endpoint

https://tokenia.live/mcp
Streamable HTTP Stateless Public — no API key Rate-limited

Accuracy, stated honestly: token counts are exact for OpenAI and DeepSeek models (official tokenizers) and estimated for every other provider. Every result row carries an exact boolean so you always know which is which. Costs are computed from Tokenia's public pricing dataset.

Connect

Claude Code
claude mcp add --transport http tokenia https://tokenia.live/mcp
Cursor — ~/.cursor/mcp.json (or project .cursor/mcp.json)
{
  "mcpServers": {
    "tokenia": {
      "type": "http",
      "url": "https://tokenia.live/mcp"
    }
  }
}
Any MCP client

Any client that supports the Streamable HTTP transport can connect by pointing at https://tokenia.live/mcp (HTTP POST). The server is stateless — no session handshake to persist.

Tools

count_tokens

Count the tokens in a text and estimate per-model input/output cost across LLM providers. Counts are exact for OpenAI and DeepSeek and estimated for others — every row carries an exact boolean. Optionally filter by provider or model.

Input
Returns

{ charCount, wordCount, lineCount, modelCount, models: [{ provider, providerName, model, modelName, tokens, exact, inputCostUSD, outputCostUSD, inputPer1M, outputPer1M, contextWindow, fitsContext }] }

estimate_cost

Estimate input + output cost for one model. Provide the input size as inputTokens (a known count) OR text (which is tokenized for that model). With text, exact reflects whether the count is exact (OpenAI/DeepSeek) or estimated; with inputTokens, exact is null (caller-supplied).

Input
Returns

{ model, modelName, inputTokens, outputTokens, inputCostUSD, outputCostUSD, totalCostUSD, exact (boolean | null) }

list_models

List the LLM models Tokenia knows, with input/output price per 1M tokens and context window. exactSupported is true only where an official tokenizer gives exact counts (OpenAI/DeepSeek). Optionally filter by provider or search.

Input
Returns

{ modelCount, models: [{ provider, model, name, inputPer1M, outputPer1M, contextWindow, exactSupported }] }

compare_models

Compare the cost of a workload across 2+ models. Provide the input size as inputTokens (a known count) OR text (tokenized per model, each row with its own exact flag). Returns per-model totals, the cheapest model, and the savings vs the most expensive.

Input
Returns

{ models: [{ model, modelName, inputTokens, exact, inputCostUSD, outputCostUSD, totalCostUSD }], cheapest, savingsUSD, savingsPct }

Prefer the website? The same data powers the analyzer, the model directory, and the cheapest-by-use-case pages.