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 分

    請在儲存庫或註冊中心條目中宣告授權條款。