
Agent Cost Mcp Server
io.github.karmendra8386由 GitHub 账号 karmendra8386 发布v0.1.1更新于 Nov 3, 2026
按每个成功任务为LLM/agent运行计价,并记录支出和预算状态。
AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。
原文描述
Prices LLM/agent runs per successful task, with spend recording and budget status.
概览
Agent Cost 的本地 MCP 服务;无需登录;STDIO。
暂无 AI 概览:以下信息来自注册中心条目和服务本身。
安装
在 SourceWeft 中
- 打开 控制台中的 Agent Cost Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Agent Cost MCP Server
An MCP server that gives agents and developers tools to estimate, budget, and compare the cost of LLM work before and during a run — the model-spend counterpart to AWS infrastructure cost tooling.
Agent frameworks decide for themselves how many model calls a task takes, so the cost of a run is usually only visible after the bill arrives. This server answers, from inside your tooling:
- What will this task cost on model A vs model B?
- Which model is cheapest per successful task, not per token?
- Has this run already burned its budget?
The server is self-contained: a maintained pricing snapshot ships with it, no AWS account or API key is needed, all state is a local JSON ledger, and it makes no network calls at runtime.
Tools
Cost per token is the wrong ranking for agent work: a cheap model that
fails half its tasks costs more per success than a pricier, reliable one.
Pass measured success rates to compare_models_for_task if you have them;
models without a supplied rate are ranked on raw cost.
This server supplies the numbers. Enforcing a budget (stopping a run) belongs to the agent framework — see BudgetedModel in strands-agents/samples for that pattern.
Installation
The server installs from GitHub today. A PyPI release is planned — until
it lands, uvx agent-cost-mcp-server and pip install agent-cost-mcp-server do not work yet; use the from-GitHub commands
below (both verified). Requires Python 3.10+; the uvx path needs
uv.
Claude Code
Claude Desktop and Cursor
Add to the client's MCP configuration (Claude Desktop:
claude_desktop_config.json; Cursor: .cursor/mcp.json):
VS Code
Add to .vscode/mcp.json (VS Code uses a servers key):
pip
Example: what a tool call returns
compare_models_for_task for one attempt at a task using 10,000 input
and 2,000 output tokens, with example success rates supplied for a few
models (substitute your own measured rates; models without a supplied
rate are ranked on raw cost):
Response, captured from a live run of the server (pricing snapshot v1, 2026-10-20; first 5 of 18 ranked models):
Note the flip: Amazon Nova Micro is the cheapest model per run ($0.00063), but at a 20% success rate it ranks fourth per successful task ($0.00315 — roughly five attempts per success). Nova Lite costs 1.7× more per run and is the cheapest per success.
Pricing snapshot
Prices live in src/agent_cost_mcp_server/pricing.json — a versioned
snapshot of list prices (USD per 1M tokens) for major Bedrock and
OpenAI-compatible models, dated in the file. Prices change; verify against
the provider's pricing page before making spending decisions. Updating the
snapshot is a one-file change, and the server reads it at startup.
Ledger
record_spend appends to a local JSON ledger at
~/.agent-cost-mcp-server/ledger.json. Set AGENT_COST_LEDGER_PATH to use
a different file. Nothing leaves the machine.
Background
The pricing and cost-per-success model are a port of tokenecon, an open-source library for per-task agent cost accounting (paper: doi.org/10.5281/zenodo.23195511), including a Strands integration that prices live agent runs. This server exposes the same math over MCP so any agent or IDE can call it.
Proposed for the awslabs/mcp collection in RFC #4772.
Development
Cite
If you use this software in your work, please cite the software itself — and, for the cost model and methods behind it, the companion preprint.
Software
Companion preprint
K. Pandey, "Token-Economics for Agentic AI: A Cost Model and Tiered Routing Reference," Zenodo, DOI 10.5281/zenodo.23195511, Oct. 2026.
A CITATION.cff is included for automated citation tooling.
License
Apache-2.0 — see LICENSE.
Copyright 2026 Karmendra Pandey.
来源:README.md,提交 a1ee571
工具
0版本历史
1- v0.1.1最新Nov 3, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分