{
  "markdown": "<div align=\"center\">\n\n![llm-cost: token cost math for LLM API calls](https://raw.githubusercontent.com/comparedge/llm-cost-mcp/main/assets/banner.svg)\n\n![models](https://img.shields.io/badge/models-69-d97706?style=for-the-badge) ![providers](https://img.shields.io/badge/providers-17-d97706?style=for-the-badge) ![dependencies](https://img.shields.io/badge/deps-0-2ea043?style=for-the-badge) ![license](https://img.shields.io/badge/MIT-2ea043?style=for-the-badge)\n\n</div>\n\nSomeone asks what the AI feature will cost at scale, and the honest answer around most teams is a shrug. Rates moved twice since anyone last checked, and the model itself will happily quote prices from its training data. This MCP server keeps current per-million-token rates for 69 models where your assistant can reach them, and does the arithmetic itself.\n\n## Watch it work\n\n```\n$ You: price Claude Opus 4.8 on a 25k-token prompt with a 1k answer, run 5,000 times\n\n  llm-cost › estimate_cost\n\n  Cost estimate: Claude Opus 4.8 (Anthropic)\n  Rates: input $5/1M, output $25/1M, cached input $0.5/1M\n\n  Per call (25,000 in + 1,000 out tokens):\n    input:  $0.1250\n    output: $0.0250\n    per call total: $0.1500\n\n  Across 5,000 calls: $750.00\n\n  Ways to pay less for the same 5,000 calls:\n    with cached input:  $187.50\n    via batch API:      $375.00\n```\n\nNothing here is rounded or guessed. The rate is verified, date-stamped, and the server multiplied.\n\n<details>\n<summary><b>Open a second session: same call across four models, ranked</b></summary>\n\n```\n$ You: compare that call on Opus 4.8, Sonnet 5, GPT-5.6 Terra and Gemini 3.1 Pro\n\n  llm-cost › compare_models_cost\n\n  25,000 in + 1,000 out, cheapest first:\n\n  1. Claude Sonnet 5      $0.0600 /call    $300.00 /5k\n  2. Gemini 3.1 Pro       $0.0620 /call    $310.00 /5k\n  3. GPT-5.6 Terra        $0.0775 /call    $387.50 /5k\n  4. Claude Opus 4.8      $0.1500 /call    $750.00 /5k\n\n  Ranking uses each model's live feed entry, not remembered prices.\n```\n\n</details>\n\n## The gap it closes\n\n| An assistant on its own | An assistant with llm-cost |\n|---|---|\n| quotes output rates from training data, often a generation stale | reads the current rate, dated |\n| flattens the estimate to \"a few cents\" | `$0.1500` per call, `$750.00` across 5,000 |\n| never mentions batch or caching discounts | `$375.00` batch, `$187.50` cached, only where the model really offers them |\n| confidently wrong, no way to tell | every figure traces to a feed entry with a verification date |\n\nThe same numbers answer in a browser through the [LLM calculator](https://comparedge.com/llm-calculator), and the [LLM category hub](https://comparedge.com/best/llm) ranks every tracked model by rating and price.\n\n## Where the numbers travel\n\n```mermaid\nflowchart LR\n    V[\"provider pricing pages<br/>17 providers\"] --> CE[\"verification<br/>date-stamped checks\"]\n    CE --> F[\"model prices feed<br/>69 models, USD per 1M tokens\"]\n    F -->|\"6h cache, serve stale on failure\"| MCP[\"llm-cost server<br/>local arithmetic\"]\n    MCP --> A[\"your agent\"]\n```\n\nThe server never calls a provider API. It reads one public feed, [`llms-model-prices.json`](https://comparedge.com/llms-model-prices.json), and computes locally. Nothing to rate-limit, no key to leak, and a network hiccup serves the last good copy instead of an error. How each price gets checked is written up in the [methodology](https://comparedge.com/methodology), and the catalog behind it ships as an [open dataset](https://comparedge.com/open-data) under CC BY 4.0.\n\n## The six tools\n\nFour do the math. Two help you find the exact model id the math wants.\n\n| Tool | Answers | Params |\n|---|---|---|\n| `estimate_cost` | one call, or N identical calls, in dollars | `model`, `input_tokens`, `output_tokens`, `calls?` |\n| `compare_models_cost` | the same call priced across 2 to 6 models | `models[]`, `input_tokens`, `output_tokens` |\n| `monthly_budget` | daily, monthly, yearly spend for a workload | `model`, `daily_calls`, `avg_input_tokens`, `avg_output_tokens` |\n| `cheapest_models` | lowest-cost models, optional context floor | `min_context?`, `limit?` |\n| `list_models` | every model with rates, context and tier | `provider?` |\n| `list_providers` | providers with model counts and cheapest pick | none |\n\n<details>\n<summary><b>Token rules of thumb, for when nobody knows the counts</b></summary>\n\n- A page of English prose is roughly 500 tokens; one token is about four characters.\n- Model references are forgiving: `claude-opus-4-8`, `Opus 4.8` and `anthropic/opus` resolve to the same model. When the resolver is unsure, it returns candidates instead of guessing.\n- `cheapest_models` ranks by a blended rate weighting input to output 3 to 1, because real workloads read far more than they write. Confirm the winner with `estimate_cost` on your actual split.\n\n</details>\n\n## Prompts\n\n| Prompt | Args | Runs |\n|---|---|---|\n| `estimate_my_workflow` | `workflow`, `model?` | token estimates plus per-run and monthly cost for a described workflow |\n| `pick_cheapest_model` | `task` | cheapest model that still meets the requirement, top candidates priced |\n| `forecast_ai_budget` | `model`, `usage` | monthly and yearly bill projected from expected volume |\n\n## Wire it up\n\n```json\n{\n  \"mcpServers\": {\n    \"llm-cost\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@comparedge/llm-cost-mcp@latest\"]\n    }\n  }\n}\n```\n\nClaude Desktop keeps this file at `~/Library/Application Support/Claude/claude_desktop_config.json`. Cursor: Settings, then MCP. VS Code with Copilot reads `.vscode/mcp.json`. Restart the client; six tools appear. No API key, no account. Per-client walkthroughs live in the [setup guide](https://comparedge.com/mcp/docs).\n\n## Family\n\nBuilt by [ComparEdge](https://comparedge.com), where software prices are checked against vendor pages before anyone quotes them. Two siblings share the data: the full catalog server and a price-change watcher, both on [ComparEdge MCP](https://comparedge.com/mcp).\n\nMIT licensed. JSON-RPC 2.0 over stdio, standard Model Context Protocol.\n",
  "bytes": 6050,
  "sha": "f6505a46fc7b9f63f64f5d105ddf11f2f6071c3a044b9c9fee6c7647331b2507",
  "repo_slug": "comparedge/llm-cost-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_imkemit_ops_comparedge_llm_cos_5e247e7f/readme"
}