# Spend Guard

> Spend Guard is an open-source MCP server for finance and payments. Budgets, payee allowlists and human approval for AI agents paying x402 paywalls. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/vulinh1704/spend-guard
- **MCP Registry name:** io.github.vulinh1704/spend-guard
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments), [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-23

## About

An agent that can pay per call over HTTP 402 can also be talked into overpaying. Spend Guard sits in front of the payment and decides before anything is signed: per-payment limits, a daily budget, a per-service cap, a payee allowlist, a price-spike check against an endpoint's usual price, and human approval above a threshold or for unknown hosts.

In the README demo it refuses a 40x price spike and a swapped payout address, and holds a $0.30 payment for Approve or Deny on a local dashboard, declining after 120 seconds. Every decision is logged with its reasons.

It supports USDC and NEAR rails, including x402 `exact` on Arc testnet. The README labels it testnet-only and not audited; it is MIT licensed and needs Node 22.22.2 or later.

## Features

- **Spending limits:** Per-payment, daily and per-service caps.
- **Payee allowlist:** Blocks a paywall that asks to be paid elsewhere.
- **Price-spike check:** Flags jumps from an endpoint's usual price.
- **Human approval:** Dashboard approval above a threshold.
- **Decision ledger:** Every decision recorded with reasons.

## Good for

- Cap what an agent can spend on paid APIs
- Stop payments after a prompt injection redirects an agent
- Review large payments before they are signed

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add spend-guard --env ARC_PRIVATE_KEY='<ARC_PRIVATE_KEY>' --env NEAR_PRIVATE_KEY='<NEAR_PRIVATE_KEY>' -- npx -y @vulinh1704/spend-guard
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add spend-guard --env ARC_PRIVATE_KEY='<ARC_PRIVATE_KEY>' --env NEAR_PRIVATE_KEY='<NEAR_PRIVATE_KEY>' -- npx -y @vulinh1704/spend-guard
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.spend-guard]
command = "npx"
args = ["-y", "@vulinh1704/spend-guard"]
env = { ARC_PRIVATE_KEY = "<ARC_PRIVATE_KEY>", NEAR_PRIVATE_KEY = "<NEAR_PRIVATE_KEY>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e ARC_PRIVATE_KEY='<ARC_PRIVATE_KEY>' -e NEAR_PRIVATE_KEY='<NEAR_PRIVATE_KEY>' spend-guard npx -- -y @vulinh1704/spend-guard

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

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

```json
{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard"
      ],
      "env": {
        "ARC_PRIVATE_KEY": "<ARC_PRIVATE_KEY>",
        "NEAR_PRIVATE_KEY": "<NEAR_PRIVATE_KEY>"
      }
    }
  }
}
```

## FAQ

### Is Spend Guard production ready?

No. The README says testnet only and not audited.

### Which licence?

MIT.

### Do I need keys to try Spend Guard?

No. The quickstart demo uses mocked payments.

### What if nobody answers an approval?

The demo declines it after 120 seconds.

### Is Spend Guard free?

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

### How do I add Spend Guard to Claude Code?

Run this command in your terminal: claude mcp add spend-guard --env ARC_PRIVATE_KEY='<ARC_PRIVATE_KEY>' --env NEAR_PRIVATE_KEY='<NEAR_PRIVATE_KEY>' -- npx -y @vulinh1704/spend-guard

### What are the best alternatives to Spend Guard?

The closest alternatives to Spend Guard are REA, Solana MCP by Vybe, AiSOC, x64dbg-mcp-server and redamon.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Solana MCP by Vybe](https://ai-powered.com/mcp/solana-mcp-by-vybe): Solana MCP by Vybe is an MCP server for finance and payments.
- [AiSOC](https://ai-powered.com/mcp/aisoc): AiSOC is an open-source MCP server for ai models and llm tooling.
- [x64dbg-mcp-server](https://ai-powered.com/mcp/x64dbg-mcp-server): x64dbg-mcp-server is an open-source MCP server for ai models and llm tooling.
- [redamon](https://ai-powered.com/mcp/redamon): redamon is an open-source MCP server for ai models and llm tooling.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [Treasure Map](https://ai-powered.com/mcp/treasure-map): Treasure Map is an open-source MCP server for security.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.

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