tokenomics
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tokenomicssearch cheapest model with 128k context"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
💸 tokenomics
Fresh, live LLM pricing for AI agents — as a CLI and an MCP server.
No scraping. No database. No API keys. Every call returns current pricing for thousands of models across 140+ providers, straight from the models.dev catalog and normalized to USD per 1M tokens.
Why
LLMs in agents need to reason about cost — which model is cheapest for this job, what will this prompt cost, is the cheaper model worth it? — but pricing data goes stale the moment you hardcode it. tokenomics gives an agent a single, always-fresh source of truth and does the per-million math so the agent never fumbles a 1K vs 1M conversion.
It's built the way Anthropic recommends agent tools should be built: a small set of deep, workflow-level tools (not a CRUD wrapper), JSON-by-default output, runtime schema introspection, input hardening, and field masks to keep responses small.
Related MCP server: or-info
Features
🔴 Always live | Fetches models.dev on every call — data is fresh by construction. No DB to go stale. |
🔌 Two surfaces, one core | The same engine powers an agent-friendly CLI and an MCP server. Identical behavior. |
🧮 Does the math |
|
🤖 Agent-first | JSON when piped, field masks, NDJSON, machine-readable errors, schema introspection. |
🧰 MCP best-practices | Rich server instructions, structured tool descriptions, graceful timeouts, soft "not found". |
🛡️ Hardened input | Rejects control chars, path traversal, and embedded query params at the boundary. |
⚡ Typed & tested | Built on Effect with tagged errors; Prettier + oxlint + unit tests. |
Quickstart
One-command install (clone, build, and put tokenomics + tokenomics-mcp on your PATH):
git clone https://github.com/tylergibbs1/tokenomics.git && cd tokenomics && npm install && npm run build && npm linkgit clone https://github.com/tylergibbs1/tokenomics.git
cd tokenomics
npm install
npm run build
npm link # optional: puts the binaries on your PATHRequires Node 20+. No API key needed — the models.dev catalog is public.
CLI
Output is JSON when piped (agent-friendly) and a table at a terminal. Override with -o json|ndjson|table.
# 🔎 Search + filter, and trim the response with a field mask
tokenomics search "claude" --max-input 5 --min-context 200000 \
--fields model_id,pricing,context_window
# 📄 One model's full pricing + provenance
tokenomics get openai/gpt-4o
# 🧮 Cost of a workload (raw token counts) × N requests
tokenomics estimate openai/gpt-4o --input-tokens 1000000 --output-tokens 200000 --requests 10
# ⚖️ Rank candidates by total cost for the same workload (cheapest first)
tokenomics compare --models openai/gpt-4o,google/gemini-2.5-flash \
--input-tokens 1000000 --output-tokens 500000
# 🏷️ Providers present in the live data, with counts
tokenomics providers
# 📐 Runtime schema introspection — the CLI documents itself
tokenomics schema estimate{
"provider": "openai",
"model_id": "openai/gpt-4o",
"display_name": "GPT-4o",
"modality": "multimodal",
"pricing": {
"input_per_mtok": 2.5,
"output_per_mtok": 10,
"cached_input_per_mtok": 1.25,
"cache_write_per_mtok": null
},
"context_window": 128000,
"max_output_tokens": 16384,
"unit": "USD per 1M tokens",
"currency": "USD",
"source_url": "https://models.dev",
"fetched_at": "2026-06-25T16:00:21.174Z",
"source": "models.dev"
}Errors are machine-readable on stderr with a stable code, an actionable suggestion, and a non-zero exit:
{
"error": true,
"code": "MODEL_NOT_FOUND",
"message": "No model matching 'gtp-4o'.",
"suggestion": "Use 'tokenomics search' to list available models.",
"details": { "suggestions": [] }
}MCP server
Four read-only, workflow-level tools — each bundles the live fetch, model matching, and cost math so an agent needs one call, not three.
Tool | Use it for |
| Discover / shortlist models by price, modality, or context window |
| One known model's full pricing (a miss returns candidates, not an error) |
| The USD cost of a workload on a single model |
| Rank candidate models by total cost for the same workload |
Add to Claude Code
claude mcp add tokenomics -- node /absolute/path/to/tokenomics/dist/bin/tokenomics-mcp.jsAdd to Claude Desktop
// claude_desktop_config.json
{
"mcpServers": {
"tokenomics": {
"command": "node",
"args": ["/absolute/path/to/tokenomics/dist/bin/tokenomics-mcp.js"],
},
},
}The server ships rich instructions (purpose, the units convention, when to use which tool) that clients surface to the model automatically.
Units (the one thing to remember)
Every price is USD per 1,000,000 tokens.
2.5means $2.50 per 1M tokens.estimate/comparetake raw token counts (e.g.1000000), not millions.output_per_mtok: null⇒ non-generative model (embeddings/rerankers); output tokens cost $0.Model ids are
provider/model, whereprovideris the serving provider, e.g.openai/gpt-4o,anthropic/claude-sonnet-4-5. The same model is often served by several providers at different prices — compare across them by id.
How it works
flowchart LR
MD[models.dev<br/>/api.json] -->|live fetch + timeout| MAP[map → ModelPricing<br/>USD per 1M tokens]
MAP --> Q{query}
Q --> S[search]
Q --> G[get]
Q --> E[estimate]
Q --> C[compare]
S & G & E & C --> CLI[CLI]
S & G & E & C --> MCP[MCP server]A single ModelsDev Effect service fetches and normalizes the catalog — flattening every provider's models into one list of (provider, model) records — cached in-process for TOKENOMICS_CACHE_TTL_SECONDS (default 60s). Both the CLI and the MCP server call one shared operations layer, so they behave identically and share typed, tagged errors.
Configuration
All optional — sensible defaults work out of the box.
Variable | Default | Description |
|
| Source endpoint (override to proxy) |
|
| In-process reuse window; |
|
| Hard timeout so a hung network fails fast |
|
|
|
Development
npm run dev:cli -- search "gpt" # run the CLI from source (tsx)
npm run dev:mcp # run the MCP server from source
npm run check # prettier --check + oxlint + tsc --noEmit
npm test # unit tests for the pricing mathRoadmap
Additional pricing sources (direct provider pages) as sibling Effect services, merged transparently
Token counting from raw text/files so
estimatecan price an actual promptFilter/surface model metadata from models.dev (reasoning, tool-calling, attachments)
Publish to npm +
.mcpbbundle for one-click Desktop install
License
MIT © Tyler Gibbs
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides access to 400+ AI models from OpenRouter, enabling users to chat with models like GPT-4, Claude, Gemini, and Llama, compare responses across multiple models, and retrieve model information with pricing details.Last updated44713MIT
- Alicense-qualityAmaintenanceEnables AI agents to query OpenRouter model information including prices, ELO rankings, context, and perform comparisons.Last updated961MIT
- Alicense-qualityAmaintenanceEnables LLMs to query Azure service pricing via the public Azure Retail Prices API, with tools for searching prices, estimating costs, comparing regions, and listing services.Last updatedMIT
Related MCP Connectors
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Live status, API pricing and rate limits for ChatGPT, Claude, Gemini, Cursor and 42+ AI tools.
Live & historical FX rates and currency conversion for AI agents. No API keys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tylergibbs1/tokenomics'
If you have feedback or need assistance with the MCP directory API, please join our Discord server