mcpField
T
Tokencost Mcp Server

Tokencost Mcp Server

Local
github.com/ankit-aglaweAI & Agents2Updated 33w ago

About Tokencost Mcp Server

TokenCost MCP Server provides AI assistants with real-time token pricing for models from multiple providers. Developers and teams can query rates, compare models, and estimate usage costs.

Key features

  1. 01Look up pricing for a model
  2. 02Compare model prices side by side
  3. 03Estimate cost from token counts
  4. 04Find low-cost models with filters
  5. 05List models and providers

Use cases

  1. 01Estimate the cost of a model request
  2. 02Compare model prices across providers
  3. 03Find lower-cost models meeting context needs

MCP support

The MCP server exposes tools to query pricing, compare models, estimate costs, find inexpensive models, and list available models and providers.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"tokencost": {
"command": "npx",
"args": [
"-y",
"tokencost-mcp-server"
]
}
}
}
Run commandnpx -y tokencost-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmtokencost-mcp-server

Tools

6

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
modelstringYesModel ID or name (e.g., 'gpt-5', 'claude-sonnet-4.6')

Details

From the project README

TokenCost MCP Server

An MCP (Model Context Protocol) server that provides real-time LLM token pricing data for 60+ AI models across 15 providers.

Query, compare, and estimate costs for models from OpenAI, Anthropic, Google, Meta, xAI, Mistral, DeepSeek, and more — directly from your AI assistant.

Built by TokenCost — the free LLM token cost calculator.

tokencost-mcp-server MCP server

Tools

ToolDescription
tokencost_get_model_pricingGet pricing for a specific model
tokencost_compare_modelsSide-by-side pricing comparison
tokencost_estimate_costCalculate cost for given token counts
tokencost_find_cheapestFind cheapest models with filters
tokencost_list_modelsList all available models
tokencost_list_providersList all providers with pricing ranges

Quick Start

Claude Desktop / Cursor / Windsurf

Add to your MCP config:

{
  "mcpServers": {
    "tokencost": {
      "command": "npx",
      "args": ["-y", "tokencost-mcp-server"]
    }
  }
}
From Source
git clone https://github.com/ankit-aglawe/tokencost-mcp-server
cd tokencost-mcp-server
npm install
npm run build
npm start

Example Usage

"How much would it cost to process 1M input tokens with GPT-5?"

→ Uses tokencost_estimate_cost with model="gpt-5", input_tokens=1000000, output_tokens=0

"Compare Claude Sonnet 4.6 vs GPT-5 vs Gemini 3 Pro pricing"

→ Uses tokencost_compare_models with ["claude-sonnet-4.6", "gpt-5", "gemini-3-pro"]

"What's the cheapest model with at least 200K context?"

→ Uses tokencost_find_cheapest with min_context=200000

Supported Providers

OpenAI, Anthropic, Google, xAI, Meta, Mistral, DeepSeek, Alibaba (Qwen), Amazon (Nova), NVIDIA, Cohere, Perplexity, Moonshot (Kimi), Zhipu (GLM), MiniMax

Pricing Data

Pricing is kept accurate and up to date by the TokenCost team. We track official provider announcements and update pricing as soon as changes are published — new models, price cuts, and deprecations are reflected within days.

If you notice outdated pricing or a missing model, open an issue and we'll get it updated.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.