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:
- Per-project budget: $500 / month for project
customer_acme - Per-agent budget: $50 / day for agent
nightly_scraper - Per-tool budget: $100 / week on
playwright/browser_navigate
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
- Install the proxy:
npx --yes @mcpspend/proxy@latest init --key mcps_live_xxx - Tag your traffic with project + agent identifiers (env vars)
- In the dashboard at
/dashboard/budgets, create a budget per project or per agent - Wire a webhook subscription at
/dashboard/webhooksto your incident channel - 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 →