If you're running multiple AI agents and need to understand where your API costs are going, this server gives you a cost center for your fleet. It tracks spend per agent, team, or project by logging LLM and tool calls against a built-in pricing table covering Claude, GPT, Gemini, and DeepSeek models. You can set budget caps with warn or block thresholds, pull cost breakdowns showing model-level detail and percentages, and surface anomalies when an agent's spending spikes above 2x normal. The fuzzy model name matching means you don't need exact strings, and the compare_models tool shows you cost per 1K tokens across everything you're using. Useful when you need attribution and guardrails across a multi-agent system.
MCP server for per-agent cost attribution and budget management. Answer "which agent costs the most?" across your entire AI agent fleet.
npx agent-costcenter-mcp
{
"mcpServers": {
"agent-costcenter": {
"command": "npx",
"args": ["agent-costcenter-mcp"]
}
}
}
| Tool | Description |
|---|---|
register_agent | Register agent with team, project, model, and budget cap |
log_llm_call | Log an LLM call — auto-calculates cost from pricing table |
log_tool_call | Log a tool/API call cost |
get_cost_report | Cost breakdown by agent, team, project, or all |
set_budget_alert | Set spending threshold (warn or block) |
check_budget | Check if agent is within budget |
get_cost_anomalies | Find agents with unusual spending spikes |
compare_models | Compare cost efficiency across models |
| URI | Description |
|---|---|
costcenter://summary | Current total spend across all agents |
costcenter://pricing | Built-in model pricing table |
| Model | Input | Output |
|---|---|---|
| claude-opus-4 | $15.00 | $75.00 |
| claude-sonnet-4 | $3.00 | $15.00 |
| claude-haiku-4 | $0.80 | $4.00 |
| gpt-4o | $2.50 | $10.00 |
| gpt-4o-mini | $0.15 | $0.60 |
| gpt-4.1 | $2.00 | $8.00 |
| gpt-4.1-mini | $0.40 | $1.60 |
| gemini-2.5-pro | $1.25 | $10.00 |
| gemini-2.5-flash | $0.15 | $0.60 |
| deepseek-v3 | $0.27 | $1.10 |
| deepseek-r1 | $0.55 | $2.19 |
Model names are fuzzy-matched (case-insensitive, strips version suffixes).
1. register_agent(agent_id="researcher", team="discovery", model="claude-sonnet-4", budget_cap_usd=10)
2. log_llm_call(agent_id="researcher", model="claude-sonnet-4", input_tokens=5000, output_tokens=2000)
3. log_tool_call(agent_id="researcher", tool_name="web_search", duration_ms=1200, cost_usd=0.01)
4. check_budget(agent_id="researcher")
5. get_cost_report(scope="all")
6. get_cost_anomalies()
7. compare_models()
npm install
npm test
npm run dev # watch mode
MIT
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent