Skip to content
MCP server

Spend Brake

Give agents search and maps APIs with hard dollar caps per key

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, self-hosted
Runs
Locally
Version
0.4.0
Listing updated
3 days ago

About Spend Brake

Spend Brake is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

Instead of handing an agent a Tavily or Exa key, you give it a Spend Brake virtual key, and every call goes through the Spend Brake proxy. The provider keys stay stored in Spend Brake and never reach the agent, and a call that would cross a cap is refused before it is sent. Results report their cost and the remaining budget.

The spend server offers Tavily, Exa, Brave and SerpApi search, Google Maps commands, a brake_call tool for other priced APIs, and a read-only brake_budget that lists the caps on a key. When a cap, kill switch or loop breaker stops a call, the error starts with STOP and tells the model not to retry or switch tools. A call with no answer within 60 seconds also stops, because the proxy may already have charged it. The named tools default to cheap SKUs, while brake_call can pick an expensive one.

A separate admin mode, started with --admin, covers the dashboard API using an admin token, with changes that loosen spend safety marked destructive and some results waiting for a second person. The README labels it a preview, stdio only, under Apache-2.0. For coding agents, a brake CLI can also run a command in a session with its own budget.

Install

Run in a terminal

claude mcp add spend-brake --env BRAKE_KEY='<BRAKE_KEY>' --env BRAKE_URL='<BRAKE_URL>' --env BRAKE_API_URL='<BRAKE_API_URL>' -- npx -y @spend-brake/mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "spend-brake": {
      "command": "npx",
      "args": [
        "-y",
        "@spend-brake/mcp"
      ],
      "env": {
        "BRAKE_KEY": "<BRAKE_KEY>",
        "BRAKE_URL": "<BRAKE_URL>",
        "BRAKE_API_URL": "<BRAKE_API_URL>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "spend-brake": {
      "command": "npx",
      "args": [
        "-y",
        "@spend-brake/mcp"
      ],
      "env": {
        "BRAKE_KEY": "<BRAKE_KEY>",
        "BRAKE_URL": "<BRAKE_URL>",
        "BRAKE_API_URL": "<BRAKE_API_URL>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "spend-brake": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@spend-brake/mcp"
      ],
      "env": {
        "BRAKE_KEY": "<BRAKE_KEY>",
        "BRAKE_URL": "<BRAKE_URL>",
        "BRAKE_API_URL": "<BRAKE_API_URL>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "spend-brake": {
      "command": "npx",
      "args": [
        "-y",
        "@spend-brake/mcp"
      ],
      "env": {
        "BRAKE_KEY": "<BRAKE_KEY>",
        "BRAKE_URL": "<BRAKE_URL>",
        "BRAKE_API_URL": "<BRAKE_API_URL>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "spend-brake": {
      "command": "npx",
      "args": [
        "-y",
        "@spend-brake/mcp"
      ],
      "env": {
        "BRAKE_KEY": "<BRAKE_KEY>",
        "BRAKE_URL": "<BRAKE_URL>",
        "BRAKE_API_URL": "<BRAKE_API_URL>"
      }
    }
  }
}

Configuration

  • BRAKE_KEYA Spend Brake virtual key (sb_live_…); its caps apply to every callRequired
  • BRAKE_URLThe Spend Brake proxy, e.g. https://proxy.spendbrake.devRequired
  • BRAKE_API_URLThe Spend Brake admin API, for the budget tool and for --admin, e.g. https://app.spendbrake.devRequired

Tools this server provides (2)

Taken from the project documentation; the running server may differ.

brake_call
Calls other priced APIs through the proxy, including expensive SKUs.
brake_budget
Lists the caps that apply to the key and what is left; read-only.

What it does

Virtual key caps
Every call is checked against dollar limits on the key before it is sent.
Search providers
Offers Tavily, Exa, Brave and SerpApi search through one server.
Maps commands
Includes Google Maps geocoding and place search.
STOP signals
Cap, kill-switch and loop stops tell the model not to retry.
Cost in every result
Each result carries its cost and the remaining budget.
Separate admin server
An --admin mode manages keys, caps and policy with an admin token.

Good for

  • Replace a Tavily or Exa MCP entry with a capped one
  • Stop a looping agent from burning API budget
  • Check how much budget is left on a key
  • Run Claude Code in a $5 session budget
  • Keep provider keys out of agent configuration

Pricing

Open source

Apache-2.0 package; provider charges are paid separately

Prices change. Check docs.spendbrake.dev before you buy.

Spend Brake FAQ

What env vars are required?

BRAKE_KEY (a virtual key), BRAKE_URL for the proxy and BRAKE_API_URL for the admin API.

Does the agent see my provider keys?

No. Provider keys are stored in Spend Brake and never reach the agent.

What licence is it?

Apache-2.0, and the README calls it a preview.

Can I run it self-hosted?

Yes. Point BRAKE_URL and BRAKE_API_URL at your own proxy and admin API.

Is Spend Brake free?

Yes. Spend Brake is open source, so you can use and self-host it for free.

How do I add Spend Brake to Claude Code?

Run this command in your terminal: claude mcp add spend-brake --env BRAKE_KEY='<BRAKE_KEY>' --env BRAKE_URL='<BRAKE_URL>' --env BRAKE_API_URL='<BRAKE_API_URL>' -- npx -y @spend-brake/mcp

What are the best alternatives to Spend Brake?

The closest alternatives to Spend Brake are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to Spend Brake

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools