# Spend Brake

> Spend Brake is an open-source MCP server for developer tools. Give agents search and maps APIs with hard dollar caps per key. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://docs.spendbrake.dev/agents/
- **Repository:** https://github.com/kivanow/spend-brake/tree/HEAD/apps/mcp
- **MCP Registry name:** io.github.KIvanow/spend-brake
- **Categories:** developer tools, finance and payments
- **Listing updated:** 2026-11-14

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
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
```

### Claude Desktop (claude_desktop_config.json)

```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>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```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>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```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>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```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>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```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>"
      }
    }
  }
}
```

## Tools

- `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.

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/spend-brake
