mcpField
A
agent-costcenter

agent-costcenter

Local
github.com/mdfifty50-boopData & Analytics0Updated 27w ago

About agent-costcenter

agent-costcenter is an MCP server for attributing AI agent costs and managing budgets across an agent fleet. It combines call logging, model pricing, scoped reports, spending alerts, and anomaly detection.

Key features

  1. 01Track LLM and tool-call costs by agent
  2. 02Built-in pricing for 11 models
  3. 03Set budgets and warn or block on limits
  4. 04Reports by agent, team, or project
  5. 05Detect spending spikes
  6. 06Compare model cost efficiency

Use cases

  1. 01Find the highest-cost agents
  2. 02Monitor budgets across teams and projects
  3. 03Investigate unusual spending increases
  4. 04Compare costs across models

MCP support

Exposes MCP tools for registering agents, recording LLM and tool-call costs, checking budgets, generating reports, detecting anomalies, and comparing models. It also provides summary and pricing resources.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mdfifty50-boop-agent-costcenter": {
"command": "npx",
"args": [
"-y",
"agent-costcenter-mcp"
]
}
}
}
Run commandnpx -y agent-costcenter-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmagent-costcenter-mcp0.1.3

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

agent-costcenter-mcp

MCP server for per-agent cost attribution and budget management. Answer "which agent costs the most?" across your entire AI agent fleet.

Features

  • Per-agent cost tracking — register agents, log LLM and tool calls, get per-agent spend
  • Built-in pricing table — 11 models (Claude, GPT, Gemini, DeepSeek) with fuzzy name matching
  • Budget management — set caps and alerts, check remaining budget, warn or block on overspend
  • Cost reports — breakdown by agent, team, project, or all; includes model-level detail and percentages
  • Anomaly detection — automatically flag agents with 2x+ spending spikes
  • Model comparison — compare cost-per-1K-tokens across all models used

Quick Start

npx agent-costcenter-mcp
Claude Desktop
{
  "mcpServers": {
    "agent-costcenter": {
      "command": "npx",
      "args": ["agent-costcenter-mcp"]
    }
  }
}

Tools

ToolDescription
register_agentRegister agent with team, project, model, and budget cap
log_llm_callLog an LLM call — auto-calculates cost from pricing table
log_tool_callLog a tool/API call cost
get_cost_reportCost breakdown by agent, team, project, or all
set_budget_alertSet spending threshold (warn or block)
check_budgetCheck if agent is within budget
get_cost_anomaliesFind agents with unusual spending spikes
compare_modelsCompare cost efficiency across models

Resources

URIDescription
costcenter://summaryCurrent total spend across all agents
costcenter://pricingBuilt-in model pricing table

Built-in Pricing (per 1M tokens)

ModelInputOutput
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).

Example Workflow

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()

Development

npm install
npm test
npm run dev  # watch mode

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.