Skip to main content
MCP server CX Codex

mcpspend — Claude Code MCP server: what it does, how to install

Tracks MCP tool call costs across your coding agents and lets you inspect spending directly in the chat. Useful for catching runaway token bills early.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env MCPSPEND_API_KEY=<MCPSPEND_API_KEY> --env MCPSPEND_ENDPOINT=<MCPSPEND_ENDPOINT> --transport stdio mcpspend -- npx -y @mcpspend/mcp-server
Open on GitHub

What mcpspend does

This server connects your client to mcpspend.com, letting an assistant run queries like get_today_cost and list_top_tools. Data collection happens through the companion @mcpspend/proxy, which wraps existing tool configurations to record latency, tool names, models, and rough token counts based on payload length.

Tool arguments and raw output bodies stay on your local disk; only aggregated metadata reaches the ingestion endpoint. Running the server requires an MCPSPEND_API_KEY. The free plan covers 25,000 tool executions per month without entering payment details.

What it helps with

  • check current day tool spending inside the agent conversation
  • spot the most heavily invoked MCP tools across your setup
  • forecast monthly budget usage before hitting billing limits
  • inspect session activity without leaving the terminal

Example prompts for the agent

  • How much did my MCP tool calls cost today?
  • List the top tools by invocation count from recent sessions.
  • What is my projected spend for this month?

How to install mcpspend

Platform CLI

claude mcp add --env MCPSPEND_API_KEY=<MCPSPEND_API_KEY> --env MCPSPEND_ENDPOINT=<MCPSPEND_ENDPOINT> --transport stdio mcpspend -- npx -y @mcpspend/mcp-server

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about mcpspend

How do I install mcpspend in Claude Code?

Run claude mcp add mcpspend -e MCPSPEND_API_KEY=<MCPSPEND_API_KEY> -- npx -y @mcpspend/mcp-server with your secret key. If using a custom endpoint, run `claude mcp add --env MCPSPEND_API_KEY=<MCPSPEND_API_KEY> --env MCPSPEND_ENDPOINT=<MCPSPEND_ENDPOINT> --transport stdio mcpspend -- npx -y @mcpspend/mcp-server`.

What does mcpspend do?

It exposes tools inside your coding agent to check daily expenditure, inspect session metrics, and view top MCP tools without opening a separate web interface.

Does mcpspend send code arguments or tool output to its cloud?

No. The proxy captures only server names, model metadata, execution time, and approximate token size. Raw inputs and tool outputs never leave the local environment.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor