Tokencost MCP Server

MCP server for LLM token pricing data — query, compare, and estimate costs for 60+ AI models from OpenAI, Anthropic, Google, Meta, and more

Local serverstdio

What is the Tokencost MCP server?

If you already use Tokencost, the tokencost mcp server is the piece that lets your assistant work with it directly. MCP server for LLM token pricing data — query, compare, and estimate costs for 60+ AI models from OpenAI, Anthropic, Google, Meta, and more.

What the server does

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

Installation

npm on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • tokencost_get_model_pricing — Get pricing for a specific model
  • tokencost_compare_models — Side-by-side pricing comparison
  • tokencost_estimate_cost — Calculate cost for given token counts
  • tokencost_find_cheapest — Find cheapest models with filters
  • tokencost_list_models — List all available models
  • tokencost_list_providers — List all providers with pricing ranges

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Where it fits

Plenty of AI and media services servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Tokencost's toolset — tokencost_get_model_pricing, tokencost_compare_models, tokencost_estimate_cost and 3 more — is a fair guide to whether it matches your workflow. It is maintained by ankit-aglawe; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
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

How to install the Tokencost MCP server

{
  "mcpServers": {
    "tokencost": {
      "command": "npx",
      "args": ["-y", "tokencost-mcp-server"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use Tokencost to tokencost get model pricing.
  • Use Tokencost to tokencost compare models.
  • Use Tokencost to tokencost estimate cost.

Frequently asked questions

It connects Tokencost to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (tokencost_get_model_pricing, tokencost_compare_models, tokencost_estimate_cost, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Tokencost directly.