MCP server for LLM token pricing data — query, compare, and estimate costs for 60+ AI models from OpenAI, Anthropic, Google, Meta, and more
TokenCost MCP server demonstrates solid tool design with clear naming, comprehensive descriptions, and proper schema definitions. All 6 tools follow verb_noun convention (get_, compare_, estimate_, find_, list_, get_). Descriptions are detailed (150-300 chars) and include examples. Input schemas use Zod with type constraints and enums where appropriate. Tool annotations (readOnlyHint, destructiveHint, idempotentHint) are correctly applied. Key gaps: output schemas are not formally documented in the tool definitions (only visible in implementation); error handling lacks recovery guidance (e.g., 'model not found' suggests alternatives but doesn't guide next steps); parameter descriptions could be more prescriptive about ranges and formats.
Compare pricing across multiple LLM models side by side. Args: - models (string[]): Array of model IDs or names to compare (2-10 models) Returns: Side-by-side comparison table with input/output costs, context windows, and relative cost differences. Examples: - ["gpt-5", "claude-sonnet-4.6"] → Compare OpenAI vs Anthropic pricing - ["gpt-5-mini", "gemini-3-flash", "claude-haiku-4.5"] → Compare budget models
Calculate the cost for a specific number of input and output tokens with a given model. Args: - model (string): Model ID or name - input_tokens (number): Number of input tokens (0 to 100B) - output_tokens (number): Number of output tokens (0 to 100B) Returns: Cost breakdown with input cost, output cost, and total cost in USD. Examples: - model="gpt-5", input_tokens=1000, output_tokens=500 → Cost for a typical API call - model="claude-sonnet-4.6", input_tokens=100000, output_tokens=4000 → Cost for a long context call
Find the cheapest LLM models, optionally filtered by provider or minimum context window. Args: - provider (string, optional): Filter by provider (e.g., "OpenAI", "Anthropic", "Google") - min_context (number, optional): Minimum context window size in tokens - sort_by (string, optional): Sort by "input", "output", or "combined" cost (default: "combined") - limit (number, optional): Number of results to return (default: 10, max: 30) Returns: Ranked list of cheapest models with pricing details. Examples: - {} → Top 10 cheapest models overall - { provider: "OpenAI" } → Cheapest OpenAI models - { min_context: 200000, sort_by: "input" } → Cheapest 200K+ context models by input price
Output schemas not formally documented in tool definitions. While implementation returns structured content (modelToJSON, markdown), the tool registration does not declare expected output fields, types, or structure. LLMs cannot plan downstream operations without knowing what fields to extract.
Error handling lacks actionable recovery guidance. When a model is not found, the tool suggests similar models or lists providers, but does not guide the LLM on which tool to call next (e.g., 'Call tokencost_list_models to see all available models'). Recovery hints are implicit rather than explicit.
Parameter descriptions lack explicit range/format constraints. 'input_tokens' and 'output_tokens' state '0 to 100B' in the description text, but this is not enforced via schema constraints (min/max). 'limit' parameter in tokencost_find_cheapest and tokencost_list_models lacks explicit bounds in the schema.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 61 | 2025-06-18+ | v2 |
Get pricing details for a specific LLM model. Args: - model (string): Model ID or name to look up (e.g., "gpt-5", "claude-sonnet-4.6", "gemini-3-pro") Returns: Model pricing details including input/output costs per 1M tokens, context window, and max output. Returns an error message if the model is not found, with suggestions for similar models. Examples: - "gpt-5" → GPT-5 pricing from OpenAI - "claude-opus-4.6" → Claude Opus 4.6 pricing from Anthropic - "gemini" → First matching Gemini model
Get a list of all supported AI model providers. Returns: List of provider names (e.g., OpenAI, Anthropic, Google, Meta, etc.) Examples: - {} → ["OpenAI", "Anthropic", "Google", "Meta", ...]
List all available LLM models with their pricing information. Args: - provider (string, optional): Filter by provider (e.g., "OpenAI", "Anthropic", "Google") - limit (number, optional): Maximum number of models to return (default: 50, max: 100) Returns: Complete list of available models with pricing details. Examples: - {} → All 60+ models - { provider: "OpenAI" } → All OpenAI models - { limit: 20 } → First 20 models
STDIO-only transport limits remote accessibility. Server uses StdioServerTransport exclusively, making it unsuitable for hosted MCP clients or cloud-based agent platforms. Cannot be deployed as a service.
tokencost_compare_models requires minimum 2 models but does not validate this at schema level. Validation occurs in handler logic, forcing the LLM to discover the constraint via error message rather than reading the schema.