Agent Costcenter

io.github.mdfifty50-boop由 GitHub 账号 mdfifty50-boop 发布v0.1.3更新于 Oct 24, 2026

Multi-agent billing and cost allocation tracking

概览

AI 生成的概览

本地 MCP 服务器,用于跟踪多个 AI 智能体的 LLM 与工具花费、预算、成本报告和异常。

可以做什么
注册智能体,记录团队、项目、模型和预算上限,并记录 LLM 或工具调用,依据内置的 11 个模型价格表自动计算成本,支持模糊匹配模型名。设置预算告警(警告或阻止),并检查智能体是否在预算内。按智能体、团队、项目或全部生成成本报告,包含模型级明细和百分比。检测花费出现 2 倍及以上激增的智能体,并比较各模型每 1K token 的成本。提供汇总和价格资源,用于查看当前总花费和价格表。
适用场景
适合同时运行多个 AI 智能体、需要知道哪个最贵、把花费归因到团队或项目、执行预算上限或发现异常花费激增的场景。更适合本地桌面端的成本跟踪,而非生产计费。
运行要求
通过 npx agent-costcenter-mcp 在用户机器上作为本地进程运行(需要 Node.js)。仅限桌面端,无网页版。未声明认证、环境变量或请求头。
安装前请注意
记录调用和注册智能体会把成本数据写入本地存储,预算告警可能在超支时阻止操作。成本依据内置价格表计算,可能与服务商实际账单不一致。不要求任何凭据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agent Costcenter,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

bash
npx agent-costcenter-mcp

Claude Desktop

json
{  "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

bash
npm installnpm testnpm run dev  # watch mode

License

MIT

来源:README.md,提交 33b0cfe

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.3最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。