Connect Claude Desktop, VS Code, Cursor, Perplexity — or any MCP-compatible client — to the LLM Pricing server in under 2 minutes.
POST https://llm-pricing-api.fly.dev/mcp
npx -y llm-pricing-mcp
v1.1.0 · npmjs.com · MCP Registry io.github.skakumanu/llm-pricing-mcp-server
https://llm-pricing-api.fly.dev/mcp.Use the url field — no command or local path needed.
The 18 pricing and routing tools need no key. The four alert and conversation management tools marked operator only list or delete every subscriber's and visitor's data, so they need the server operator's key (MCP_API_KEY); anyone else gets operator_key_required. The 7 usage and budget tools marked needs key below read or write your org's data, so they need your service API key (free at /billing, POST /billing/signup) sent on the MCP connection as x-api-key or Authorization: Bearer. They then act only on that key's org: org_id defaults to it, and another org's is refused (org_mismatch). Without a key they return customer_key_required. The dispatch tool also needs your service key, plus at least one provider key stored for your org (POST /dispatch/keys): it makes a real model call billed to those keys; without a customer key it returns dispatch_requires_api_key. The support_chat tool works without a key (general answers) and, with your service key, can describe your own plan, payment status and rate limit; it is the one tool that is identity-aware rather than key-gated.
Claude Code CLI:
After saving the config, restart VS Code / Cursor. The 32 tools will appear automatically. (Claude Desktop adds remote servers under Settings → Connectors instead — see its tab.)
Try: "What is the cheapest model for RAG under $2/1M tokens?"
llm-pricing-mcp npm package is a zero-dependency bridge: it reads MCP requests on stdin and forwards them to the hosted server. Nothing to clone, no Python, no local pricing data to keep fresh. Needs Node 22.23.4+, 24.22.1+ or 26.12.1+ (the builds with the October 2026 security fixes).npx -y fetches the package on first run and caches it; nothing else to install.
All settings are optional; the defaults work out of the box. LLM_PRICING_API_KEY (bridge v1.1.0+) is forwarded as the x-api-key header and never logged; only the 7 usage and budget tools and dispatch need it. If you use dispatch (a real model call with failover), raise the timeout to LLM_PRICING_MCP_TIMEOUT_MS=120000.
In the client config, add "env": { "LLM_PRICING_API_KEY": "<your-service-key>" } next to "args".
The 32 tools appear automatically. Package: npmjs.com/package/llm-pricing-mcp (MIT), listed in the MCP Registry as io.github.skakumanu/llm-pricing-mcp-server.
https://llm-pricing-api.fly.dev/mcp. Claude Desktop does not read a url entry from claude_desktop_config.json; that file only launches local commands. A connector carries no custom headers, so for the 7 usage/budget tools and dispatch use Option B with LLM_PRICING_API_KEY set. Option B (no Python): the npx tab — npx -y llm-pricing-mcp bridges STDIO to the hosted server. Option C below runs a local Python server — works offline.claude_desktop_config.jsonTools appear in Claude's tool list. You'll see a hammer icon when the MCP server is active.
servers config; Cline / Continue use a mcpServers config in their own settings UI.Command Palette (Ctrl+Shift+P) → MCP: Open User Configuration for all workspaces, or create .vscode/mcp.json in this workspace for a project-only server.
Copilot's native MCP config uses a servers key with an explicit type, not the mcpServers shape other clients use:
Optional, for the 7 usage and budget tools: add "headers": { "x-api-key": "<your-service-key>" } next to "url". The pricing tools need no key.
Open the Copilot Chat panel, switch to Agent mode, then click the tools icon and enable llm-pricing. All 32 tools become available to the agent.
In Cline: Settings (⚙) → MCP Servers → Edit JSON. In Continue: open your MCP server config (mcpServers section of Continue's settings).
Open the command palette (Ctrl+Shift+P) → Cline: Reload MCP Servers (or restart VS Code for Continue). Tools will appear in the agent panel.
Optional, for the 7 usage and budget tools: add "headers": { "x-api-key": "<your-service-key>" } next to "url". The pricing tools need no key.
Go to Settings → Features → MCP to confirm the server shows as connected.
After saving, restart the desktop app. All 32 pricing tools will be available in your conversations.
Ask: "What LLM pricing tools do you have available?" — Perplexity should list all 32 tools.
All 32 tools are accessible via MCP. Purple = required arg · Grey = optional · needs key = send your service key on the connection (how); these act only on your own org. import_session_usage needs the key too, and dispatch spends on your own stored provider keys.
client to flag which ones your tool can run.client, only models your tool can run are used.client and it only names models your tool can run.alert_token — save it, it is shown only once.alert_token from register_price_alert. No key needed; the token is the credential.POST /dispatch/keys; spend is recorded against your org. Hosted /mcp or the npx bridge only (with the bridge, set LLM_PRICING_MCP_TIMEOUT_MS=120000).recommend_model, optimize_workload and compare_costs take a client argument so the answer only names models your tool can run. Recognised clients: Claude Code, Claude Desktop / claude.ai, Cursor, GitHub Copilot, Windsurf, Cline, Continue, Zed, JetBrains AI, Gemini CLI, Codex CLI, Aider, Amazon Q Developer and ChatGPT desktop (ids claude_code, claude_desktop, cursor, github_copilot, windsurf, cline, continue, zed, jetbrains_ai, gemini_cli, codex_cli, aider, amazon_q, chatgpt_desktop); names are case- and separator-insensitive.
A recognised client restricts the candidates before ranking (it is not just a boost); compare_costs still prices every model you name and flags each runnable_in_client. Override order: explicit client > legacy ide_context (deprecated alias) > the client inferred from the MCP handshake > none. On the hosted server, initialize returns an Mcp-Session-Id header; a client that echoes it is inferred from its clientInfo.name (best effort, in memory, lost on a server restart). Unknown or missing client: unfiltered result plus a note. Every response carries applied_client, client_source, client_as_of and client_note.
Click any prompt to copy it.
| Problem | Fix |
|---|---|
| Tools not showing after restart | Check the config file path and JSON syntax. Use a JSON validator if unsure. Ensure no trailing commas. |
| STDIO server hangs with no output | Expected — the STDIO server waits for JSON-RPC input on stdin. It is not a web server; use it only with a MCP client. |
ModuleNotFoundError (local STDIO) | Activate the virtualenv (source .venv/bin/activate) and run from the repo root directory. |
Model not found error | Call get_all_pricing first to get valid model names — they are case-sensitive. |
| Connection refused / timeout | Run curl https://llm-pricing-api.fly.dev/health to verify the server is up. If using local STDIO, ensure the server process is running. |
401 Unauthorized on MCP endpoint | The /mcp endpoint itself never returns 401 — no key is needed to connect or to use the pricing tools. If you see 401, check for a proxy or misconfigured auth header in your client. |
customer_key_required from a usage or budget tool | The 7 usage and budget tools need your service API key on the MCP connection: x-api-key or Authorization: Bearer header, or LLM_PRICING_API_KEY for the npx bridge. Get a free key at /billing. The local STDIO server and the chat agent are always anonymous, so these tools refuse there. |
operator_key_required | list_price_alerts, delete_price_alert, list_conversations and delete_conversation are restricted to the server operator: they need MCP_API_KEY on the connection. A service key from /billing does not unlock them. To view or delete a price alert you registered yourself, use manage_price_alert with the alert_token returned at registration (alerts registered before v1.81.0 have no token and are removed via the operator). |
413 Request body too large | POST /mcp bodies are capped at 1,000,000 bytes. Split a large import_session_usage batch across several calls with the same session_id — imports are idempotent. |
invalid_webhook_url | register_price_alert and register_budget_alert only accept a public https webhook URL. Plain http, private, loopback, link-local, cloud-metadata or internal hosts (including hostnames that resolve to one) and hosts that do not resolve are refused, and nothing is stored. The reason field names the category. Redirects from your endpoint are never followed. Alerts registered before v1.80.1 that break these rules are kept but are not delivered. |
invalid_alert_token | manage_price_alert found no alert for that alert_token. The response is the same whether the token is mistyped, already used to delete its alert, or never existed. Tokens are shown only once and cannot be recovered or re-issued; if you lost yours, register a new alert (alerts registered before v1.81.0 have no token and are removed via the operator). |
org_mismatch | A service key only acts on its own org. Omit org_id (it defaults to your key's org) or pass your own. |