MCP Server

ai-token-counter

io.github.lazymac2x/ai-token-counter
Developer Tools Public & reachable MCP 2026-07-28

What this MCP does

Counts tokens, provides AI model pricing and context limits, and estimates API call costs and monthly projections.

count_tokens
Count tokens for a text string or chat messages array for any supported AI model (GPT-4o, Claude, Gemini, Mistral, Llama).
Input schema
{'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Plain text to count tokens for.'}, 'model': {'type': 'string', 'description': 'Model ID, e.g. gpt-4o, claude-sonnet-4. Defaults to gpt-4o.'}, 'messages': {'type': 'array', 'items': {'type': 'object'}, 'description': 'Chat messages array in OpenAI/Anthropic format.'}}}
estimate_cost
Estimate the cost of an AI API call given model and token counts or text. Returns input/output/total cost and optional monthly projection.
Input schema
{'type': 'object', 'required': ['model'], 'properties': {'text': {'type': 'string', 'description': 'Text to tokenize for input (if input_tokens not given).'}, 'model': {'type': 'string', 'description': 'Model ID, e.g. gpt-4o, claude-opus-4, gemini-2.0-flash.'}, 'input_tokens': {'type': 'integer', 'description': 'Number of input tokens.'}, 'output_tokens': {'type': 'integer', 'description': 'Number of output tokens.'}, 'requests_per_day': {'type': 'number', 'description': 'If given, adds daily/monthly/yearly cost projection.'}}}
get_model_pricing
Get input/output pricing per 1M tokens for a specific AI model.
Input schema
{'type': 'object', 'required': ['model'], 'properties': {'model': {'type': 'string', 'description': 'Model ID, e.g. gpt-4o, claude-haiku-3, llama-3-70b.'}}}
list_models
List all supported AI models with their pricing and context windows.
Input schema
{'type': 'object', 'properties': {}}
Added
list_models
Sept. 17, 2026, 12:43 p.m.
Added
get_model_pricing
Sept. 17, 2026, 12:43 p.m.
Added
estimate_cost
Sept. 17, 2026, 12:43 p.m.
Added
count_tokens
Sept. 17, 2026, 12:43 p.m.