MCPSpend
This server lets you monitor, analyze, and optimize the cost of your AI agent's MCP tool calls directly from any MCP client.
get_today_cost: Returns total tool-call cost and count for the current UTC day.get_usage_this_month: Shows monthly usage vs. plan limit, percentage consumed, and a projection to catch cap overruns early.list_top_tools: Identifies the most expensive tools over a configurable time window (1–365 days), returning up to 50 entries ranked by total cost.list_recent_sessions: Lists recent agent sessions with model, total cost, call count, and duration (up to 100 sessions).get_session_details: Drills into a specific session by ID, returning a summary and up to 500 individual tool calls with timing, cost, and success status.estimate_cost: Estimates the USD cost of a tool call before invoking it, based on historical averages for that (server, tool, model) combination—enabling spend-aware decisions like prompting user confirmation for expensive calls.
MCPSpend
Know what your AI agents really cost. Real-time cost tracking for every MCP tool call across Cursor, Claude Desktop, Windsurf, and VS Code.
mcpspend.com · Smithery · npm · Open VSX · Glama
One-command install
npx --yes @mcpspend/proxy@latest init --key mcps_live_xxxAuto-detects Claude Desktop, Cursor, Windsurf, VS Code (user + workspace), and Claude Code (user + project). Wraps every configured MCP server, leaves a .mcpspend.bak backup, and starts streaming usage to your dashboard at mcpspend.com.
Free tier: 25,000 tool calls/month, no credit card.
Related MCP server: iris-eval/mcp-server
What's in this monorepo
Package | What it is |
| |
| |
| |
Express + Prisma + Postgres + BullMQ. The ingest endpoint, billing, and the new | |
Next.js dashboard at mcpspend.com. |
Three ways to query your usage
Use case | How |
Web dashboard | mcpspend.com/dashboard — overview, top tools, sessions, CSV export. |
From any MCP client (stdio) | Add |
From any MCP client (HTTP) | Point your client at |
Pricing
Plan | Calls/month | Monthly | Yearly |
Free | 25,000 | $0 | $0 |
Pro | 1,000,000 | $29 | $290 (2 months free) |
Team | 10,000,000 | $99 | $990 |
Enterprise | unlimited | $499 | $4,990 |
Every paid plan: 30–90 day retention, CSV/Slack export, budget alerts, role-based access.
Privacy
The proxy reports: tool name, server name, model, latency, success, approximate input/output sizes (tokens, derived from JSON length). It does not send the actual tool arguments or response bodies to MCPSpend. See Privacy Policy for the full sub-processor list (Stripe + Resend + Hostinger, all EU-hosted) and your GDPR rights.
Security
For automated scanners flagging this repo: the proxy uses
child_process.spawnto wrap the user's own MCP server — that's the whole point of an observability proxy. The spawn args come from the user's local MCP-client config (Claude Desktop / Cursor / Windsurf / VS Code), never from network input. No RCE path, no privilege escalation, no arbitrary command execution. Full threat model inSECURITY.md.
API keys stored as SHA-256 hashes (never plaintext on the server)
Passwords bcrypt cost 12
Secrets at rest AES-256-GCM (
APP_ENCRYPTION_KEY)Transport HTTPS only, HSTS enabled, helmet CSP headers
No tool arguments or responses ever leave the user's machine
Per-tenant isolation every query scopes by
organizationIdGDPR Art. 15 / 17 / 20 self-serve at
mcpspend.com/dashboard/account/privacyEU-hosted (Hostinger EU region)
SOC 2 Type I in progress with Vanta (Q4 2026)
DPA available for Enterprise customers
Report vulnerabilities: security@mcpspend.com · Machine-readable disclosure: https://mcpspend.com/.well-known/security.txt · Full policy: SECURITY.md · Live posture: https://mcpspend.com/security
Support the project
If MCPSpend saves you money or you just want to keep the proxy MIT and the free tier alive, you can sponsor any amount via Stripe — no account required:
💖 buy.stripe.com/00w8wPbUxe1qgK36CRbbG06
Every dollar goes back into hosting, security audits, and shipping features.
License
MIT. Use it, fork it, run it self-hosted.
© NewRzs SRL · CUI RO48756557 · Bucharest, Romania · support@mcpspend.com
Available Tools
6 toolsestimate_costA
Estimate the USD cost of an MCP tool call BEFORE invoking it. Returns expected cost based on the historical average for this (server, tool, model) combo in this org over the last 30 days. Use this to make spend-aware decisions — e.g. confirm with the user before calling tools that would cost more than $0.10. Returns 0 + isUnknown=true when no history exists yet.
Inputs: serverName (required), toolName (required), model.
get_session_detailsA
Drill into a single session by ID: returns the session summary plus every tool call (up to 500) with timing, cost, and success.
Inputs: session_id (required).
get_today_costA
Get total tool-call cost and call count for the current day (UTC). Returns a human-readable summary plus structured data.
Inputs: no named parameters.
get_usage_this_monthA
Returns calls used this month, plan limit, percentage used, and a projection for the rest of the month based on the current daily average. Use this to spot when an org is about to hit the cap.
Inputs: no named parameters.
list_recent_sessionsA
Recent agent sessions (each MCP-client process start = one session) with model, total cost, tool call count, and duration.
Inputs: limit.
list_top_toolsA
Top tools by total cost over the past N days. Optionally limit how many entries to return. Useful for finding "what is the most expensive thing my agents do".
Inputs: days, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct purpose: estimate cost before calls, drill into session details, daily cost, monthly usage with projection, list sessions, and top tools. No overlap.
All tools follow a consistent verb_noun pattern (e.g., estimate_cost, get_session_details, list_recent_sessions) with snake_case, making it predictable.
6 tools is well-scoped for a cost monitoring server; covers estimation, daily/monthly usage, session details, and top spenders without being excessive.
Covers the core domain: pre-call estimation, current day cost, monthly usage with projections, session details, and top cost drivers. No obvious gaps.
Maintenance
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Agent Cost Allocator MCP — multi-tenant LLM cost attribution for chargeback billing. Companion to
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Analytics for MCP servers. Query your tool calls, first-call success, retries and schema cost.
Related MCP Servers
- AlicenseCqualityAmaintenanceMCP server for Langfuse observability. Query traces, debug exceptions, analyze sessions, and manage prompts and datasets for your LLM applications.483,306 PyPI112MIT
- AlicenseAqualityBmaintenanceMCP-native agent evaluation and observability server. Log traces, evaluate output quality with 12 built-in rules (PII detection, prompt injection, cost thresholds), and track agent costs. Real-time dashboard, OTel-compatible spans. Self-hosted, MIT licensed.12108 npm10MIT
- AlicenseBqualityDmaintenanceTrack LLM token costs across Claude, GPT and Gemini. MCP server + CLI with optimization hints and $ savings estimates.81MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI cost calculation, comparison, and optimization across major providers like Anthropic, OpenAI, Google, Meta, and Mistral. Supports cost estimation, budget-aware model finding, and token estimation through a simple API and MCP integration.MIT