Tokencost Dev logo

Tokencost Dev

Looks up LiteLLM model pricing, estimates token costs, compares models, and refreshes cached pricing through MCP.

Install Tokencost Dev

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "tokencost-dev": {
      "command": "npx",
      "args": [
        "-y",
        "tokencost-dev"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 4 tools correctly (3d ago).

Overview

The tokencost-dev MCP server gives AI assistants access to model pricing, metadata, cost estimates, and model comparisons. It retrieves pricing from the LiteLLM community registry and stores it locally, refreshing the cache automatically every 24 hours. Its tools support fuzzy model-name matching, token-based estimates, requirement-based comparisons, and manual price refreshes. Reach for it when an agent needs current model costs or context and capability details without an API key.

Use cases

  • Estimate the cost of a planned input and output token volume
  • Compare models by provider, mode, context, and pricing
  • Look up model capabilities and context-window limits
  • Refresh cached pricing before making a cost decision

Key features

  • Fuzzy model-name lookup
  • Input and output token cost estimation
  • Cost-oriented model comparison
  • Pricing, context, and capability metadata
  • LiteLLM registry refresh with 24-hour caching

Tools4

What Tokencost Dev lets your agent do. Expand a tool for its parameters.

Verified live~418 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

10/10 checks healthy over the last 47d

What it can do

From the 4 tools this server returned when we ran it.

Handles credentials · 1Makes network requests · 1Read-only tools · 4
Network at startup4 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age242 days
Maintainers1

Observed 2026-10-21 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 15d ago via OSV.dev · tokencost-dev (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads245Package downloads in the last 30 days.
Last commit3d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed4Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Tokencost Dev works

What tokencost-dev MCP server does

The tokencost-dev MCP server exposes model economics and metadata as tools that an MCP-compatible assistant can call. It connects to the LiteLLM community registry for pricing data and provides information such as input and output rates, context-window limits, and supported capabilities.

The main lookup tool accepts flexible model names. An assistant can request details using a shortened name such as sonnet 4.5 instead of a full provider model identifier. Returned details can include the provider, operating mode, pricing per million tokens, maximum input and output sizes, and capabilities such as vision or function calling.

How it works

At startup and during normal use, pricing data is obtained from the LiteLLM registry and cached locally. The cache is refreshed automatically every 24 hours. A separate refresh tool lets an assistant request a new fetch instead of waiting for the automatic update interval.

Cost calculations use the selected model’s input and output rates together with the token counts supplied by the user or agent. The result separates input cost, output cost, and the combined estimate. Model comparisons can filter candidates by requirements such as provider or mode and return cost-oriented results with pricing and context information.

Setup and configuration

The tokencost-dev MCP server runs through npx, so a client can launch it without a separate service or configuration file. Claude Code can register it with:

Terminal
claude mcp add tokencost-dev -- npx -y tokencost-dev

For Cursor, add a server entry to .cursor/mcp.json:

config.json
{
  "mcpServers": {
    "tokencost-dev": {
      "command": "npx",
      "args": ["-y", "tokencost-dev"]
    }
  }
}

No API key, account, or environment variable is required according to the project documentation. The server uses the LiteLLM registry as its pricing source and maintains its own local cache.

Tools and capabilities

The tokencost-dev MCP server provides four tools:

  • get_model_details looks up a model’s pricing, context window, provider, mode, and capabilities. Fuzzy matching supports both abbreviated and complete model names.
  • calculate_estimate computes the expected cost for specified input and output token counts.
  • compare_models identifies cost-effective models that match supplied requirements, including provider and mode filters.
  • refresh_prices forces a new pricing-data fetch from LiteLLM.

These tools suit assistants that answer pricing questions, estimate usage for a proposed prompt and response size, or compare available models before choosing one.

Limitations and notes

Pricing is sourced from the LiteLLM community registry rather than from a provider-specific billing API. The displayed values therefore depend on the registry data available to the server. Cached data can remain in use for up to the automatic 24-hour refresh interval unless refresh_prices is called.

The documentation describes pricing and metadata lookup, token-based estimation, and model comparison. It does not describe making model requests, tracking an account’s actual usage, or calculating a provider invoice. Estimates should therefore be treated as token-price calculations based on the selected registry entry.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Tokencost Dev

tokencost-dev is an MCP server that connects AI assistants to the LiteLLM community pricing registry and provides model lookup, token-cost estimation, model comparison, and price-refresh tools. It uses locally cached pricing, refreshed automatically every 24 hours, and requires no API key, account, or configuration file.

Install it by registering an `npx` command with your MCP client. In Claude Code, run `claude mcp add tokencost-dev -- npx -y tokencost-dev`; Cursor users can add the same command and package name to `.cursor/mcp.json`.

Yes, tokencost-dev works with Cursor through a `.cursor/mcp.json` entry. Configure the server with `command` set to `npx` and arguments `[-y, "tokencost-dev"]`.

No, tokencost-dev does not require an API key, account, or configuration file. It fetches pricing from the LiteLLM community registry and caches the data locally.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTokencost Dev AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/tokencost-dev?style=directory)](https://allmcps.com/mcp/tokencost-dev)
HTML Embed
<a href="https://allmcps.com/mcp/tokencost-dev"><img src="https://allmcps.com/api/badge/tokencost-dev?style=directory" alt="Tokencost Dev on AllMCPs" /></a>