Token Count Estimator

Token Count Estimator MCP Connector for Claude

A+

Deterministic LLM token estimation using character-based heuristics.

3 tools Official Updated Oct 1, 2026 Official Vinkius Partner

This MCP server provides precise, deterministic estimation of LLM input sizes. By using model-specific linguistic ratios and structural density analysis, it calculates token counts for various architectures including GPT-4, Claude, Llama, and Gemma. Use estimate_token_usage to get a full breakdown of words, punctuation, and whitespace, or analyze_text_complexity to detect code and URL density. It also provides a confidence interval and warns when you are approaching the context window limit.

tokensllmgpt-4claudeestimation

3 tools expose this connector's capabilities to your AI agent.

analyze_text_complexity

Evaluates the structural characteristics of the text to prepare for specialized density calculations

estimate_token_usage

Provides a comprehensive breakdown of the estimated token count and remaining capacity for a given input

get_model_ratios

Retrieves the hardcoded character-to-token ratios for the specific model and language requested

See how to talk to your AI agent using Token Count Estimator.

Estimate the token usage for this text: 'Hello, world!' using gpt-4 in english with a 4096 context window.

The estimated token count is 3 tokens, with 4093 tokens remaining in the context window.

Analyze the complexity of this code snippet: 'def add(a, b): return a + b'

The text is identified as code with 1 detected numeric sequence and 0 URLs.

What is the character-to-token ratio for Claude in Chinese?

The character-to-token ratio for Claude in Chinese is 1.2.

The estimates use deterministic character-based heuristics. For English, we provide a ±10% confidence interval, while mixed languages use a ±15% interval.

Related Connectors