tokencost-dev
Provides pricing information, context window specifications, and capabilities for OpenAI models (e.g., GPT-4o, GPT-4o-mini), including tools for calculating cost estimates based on input/output token counts.
Install in 30 seconds
Claude Code:
claude mcp add tokencost-dev -- npx -y tokencost-devThen ask: "How much would 1M input tokens cost on claude-sonnet-4-5?"
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"tokencost-dev": {
"command": "npx",
"args": ["-y", "tokencost-dev"]
}
}
}No API keys. No accounts. No configuration files. Pricing data is fetched from the LiteLLM community registry and cached locally for 24 hours.
Related MCP server: UsageWall
Tools
get_model_details
Look up pricing, context window, and capabilities for any model. Fuzzy matching means "sonnet 4.5" works just as well as "claude-sonnet-4-5-20250514".
> "What are Claude Sonnet 4.5's pricing and capabilities?"
Model: claude-sonnet-4-5
Provider: anthropic | Mode: chat
Pricing (per 1M tokens):
Input: $3.00
Output: $15.00
Context Window:
Max Input: 200K
Max Output: 8K
Capabilities: vision, function_calling, parallel_function_callingcalculate_estimate
Estimate cost for a given number of input and output tokens.
> "How much will 1000 input + 500 output tokens cost on Claude Sonnet 4.5?"
Cost Estimate for claude-sonnet-4-5
Input: 1K tokens × $3.00/1M = $0.003000
Output: 500 tokens × $15.00/1M = $0.007500
─────────────────────────────
Total: $0.0105compare_models
Find the most cost-effective models matching your requirements.
> "What are the cheapest OpenAI chat models?"
Top 2 most cost-effective models (provider: openai) (mode: chat):
1. gpt-4o-mini
Provider: openai | Mode: chat
Input: $0.15/1M | Output: $0.60/1M
Context: 128K in / 16K out
2. gpt-4o
Provider: openai | Mode: chat
Input: $5.00/1M | Output: $15.00/1M
Context: 128K in / 16K outrefresh_prices
Force re-fetch pricing data from the LiteLLM registry (cache is refreshed automatically every 24h).
Docs
Full documentation at tokencost.dev
License
MIT
Available Tools
4 toolscalculate_estimateA
Estimate the cost for a given number of input and output tokens on a specific model. Supports optional cached_tokens for prompt caching discounts.
Inputs: model_name (required), input_tokens (required), output_tokens (required), cached_tokens.
compare_modelsA
Filter and compare models by provider, minimum context window, or mode. Returns top 5 most cost-effective matches.
Inputs: provider, min_context, mode.
get_model_detailsA
Look up pricing, context window, and capabilities for an LLM model. Uses fuzzy matching so you don't need the exact model key.
Inputs: model_name (required).
refresh_pricesA
Force a re-fetch of pricing data from the LiteLLM registry. Use this if you suspect the cached data is stale.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 4 tools
Each tool has a distinct, non-overlapping purpose: estimate cost, compare models, get model details, and refresh pricing data. No confusion possible.
All tool names follow a consistent verb_noun pattern (e.g., calculate_estimate, compare_models), making them predictable and easy to understand.
With 4 tools, the set is appropriately scoped for a token cost estimation server. Each tool serves a necessary function without bloat.
The tool set covers the core lifecycle: estimate costs, compare models, retrieve details, and refresh data. Minor gap: no explicit listing of all available models, though get_model_details uses fuzzy matching.
Maintenance
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Live LLM API pricing: token prices, comparisons, cheapest-model lookups. No key required.
Look up, compare and track AI model API prices from an AI assistant. No sign-in needed.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP (Model Context Protocol) server that provides real-time LLM token pricing data for 60+ AI models across 15 providers.616 npm2MIT
- AlicenseNot gradedqualityDmaintenanceLive LLM pricing as an MCP server. Ask Claude or any MCP client 'how much does this prompt cost?' and get real numbers from a hand-checked pricing table for every major LLM.MIT
- AlicenseAqualityFmaintenanceMCP server that provides AI assistants with real-time, current information about AI models from OpenAI, Anthropic, and Google, including pricing, capabilities, and context windows.439 PyPIMIT
- AlicenseAqualityBmaintenanceDaily-verified LLM API pricing dataset (44+ models, CN & global) with a hosted MCP server for live price queries and token cost estimation.2CC BY-4.0