Sponsored by Deepsite.site

Mcpspend

Created By
andreisirbu91-laba month ago
MCPSpend is the first cost-observability platform built natively for MCP. One CLI command wraps yourexisting MCP servers across Claude Desktop, Cursor, Windsurf, VS Code, and Claude Code — zero SDKchanges. Per-tool / per-project cost attribution, $ budget alerts via email + Slack, audit logs, full dataexport, real-time dashboard. Free forever: 25,000 tool calls / month. EU-hosted, GDPR Art. 15/17/20self-serve, SOC 2 Type I in progress with Vanta. MIT-licensed proxy on npm.
Content

I built MCPSpend because Claude Desktop kept eating my money — here's what I learned An honest writeup of building the first cost-observability tool for the Model Context Protocol — what worked, what surprised me, and the numbers nobody talks about.

The problem nobody was solving It's late 2025. I'm running 4 agents in parallel — Claude Desktop, Cursor, Windsurf, plus a few custom MCP servers I wrote for client work. Bills from Anthropic and OpenAI keep climbing. I check the dashboards and see the totals, but I have zero idea which tool call, which server, which project is actually expensive.

Existing AI observability tools fall in two buckets:

LLM-layer: Helicone, Langfuse, Portkey. They see every chat completion. Brilliant. But invisible to the MCP tool layer — they only see "Claude answered the prompt", not "Claude called read_file 47 times to answer it". Generic analytics: PostHog, Mixpanel. Powerful, but you build the schema yourself. By the time you've instrumented every tools/call, you've shipped half of MCPSpend. I had two options: stitch something together in spreadsheets every month, or build it.

I built it. Here's what 3 weeks of nights-and-weekends produced.

How MCPSpend works (60 seconds)

npx @mcpspend/proxy add That's it. One command. The CLI auto-detects Claude Desktop, Cursor, Windsurf, VS Code, and Claude Code on your machine, finds every MCP server you've configured, and rewrites the config to wrap each one with a transparent proxy.

The proxy sits between your MCP client and your MCP server — same stdio protocol, same JSON-RPC messages going through unchanged. But on every tools/call, the proxy records:

Server name + tool name Latency Success / error Approximate payload size (bytes → tokens via per-model estimates) Then it streams that metadata to api.mcpspend.com/v1/ingest over HTTPS, authenticated with your API key.

What the proxy does not send: the actual tool arguments, the actual tool responses, your file contents, your prompts. Privacy-by-design, not as marketing copy.

The dashboard answers the questions I had "Which tool is eating my budget?" — top-N tools by cost, with gradient bars showing the relative ratios. The top 3 get amber dots so my eye goes there first.

"How much is each agent run actually costing?" — sessions view with drill-down. I can see one Claude Code session that spent 47 cents over 2 hours, mostly on Playwright browser_navigate.

"Will I hit my budget this month?" — linear projection from the daily average. With Slack alerts at 50/80/100% so I don't get surprised.

"Which customer / project drove this month's bill?" — projects assign each MCP server to a label. Per-project totals. Eventually CSV export for the CFO.

The 3 things that surprised me building this

  1. MCP tool calls happen ~30x more than LLM calls A single prompt to Claude Desktop with "find all the React components that import this hook" triggers maybe one LLM round-trip — but 50-80 MCP tool calls (filesystem reads, greps, etc.). Existing tools that count "requests" undercount AI agent activity by an order of magnitude.

This was the entire reason MCPSpend's free tier is 25,000 calls/month instead of 10K. The unit is fundamentally different.

  1. Closed IDEs are a moat, not a limitation Cursor and Claude Desktop don't expose hooks. You can't wrap the SDK. The only way to observe what they're doing is from outside — by intercepting the MCP protocol.

This is bad news for tools that work via SDK instrumentation (Helicone, Langfuse). It's great news for a transparent stdio proxy — the proxy doesn't care if the consumer is closed source. MCPSpend works in IDEs where every other observability tool is blind. I didn't fully appreciate this until 2 weeks in.

  1. Auto-detect saves the product The first version required users to manually edit JSON config files. Setup took 10 minutes per IDE. Drop-off was brutal.

V2 added add mode that auto-detects every MCP client on your machine, lists the servers it found, asks for confirmation, then rewrites the configs in-place (with .mcpspend.bak backups). Setup is now under 60 seconds. Conversion to "first tool call observed" went from ~30% to ~80%.

If your product depends on config-file editing, autodetect is not nice-to-have — it's the difference between shipping and not shipping.

Server Config

{
  "mcpServers": {
    "mcpspend": {
      "command": "npx",
      "args": [
        "-y",
        "@mcpspend/mcp-server@latest"
      ],
      "env": {
        "MCPSPEND_API_KEY": "<YOUR_MCPSPEND_API_KEY>"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
ChatWiseThe second fastest AI chatbot™
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.