Repository avatar
AI Tools
v0.1.1
active

aicostdesk-mcp

io.github.phappyj/aicostdesk-mcp

LLM API prices checked against vendor pages, monthly cost math and subscription break-even.

Documentation

aicostdesk-mcp

An MCP server for what AI actually costs: LLM API prices, monthly bills, and the break-even between a $20 subscription and pay-per-token.

It answers three questions inside Claude Desktop, Cursor, Claude Code or any MCP client:

  • "What do the current LLM APIs cost per million tokens?"
  • "What would 3,000 requests a day at 1,500 in / 500 out cost me per month, and which model is cheaper?"
  • "I send 60 messages a day — is ChatGPT Plus at $20 or paying for the API the better deal?"

Every figure comes from AI Cost Desk: 20 LLM API models from OpenAI, Anthropic, Google, DeepSeek and xAI, each rate read from the provider's own pricing page and dated. The JSON this server reads is the same file the site's calculators use, so a desk number and a server number cannot disagree.

Try it without installing

Listed on Glama: phappyj/aicostdesk-mcp — where you can browse the four tools, read each schema and its quality score, and test the server online with MCP Inspector before adding it to a client.

Tools

ToolWhat it doesMain inputs
list_llm_modelsLists the 20 models with input, cached-input and output price per 1M tokens, the day each was checked, and scheduled price changes.provider, tier, sort, limit
calculate_api_costMonthly and yearly bill for a workload on one model, per-request cost, and the cheapest alternatives for the same tokens.model, input_tokens, output_tokens, requests_per_day, days_per_month, cache_hit_rate
compare_subscription_vs_apiA flat plan (ChatGPT Plus, Claude Pro, Cursor, …) versus metered API at a daily message volume, with the break-even volume.plan or monthly_price, model, messages_per_day, input_tokens, output_tokens
compare_two_modelsTwo models on the same workload, side by side, with the monthly difference.model_a, model_b, input_tokens, output_tokens, requests_per_day

Results are Markdown: a short table or a few labelled numbers, the date the prices were checked, and the page on aicostdesk.com that shows the same calculation.

Install

Claude Desktop — add this to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json), then restart Claude:

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

Until the package is on the npm registry, run it straight from GitHub with "args": ["-y", "github:phappyj/aicostdesk-mcp"]. Both forms need Node 18.17+.

Cursor — the same block in ~/.cursor/mcp.json (or Settings → MCP → Add new MCP server, type command):

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

Claude Code

claude mcp add aicostdesk -- npx -y aicostdesk-mcp

From a local clone (development, or no npx)

git clone https://github.com/phappyj/aicostdesk-mcp.git
cd aicostdesk-mcp
npm install
node bin/aicostdesk-mcp.js
{
  "mcpServers": {
    "aicostdesk": {
      "command": "node",
      "args": ["/absolute/path/to/aicostdesk-mcp/bin/aicostdesk-mcp.js"]
    }
  }
}

Example

You: I'm building a support bot. 2,000 conversations a day, about 4,000 input and 800 output tokens each. What does Gemini 4 Carbon cost me, and is something cheaper?

Claude (after calculate_api_cost): At 2,000 requests/day × 4,000 in + 800 out, Gemini 4 Carbon is $1,920/month ($23,040/year), $0.032 per conversation. The cheapest models for the same tokens are GPT-6 Luna and Claude Haiku 5.5 at $48/month (98% less) — cost only, not quality: both are budget tier against a flagship. Prices checked 2026-12-01 (aicostdesk.com/llm-api-calculator).

Where the numbers come from

  • Source: phappyj/llm-pricing-json pricing.json (MIT), the machine-readable copy of the table behind aicostdesk.com — the same file the site's three calculators render from.
  • On start the server fetches that file once (3 s timeout), keeps it in memory for the process, and writes a copy to the OS temp directory. If the network is down it uses that copy (up to 7 days), and if there is none it uses the snapshot bundled in the package, so a tool call never fails for lack of a connection.
  • Each model carries lastChecked — the day its provider's page was actually read. Every answer prints it. Quoting a price without the date is the one thing this server will not do.
  • The arithmetic is the site's published formula: cost = requests × (input × input_rate + cached_input × cached_rate + output × output_rate) ÷ 1,000,000.
  • Prices are USD list prices, standard tier. Not included: long-context surcharges (several vendors double the rate above 200K tokens — the threshold is in each model's note), batch and off-peak discounts, committed-use pricing, regional resale (Bedrock, Vertex), taxes. Cost says nothing about quality, latency, context limits or rate limits, and the tools say so in their output.
  • The server sends nothing about you anywhere; the only network request is the price file, and AICOSTDESK_MCP_OFFLINE=1 turns even that off.

Configuration

VariableDefaultPurpose
AICOSTDESK_MCP_OFFLINEunset1 = never fetch; use the bundled snapshot
AICOSTDESK_MCP_PRICING_URLhttps://raw.githubusercontent.com/phappyj/llm-pricing-json/main/pricing.jsonPoint at another copy of the price JSON

Development

npm install
npm test          # 32 tests: raw JSON-RPC over stdio, cost maths, fallback chain
npm run test:live # the official SDK client against the live price feed
npm run sync-snapshot  # refresh data/pricing.json from the live feed

The test suite speaks the protocol itself — it spawns bin/aicostdesk-mcp.js and sends initialize, tools/list and tools/call as newline-delimited JSON-RPC, so a regression in framing or schemas fails the build without an SDK in the loop.

License

MIT. Data is collected from public vendor pricing pages; the vendors own their pricing. Not affiliated with OpenAI, Anthropic, Google, DeepSeek, xAI, Cursor or GitHub.

NPM
aicostdesk-mcp
Install Command
npm install aicostdesk-mcp
Runtime: npx