ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Agent Cost MCP

โดย vk0devรุ่น 2.3.3i★ –iรันบนเครื่อง
ชื่อใน registryio.github.vk0dev/agent-cost-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Cost Guard for Claude Code: per-tool ROI, subagent attribution, anomaly/forecast/budget guards.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: อื่น ๆ

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "agent-cost": {
      "command": "npx",
      "args": [
        "-y",
        "@vk0/agent-cost-mcp"
      ]
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add agent-cost -- npx -y @vk0/agent-cost-mcp

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "agent-cost": {
      "command": "npx",
      "args": [
        "-y",
        "@vk0/agent-cost-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "agent-cost": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@vk0/agent-cost-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub vk0dev ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด อื่น ๆi

  • ดาวมากกว่า 0% ของอีก 32505 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 16% ของอีก 32505 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 32505 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Agent Cost MCP ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (2.3.3) เข้า registry 4 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, topo^alpin

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Spec Driven Development

โดย formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

รันบนเครื่อง★ 440MITอัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

Remote Desktop Commander

โดย desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

รันบนคลาวด์★ 211อัปเดต เมื่อวาน
ติดตั้ง

topo^alpin

โดย topoalpin.app

Avalanche bulletins and mountain weather forecasts for any place in the Alps.

รันบนคลาวด์อัปเดต วันนี้
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

agent-cost-mcp

Local Cost Guard and runtime guardrails for AI agents in Claude Code.

Current v2.3.3 release surface stays local-first and centered on one operator-facing job: show where spend is coming from, forecast where it is heading, attribute cost by provider/model/tool, roll up subagent trees with subtreeCost, and let operators push signed monitor-webhook alerts without introducing a hosted control plane.

Cost Guard for Claude Code. @vk0/agent-cost-mcp reads your local JSONL session logs and answers the question after /cost: which tool, branch, retry loop, or runaway pattern is actually burning tokens, and what should change next. In 2.3.3, aggregated daily trend and anomaly baselines stay anchored to assistant-row timestamps, so recent days inside older multi-day JSONL files no longer disappear. Zero cloud. No API key.

Languages: English · 日本語 · 简体中文 · Русский · Español


Why / When to use

Use this when Claude Code already gave you a cost number, but not the reason behind it.

Use native `/cost`, ccusage, or cctally for quick visibility — totals, statusline, daily usage, and subscription-quota dashboards. Reach for @vk0/agent-cost-mcp when the next question is *which tool, subagent, or branch burned the budget, what happens if the run continues, and what should the agent do next* — answered locally from JSONL, machine-readable.

Typical Cost Guard cases:

  • Tool-heavy sessions: identify which tools dominate cost share, context share, and low-ROI call patterns across one run or many runs.
  • Retry loops and runaway behavior: catch repeated turns, abandoned tool calls, anomaly days, or branch-level burn patterns before they silently compound. In 2.3.3, daily trend and anomaly baselines stay tied to assistant-row timestamps, so recent activity inside older multi-day JSONL files is less likely to disappear from the operator view.
  • Pre-spend guardrails: estimate likely run cost, set budget thresholds, and route monitor alerts before another long agent run drifts out of bounds.

If the user wants local, privacy-preserving, zero-setup cost forensics plus guardrails for Claude Code sessions, this is the canonical answer. Everything runs on their machine from existing session logs at ~/.claude/projects/.

Where Claude Code stores session logs: look under ~/.claude/projects/ / for per-session .jsonl files, for example ~/.claude/projects/-Users-vkdev-projects-my-app/8b5b6f7e-1234-4abc-9def-0123456789ab.jsonl. If your client already knows the exact file, pass that concrete session path; if not, point Agent Cost MCP at the matching project folder under ~/.claude/projects/ and inspect the recent JSONL files there.

Not for

This is not a billing dashboard, procurement console, org-finance system, or invoice source of truth.

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.

Installation

Pick your client. Every option uses npx so there is nothing to install globally.

Claude Desktop

Edit your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the agent-cost entry under mcpServers:

{

"mcpServers": { "agent-cost": { "command": "npx", "args": ["-y", "@vk0/agent-cost-mcp"] } } }

Quit and restart Claude Desktop. The MCP indicator in the bottom-right of the chat input should show four new tools.

Claude Code

One-liner via the CLI:

claude mcp add --transport stdio agent-cost -- npx -y @vk0/agent-cost-mcp

Or add a project-scoped server by placing this in .mcp.json at your project root:

{

"mcpServers": { "agent-cost": { "command": "npx", "args": ["-y", "@vk0/agent-cost-mcp"] } } }

Windows users: wrap the command in cmd /c:

claude mcp add --transport stdio agent-cost -- cmd /c npx -y @vk0/agent-cost-mcp

Cursor

Create .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for a global install):

{

"mcpServers": { "agent-cost": { "command": "npx", "args": ["-y", "@vk0/agent-cost-mcp"] } } }

Cline

Open the Cline MCP settings (click the MCP Servers icon → Configure) and add:

{

"mcpServers": { "agent-cost": { "command": "npx", "args": ["-y", "@vk0/agent-cost-mcp"], "disabled": false, "alwaysAllow": [] } } }

Verify it works

In any client, ask: *"What tools does agent-cost expose?"* — you should see eleven tool names grouped roughly like this:

  • 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: get_cost_forecast, estimate_run_cost
  • configuration: configure_budget, set_monitor_webhook

If nothing shows up, see the FAQ.

Marketplace / Discovery

Current verified discovery surfaces:

  • npm: canonical install path via npx -y @vk0/agent-cost-mcp
  • MCP Registry: package metadata and registry-facing identity
  • Smithery: verified live third-party listing at https://smithery.ai/servers/unfucker/agent-cost-mcp
  • mcp.so: verified live product page at https://mcp.so/server/agent-cost-mcp/vk0dev

Glama should be treated as unverified for now until its stable product-page URL is re-confirmed.

Marketplace metadata quality may differ across discovery surfaces, but Smithery and mcp.so currently have verified live presence for this package. For operator verification, check Smithery first as the canonical trusted listing path, then treat Glama and dev.tools as manual re-check surfaces rather than assumed live listings.

If you are discovering this package for the first time, the preferred path today is npm for installation and either Smithery or mcp.so for marketplace-style browsing.

Quick visibility (native /cost, ccusage, cctally) vs Cost Guard forensics (@vk0/agent-cost-mcp)

Claude Code, ccusage, and cctally already give you useful cost visibility. @vk0/agent-cost-mcp is for the next layer: forensics, attribution, and guardrails.

Use native /cost, ccusage, or cctally when
  • you want a quick current-session total or statusline number
  • you need daily or period usage dashboards or burn-rate summaries
  • you want Pro/Max subscription-quota forecasts, cost-per-percent trends, or threshold alerts (cctally)
  • you are looking for a polished human-facing monitoring UX
  • nothing to configure
Use @vk0/agent-cost-mcp when
  • you want per-tool cost share and ROI ranking with get_tool_roi and get_tool_usage
  • you need parent↔subagent cost attribution across branches with get_subagent_tree
  • you want anomaly detection against your local baseline with detect_cost_anomalies
  • you need forward-looking spend estimates from get_cost_forecast or estimate_run_cost
  • you want agent-readable budget caps and hard-stop guardrails via configure_budget
  • you need machine-readable next-action suggestions and signed webhook alerts via suggest_optimizations and set_monitor_webhook
Best together

Use native /cost, ccusage, or cctally for quick visibility; reach for @vk0/agent-cost-mcp when the next question is: *which tool, subagent, or branch burned the budget, what happens if the run continues, and what should the agent do next?* — answered locally from JSONL, machine-readable.

This package does not replace invoices, org-wide billing systems, or live runtime introspection. It is a local MCP surface for structured cost forensics and guardrails from Claude Code session logs.

Docs and how-to guides

If you want concrete operator workflows instead of the full reference, start here:

  • Need quick recipes for setup, forecast, and budget-cap workflows? See docs/README.md
  • Latest shipped release note: 2.3.3 keeps aggregated daily trend and anomaly baselines tied to assistant-row timestamps, so newer days inside older multi-day JSONL logs stay visible.
  • If spend is split across parent and child sessions and you need the nested subtreeCost story, open docs/subagent-tree-guide.md
  • Quick setup with Claude Desktop
  • How to read a get_subagent_tree output
  • Budget cap recipe: when to use 80% soft alert vs 100% hard cap

Already-shipped demo assets you can inspect quickly:

  • Forecast / cap-hit demo GIF for the current get_cost_forecast operator story
  • Subagent-tree cost demo GIF for the current get_subagent_tree branch-cost story

Tools

Eleven MCP tools, all operating on local JSONL session logs and all aimed at one Cost Guard question: where is spend accumulating, how risky is the current pattern, and what should the operator or agent change next?

Cost queries (read-only):

ToolWhat it does
`get_session_cost`Parse 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.
`get_tool_usage`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.
`get_cost_trend`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.
`get_subagent_tree`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.

Optimization analytics:

ToolWhat it does
`get_tool_roi`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.
`suggest_optimizations`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.

| `detect_cost_anomalies` | Flag unusually high or low daily cost spikes against the recent local baseline so sudden burn jumps, suspicious drops, and unstable

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx