@vk0/agent Cost Mcp
@vk0dev
@vk0/agent Cost Mcp について
Local-first Claude Code cost analyzer. Parses JSONL session logs to surface per-tool spend, daily trends, and optimization hints.
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"agent-cost": {
"command": "npx",
"args": [
"-y",
"@vk0/agent-cost-mcp"
]
}
}
}ツール
9Parse a single Claude Code session and return token totals, turn count, cache usage, and estimated USD cost so an agent can anchor every later Cost Guard question in one concrete run summary.
Aggregate tool invocations across one session or a filtered project log directory, reporting per-tool call counts and context-share percentages so you can see which tool patterns are actually driving spend.
Roll session logs into a day-by-day local cost trend, with per-day sessions, tokens, and estimated spend so anomalies and rising burn patterns are visible before they feel like guesswork.
Return a parent-plus-subagent session tree for one local Claude Code run, with cost summed per branch, so you can see which branch or delegated path actually consumed the budget.
Rank tools by a bounded ROI heuristic using cost share, linked results, and context share, so repeated calls with weak payoff surface quickly as the classic low-efficiency or runaway-loop signature, while productive same-tool refinement is less likely to be flagged too aggressively after `2.3.1`.
Generate lightweight optimization suggestions from a parsed session log, including cache-read ratios, abandoned tool calls, and heaviest turns, when you want the next fix to be more concrete than a raw metric table.
Flag unusually high or low daily cost spikes against the recent local baseline so sudden burn jumps, suspicious drops, and unstable usage patterns stand out without a separate monitoring stack.
Project a bounded local cost forecast from recent daily trend data so an operator can ask where spend is heading next, not just where it already went; `forecast_confidence` is a quartile-based local heuristic, not certainty, and it degrades gracefully when history is still short.
Set daily or per-session budget caps with tiered alert thresholds, so the next cost-query tool can return a machine-readable warning before an agent quietly runs past a soft or hard spending boundary.
概要
What is @vk0/agent Cost Mcp?
Local Cost Guard and runtime guardrails for AI agents in Claude Code. It reads your local JSONL session logs to show where spend is coming from, forecast where it is heading, attribute cost by provider/model/tool, roll up subagent trees, and let operators push signed monitor-webhook alerts—all without a hosted control plane, cloud, or API key.
How to use @vk0/agent Cost Mcp?
Install by adding an npx-based MCP server to your client configuration (Claude Desktop, Claude Code CLI, Cursor, or Cline). No global install required. Once configured, ask the agent “What tools does agent-cost expose?” to see the eleven available tools. Operates on existing session logs at ~/.claude/projects/.
Key features of @vk0/agent Cost Mcp
- Cost queries:
get_session_cost,get_tool_usage,get_cost_trend,get_subagent_tree - Optimization analytics:
get_tool_roi,suggest_optimizations,detect_cost_anomalies - Predictive tools:
get_cost_forecast,estimate_run_cost - Configuration tools:
configure_budget,set_monitor_webhook - Operates entirely locally on JSONL session logs from Claude Code
- Privacy-preserving with zero cloud dependencies
Use cases of @vk0/agent Cost Mcp
- Identify which tool, subagent, or branch burned the budget in a Claude Code session
- Catch retry loops and runaway patterns before costs compound silently
- Set budget thresholds and route monitor alerts for pre-spend guardrails
- Attribute cost across parent/subagent session trees with
get_subagent_tree - Detect daily cost anomalies against a local baseline
FAQ from @vk0/agent Cost Mcp
What does @vk0/agent Cost Mcp do that native /cost does not?
Native /cost gives quick current-session totals and statusline numbers. @vk0/agent Cost Mcp provides per-tool cost share, ROI ranking, anomaly detection, cost forecasts, and agent-readable budget guardrails—all machine-readable from local JSONL logs.
How do I install @vk0/agent Cost Mcp?
Use npx -y @vk0/agent-cost-mcp as the command in your MCP client’s server configuration (e.g., claude_desktop_config.json, .mcp.json, or .cursor/mcp.json). No global installation needed.
Where does the data come from?
The tool reads session logs stored locally at ~/.claude/projects/<project>/. No data leaves your machine.
Is this a replacement for billing dashboards or org-wide spend tracking?
No. It is for developers and operators who want Cost Guard–style answers from local Claude Code logs, not for chargeback reporting, company-wide spend accounting, or live runtime introspection.
What transports and authentication are supported?
The server communicates over stdio MCP transport. No authentication or API keys are required.
「AI とエージェント」の他のコンテンツ
欢迎来到 智言平台
Shy2593666979AgentChat 是一个基于 LLM 的智能体交流平台,内置默认 Agent 并支持用户自定义 Agent。通过多轮对话和任务协作,Agent 可以理解并协助完成复杂任务。项目集成 LangChain、Function Call、MCP 协议、RAG、Memory、HITL、Skill、Milvus 和 ElasticSearch 等技术,实现高效的知识检索与工具调用,使用 FastAPI 构建高性能后端服务。
mcp-hfspace MCP Server 🤗
evalstateMCP Server to Use HuggingFace spaces, easy configuration and Claude Desktop mode.
Open Multi-Agent Canvas
CopilotKitThe open-source multi-agent chat interface that lets you manage multiple agents in one dynamic conversation and add MCP servers for deep research
Hass-MCP
voskaControl and query Home Assistant from Claude and other LLMs — a Model Context Protocol (MCP) server.
LinkedIn MCP Server
stickerdanielOpen-source MCP server for LinkedIn. Give Claude and any MCP-compatible AI agent access to profiles, companies, jobs, and messages.
コメント