Spec Driven Development
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
作者提供的说明(英文原文)
Real-time cost awareness for MCP agent workflows
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
YOUR_API_KEY标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"cost-tracker-router": {
"command": "npx",
"args": [
"-y",
"mcp-cost-tracker-router"
],
"env": {
"YOUR_API_KEY": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add cost-tracker-router --env YOUR_API_KEY=your-value -- npx -y mcp-cost-tracker-router运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"cost-tracker-router": {
"command": "npx",
"args": [
"-y",
"mcp-cost-tracker-router"
],
"env": {
"YOUR_API_KEY": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"cost-tracker-router": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-cost-tracker-router"
],
"env": {
"YOUR_API_KEY": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日
注册名称已通过 GitHub 账户 dbsectrainer 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
你需要填写:YOUR_API_KEY
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(1.0.1)于3天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:Spec Driven Development, Remote Desktop Commander, Signoff
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Five gates that make an agent's 'done' provable: run them, read the verdict, audit the record.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
npm mcp-cost-tracker-router package
Local-first cost awareness for MCP agent workflows. Token counts are calculated offline using js-tiktoken — no proxy, no API round-trip, no spend data leaving your machine. When costs climb, routing suggestions point you to cheaper models before the invoice arrives.
Tool reference | Configuration | Contributing | Troubleshooting
Most cost-tracking tools work by routing all your API traffic through their server and measuring tokens server-side. That means your prompts and responses transit a third-party service, and you're dependent on their uptime.
| mcp-cost-tracker-router | Proxy-based trackers (Helicone, LLMonitor, etc.) | |
|---|---|---|
| Token counting | Offline via js-tiktoken — no network call | Counted server-side after traffic is proxied |
| Data residency | Local SQLite only | Prompts + responses pass through vendor servers |
| Model routing | Built-in suggest_model_routing tool | Rarely included; usually a separate paid tier |
| Multi-provider | Claude, OpenAI, Gemini in one pricing table | Often single-provider or requires separate setup |
| Uptime dependency | None — fully offline | Breaks if proxy is down |
If your prompts contain sensitive information or you can't route traffic through a third party, this is the right tool. If you need a managed dashboard with team sharing, a proxy-based service may suit you better.
mcp-cost-tracker-router stores tool call metadata (token counts, model names, timestamps) locally in SQLite. It does not store prompt or response content. Cost calculations are estimates based on a local pricing table and may not exactly match your provider's invoice.
Add the following config to your MCP client:
{
"mcpServers": { "cost-tracker": { "command": "npx", "args": ["-y", "mcp-cost-tracker-router@latest"] } } }
To set a session budget alert:
{
"mcpServers": { "cost-tracker": { "command": "npx", "args": ["-y", "mcp-cost-tracker-router@latest", "--budget-alert=5.00"] } } }
Amp · Claude Code · Cline · Cursor · VS Code · Windsurf · Zed
Enter the following in your MCP client to verify everything is working:
How much has this session cost so far?
Your client should return a token and USD cost summary for the current session.
get_session_cost — Returns token totals and USD cost estimates for the current session. Read-only.get_tool_costs — Returns per-tool cost breakdown for the session, sorted by cost descending. Read-only.reset_session — Start a new cost-tracking session. Previous session data is retained in history.record_usage — Record token usage for a tool call. Takes tool_name, model (optional), input_tokens, and output_tokens. Emits a budget warning notification if 80% of threshold is reached.set_budget_alert — Set a budget threshold in USD (threshold_usd). Warns at 80% and 100% of the threshold. Use with --enforce-budget to block calls beyond the limit.suggest_model_routing — Heuristic model recommendation by task type. Takes task_description and optional constraints.max_cost_usd. Returns recommended model with reasoning and estimated cost.check_routing_policy — Check whether a model is allowed for a given task type under the routing policy. Takes task_type and model.get_spend_history — Query historical spend aggregated by period (day/week/month). Returns breakdown by model and tool. Read-only.estimate_workflow_cost — Pre-run cost estimation for a multi-step workflow. Takes a steps array with tool_name, estimated_input_tokens, estimated_output_tokens, and optional model. Read-only.export_spend_report — Generate a single-file HTML spend report with session breakdown, historical spend, model cost comparison, and budget status. Read-only.export_budget_audit — Export the audit log of budget enforcement decisions. Accepts optional from_date, to_date, and format (json/csv). Read-only.set_project — Create or update a project with an optional budget_usd. Takes project_name.tag_session — Tag the current session with a project_name for cost allocation.get_project_costs — Get cost report for a project. Takes project_name and optional since (ISO date). Read-only.export_chargeback — Generate a chargeback report for internal billing. Takes from_date, to_date, optional group_by (project/session), and optional format (json/csv). Read-only.--budget-alertSession spend threshold in USD. A warning is returned when session costs reach 80% and again at 100% of this threshold.
Type: number
--db / --db-pathPath to the SQLite database file used to store cost history.
Type: string Default: ~/.mcp/costs.db
--pricing-tablePath to a JSON file containing custom model pricing ($/1K tokens). Merged with the built-in table; missing models fall back to defaults.
Type: string
--default-modelModel name to attribute costs to when no model can be inferred from context.
Type: string Default: claude-sonnet-4-6
--enforce-budgetBlock tool calls that would cause the session to exceed the budget alert threshold. Requires --budget-alert to be set.
Type: boolean Default: false
--http-portStart in HTTP mode using Streamable HTTP transport instead of stdio. Useful for sharing a single cost-tracking instance across a team.
Type: number Default: disabled (uses stdio)
Pass flags via the args property in your JSON config:
{
"mcpServers": { "cost-tracker": { "command": "npx", "args": [ "-y", "mcp-cost-tracker-router@latest", "--budget-alert=2.00", "--enforce-budget" ] } } }
Built-in pricing table (USD per 1K tokens):
| Model | Input | Output |
|---|---|---|
| claude-opus-4-6 | $0.0150 | $0.0750 |
| claude-sonnet-4-6 | $0.0030 | $0.0150 |
| claude-haiku-4-5 | $0.0008 | $0.0040 |
| gpt-4o | $0.0025 | $0.0100 |
| gpt-4o-mini | $0.000150 | $0.000600 |
| gemini-1.5-pro | $0.001250 | $0.005000 |
| gemini-1.5-flash | $0.000075 | $0.000300 |
| gemini-2.0-flash | $0.000100 | $0.000400 |
Override individual model prices with --pricing-table. All costs are estimates.
Before publishing a new version, verify the server with MCP Inspector to confirm all tools are exposed correctly and the protocol handshake succeeds.
Interactive UI (opens browser):
npm run build && npm run inspect
CLI mode (scripted / CI-friendly):
# List all tools
npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list
npx @modelcontextprotocol/inspector --cli node dist/index.js --method resources/list npx @modelcontextprotocol/inspector --cli node dist/index.js --method prompts/list
npx @modelcontextprotocol/inspector --cli node dist/index.js \ --method tools/call --tool-name get_session_cost
npx @modelcontextprotocol/inspector --cli node dist/index.js \ --method tools/call --tool-name record_usage \ --tool-arg tool_name=my_tool --tool-arg input_tokens=500 --tool-arg output_tokens=200
Run before publishing to catch regressions in tool registration and runtime startup.
Update src/pricing.ts when new models are released. All cost calculation changes must include unit tests with known token counts and expected USD values. Routing suggestions live in src/tools/routing.ts.
npm install && npm test
This plugin is available on:
Search for mcp-cost-tracker-router.