model-cost-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
model-cost-mcp
A small MCP server that lets an AI agent answer "which model should I use, and what will it cost?" for image, video, audio and 3D generation, with prices that are exact and errors the agent can recover from.
The catalog is sample data: the models and prices are invented for the demo. It is not affiliated with any provider. Replace src/catalog.ts with a real catalog before relying on the numbers.
Tools
Tool | What it does |
| Lists models with billing unit, price and a "use when" note. Filter by modality or maximum unit price. |
| Exact cost of one job on one model. Handles per-image, per-second and per-run pricing. |
| Ranks every model of one modality, cheapest first, and lists the ones it had to skip, with reasons. |
Related MCP server: CloudCost MCP Server
Design choices
Money is integers. Prices are stored in millionths of a dollar, so there is no floating-point drift. The billed amount rounds the exact cost up to the next whole cent, so any surface that computes from the same inputs shows the same number.
Per-second models bill every started second, and the response says when it rounded.
Errors tell the agent what to do next. An invalid call returns a code, a message, a hint with an example call, and for unknown model ids the closest valid ids. Nothing throws an opaque exception.
Tool descriptions are written for model selection. Each says when to call it and what it needs, and every catalog entry carries a
use_whenline.
Run
npm install
npm test # 9 tests, in-memory MCP client against the real server
npm run typecheck
npm start # stdio serverAdd it to an MCP client such as Claude Desktop:
{
"mcpServers": {
"model-cost": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/model-cost-mcp/src/index.ts"]
}
}
}Example
estimate_cost { "model_id": "demo/video-draft", "quantity": 3, "seconds": 4.2 }
-> 3 clips x 5s = 15 billable seconds, exact $0.750000, billed $0.75
note: "Every started second is billed, so 4.2s is billed as 5s."
estimate_cost { "model_id": "demo/video-cinema", "quantity": 2 }
-> error seconds_required
hint: Call again with seconds, for example {"model_id": "demo/video-cinema", "quantity": 2, "seconds": 5}.Not done yet
The catalog is a hard-coded list, not a live source.
stdio only; no HTTP transport or authentication.
No currency conversion, taxes or volume discounts.
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate images, videos and music with model discovery, cost estimates and asynchronous results.
LLM API prices and AI agent cost estimates, verified daily. Read-only cost lookup tools.
150+ image, video and audio models. Quote before you generate; pay as you go.
Live prices for 111 Chinese models; batch cost calculators for video and images.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides real-time AI model pricing, cost estimation, and budget management tools to help agents understand and optimize their spending. It enables agents to compare costs across multiple providers and select the most cost-effective models for specific tasks.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to parse multi-cloud infrastructure-as-code files, query real-time pricing from AWS, Azure, and GCP, and generate cost estimates and comparison reports.111 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to calculate, compare, and recommend AI API costs from multiple providers, with support for currency conversion and platform fee analysis.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables assistants to access up-to-date LLM pricing, context windows, and model identifiers, with tools to estimate costs, find cheapest models, and check scheduled price changes.30 npmMIT