MCP for budgeting

You can budget for AWS compute and S3 storage — your finance team has those numbers down to the cent. AI agent spend is the opposite: opaque, variable, and prone to runaway loops. Here's how to budget for it.

The runaway-loop problem

Every team that puts an agent in production sees the same incident sooner or later: a workflow that was supposed to scrape 20 pages scraped 2,000 because a pagination condition was wrong. Or a code review agent that walked into a recursive imports graph. The next Anthropic invoice is 10× normal.

Provider-side billing alerts (Anthropic, OpenAI) fire after the fact, on the aggregate, with hours of lag. By the time you see the alert, the damage is done.

What real-time budgets look like

MCPSpend evaluates spend continuously and triggers webhooks at configurable thresholds. Set up:

Threshold events fire webhooks at 50%, 80%, 100% by default — into PagerDuty, Slack, Datadog, or any URL you configure. Every webhook is HMAC-SHA256 signed with X-MCPSpend-Signature so you can verify authenticity.

Hard caps (kill switch)

For projects where overrun is unacceptable — for example, a Free-tier customer of yours — you can set a hard cap. When the project hits 100% of its budget, MCPSpend rejects subsequent tool-call attempts with a 429 at the proxy layer. The agent gets an error response from the tool; you get a clear log of the cap being enforced.

Hard caps are off by default — most teams use webhooks first and escalate to kill-switch only after a runaway incident teaches them the lesson.

How to set it up

  1. Install the proxy: npx --yes @mcpspend/proxy@latest init --key mcps_live_xxx
  2. Tag your traffic with project + agent identifiers (env vars)
  3. In the dashboard at /dashboard/budgets, create a budget per project or per agent
  4. Wire a webhook subscription at /dashboard/webhooks to your incident channel
  5. Test with Send test on the webhook page — confirms signature verification works on your side

Forecast — see overrun before it happens

We compute a daily forecast for each project: month-to-date spend × projection-to-end-of-month based on a recency-weighted moving average plus day-of-week seasonality. Surfaced in the dashboard with a confidence band so you can see "ACME's on track for $612 by month-end" before the bill arrives.

Forecasts come with anomaly flags — if the next 7-day projection is > 3× the 14-day baseline, we mark it as anomalous and you can subscribe to that event.

Start budgeting

Budgets and webhooks are available on every plan, including Free. Create an account →

Track your own MCP spend — free

One command wraps every MCP client on your machine. 25,000 tool calls/month on the free tier. No card.

Related guides