Provides LLM pricing lookups, cost estimations, and model comparisons using the LiteLLM registry.
Also known as atriumn/tokencost-dev
- Stars
- 1
- Tools
- 2
- Downloads, 30 days
- —
- Latest version
- 0.1.3
- Last commit
- Nov 13, 2026
- License
- MIT
What is tokencost MCP?
tokencost provides LLM pricing lookups, cost estimations, and model comparisons using the LiteLLM registry. It exposes 2 tools, such as gpt-4o-mini, gpt-4o.
Summary generated from the project's README
About tokencost MCP server
Estimating large language model expenses and comparing model specifications is what developers do with tokencost-dev. This server connects to your AI client to provide instant pricing data, context window limits, and capability details for various models. It works locally via npx and requires no API keys, accounts, or complex configuration files to function.
Users can interact with the server through tools like get_model_details for specific model lookups or calculate_estimate to determine the price of a specific token count. The system uses the LiteLLM community registry to fetch data and caches this information locally for 24 hours. If you need the most recent data immediately, you can use the refresh_prices tool to bypass the cache.
This tool is particularly useful for those using Claude Code or Cursor. It supports fuzzy matching, meaning you can ask about models using natural names rather than exact technical strings. By using compare_models, you can identify the most cost-effective options among specific providers or modes.
What you can do with it
- 1Calculate specific token costsDetermine the exact price for a specific number of input and output tokens for a model.
- 2Compare model pricingFind the most economical models within a specific provider or category.
- 3Retrieve model specificationsGet detailed information regarding a model's context window and supported capabilities.
- 4Quick pricing lookupsAsk natural language questions to find out how much a specific model costs.
Written from the project's README. Every use case is checked against a quote from it.
How to install tokencost MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall tokencost MCP in Claude Code
$ claude mcp add tokencost-dev -- npx -y tokencost-devInstall tokencost MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"tokencost-dev": {
"command": "npx",
"args": [
"-y",
"tokencost-dev"
]
}
}
}Install tokencost MCP in VS Code
.vscode/mcp.json
{
"servers": {
"tokencost-dev": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"tokencost-dev"
]
}
}
}Install tokencost MCP in VS Code CLI
$ code --add-mcp '{"name":"tokencost-dev","type":"stdio","command":"npx","args":["-y","tokencost-dev"]}'Install tokencost MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"tokencost-dev": {
"command": "npx",
"args": [
"-y",
"tokencost-dev"
]
}
}
}Install tokencost MCP in Codex
$ codex mcp add tokencost-dev -- npx -y tokencost-devInstall tokencost MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.tokencost-dev] command = "npx" args = ["-y", "tokencost-dev"]
Install tokencost MCP in Gemini CLI
$ gemini mcp add -s user tokencost-dev npx -- -y tokencost-devInstall tokencost MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"tokencost-dev": {
"command": "npx",
"args": [
"-y",
"tokencost-dev"
]
}
}
}tokencost MCP tools 2
Detected from the READMEgpt-4o-minigpt-4o
| gpt-4o-mini | — | |
| gpt-4o | — |
Automated checks
Ran Nov 13, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachableatriumn/tokencost-dev is public and reachablegithub.com/atriumn/tokencost-dev ↗Pass
- Package names this repository as its sourcetokencost-dev names atriumn/tokencost-dev as sourcenpmjs.com/package/tokencost-dev ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for tokencost-devnpmjs.com/package/tokencost-dev/v/0.1.3#provenance ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-03github.com/atriumn/tokencost-dev ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from tokencost-devPass
- No critical advisory in the package or its dependencies100 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model2 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubInstall in 30 seconds
Claude Code:
claude mcp add tokencost-dev -- npx -y tokencost-dev
Then 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.
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_calling
calculate_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.0105
compare_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 out
refresh_prices
Force re-fetch pricing data from the LiteLLM registry (cache is refreshed automatically every 24h).
Docs
Full documentation at tokencost.dev
License
MIT
tokencost MCP questions
How do I add tokencost MCP to Claude Code?
Run claude mcp add tokencost-dev -- npx -y tokencost-dev in your terminal. Add --scope user to make it available in every project.
How do I add tokencost MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does tokencost MCP provide?
It exposes 2 tools, including gpt-4o-mini, gpt-4o.
Do I need an API key to use tokencost?
No, the server requires no API keys, accounts, or configuration files.