Skip to main content

MCP server for AI agent payments โ€” spending firewall, budget checks, and approval flows via the Model Context Protocol

Project description

๐Ÿ’ณ Bonanza MCP

MCP server for AI agent payments โ€” spending firewall, budget checks, and approval flows

PyPI Python License MCP x402

Use Bonanza's spending firewall directly from Claude, GPT, or any MCP-compatible AI agent. Check budgets, evaluate payments, approve spending, and audit transactions โ€” all through natural language.

Why?

AI agents are making payments, but they need guardrails. Bonanza MCP brings our spending firewall to the Model Context Protocol โ€” the standard way AI models interact with tools.

Instead of writing custom code, your AI agent can simply call:

"Check if I can pay $5.00 for weather data" "What's my remaining budget?" "Approve payment to api.premium-data.com" "Show my spending history"

Installation

pip install bonanza-mcp

With x402 protocol support:

pip install bonanza-mcp[x402]

Quick Start

1. Configure Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "bonanza": {
      "command": "bonanza-mcp",
      "args": ["--max-budget", "10.00", "--require-approval-above", "5.00"]
    }
  }
}

2. Use in conversation

You: Check my budget
Claude: Your current spending is $2.50 out of $10.00 (25%). You have $7.50 remaining.

You: Can I pay $3.00 for API data from weather.com?
Claude: โœ… Payment approved: $3.00 to weather.com
   Reason: All checks passed
   Risk level: LOW (0.20)
   Remaining budget: $4.50

You: Pay $8.00 for premium AI analysis
Claude: โŒ Payment blocked: Session budget exceeded: $2.50 + $8.00 > $10.00

You: Pay $6.00 for verified data from api.trusted.com
Claude: โณ Requires human approval: $6.00 exceeds the approval threshold ($5.00)
   Approval URL: https://bonanza-labs.com/firewall/approve/abc-123

3. Use programmatically

from bonanza_mcp import BonanzaMCPServer

server = BonanzaMCPServer(
    max_budget_usd=10.00,
    require_approval_above=5.00,
    trusted_vendors=["api.weather.com", "api.data.gov"],
    allowed_networks=["base", "solana"],
)

# Run as MCP server
server.run()

MCP Tools

Tool Description
check_budget Show current spending and remaining budget
evaluate_payment Evaluate a payment against firewall policy
approve_payment Approve a pending payment
reject_payment Reject a pending payment
spending_history View recent spending with filters
set_budget Update the budget for the current session
add_vendor Add a vendor to the trusted list
remove_vendor Remove a vendor from the trusted list
risk_assessment Assess risk level for a vendor/amount

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  AI Agent   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Bonanza MCP     โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Firewall   โ”‚
โ”‚  (Claude/   โ”‚     โ”‚  Server           โ”‚     โ”‚  Engine     โ”‚
โ”‚   GPT/...)  โ”‚     โ”‚                  โ”‚     โ”‚             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚     โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
                    โ”‚  โ”‚ Budget     โ”‚  โ”‚     โ”‚  โ”‚ Policy  โ”‚ โ”‚
                    โ”‚  โ”‚ Check      โ”‚โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ–ถโ”‚  โ”‚ Engine  โ”‚ โ”‚
                    โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค  โ”‚     โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
                    โ”‚  โ”‚ Risk       โ”‚  โ”‚     โ”‚             โ”‚
                    โ”‚  โ”‚ Score      โ”‚  โ”‚     โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
                    โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค  โ”‚     โ”‚  โ”‚ Audit   โ”‚ โ”‚
                    โ”‚  โ”‚ Vendor     โ”‚  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  โ”‚ Log     โ”‚ โ”‚
                    โ”‚  โ”‚ Allowlist  โ”‚  โ”‚     โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
                    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Comparison

Feature bonanza-mcp AgentBudget MCP Lightning MCP
Budget limits โœ… โœ… โŒ
Vendor allowlist โœ… โŒ โŒ
Risk scoring โœ… โŒ โŒ
Human approval queue โœ… โŒ โŒ
Stripe checkout โœ… โŒ โŒ
x402 integration โœ… โŒ โŒ
Crypto (USDC/SOL) โœ… โŒ โœ…
Audit trail โœ… โœ… โŒ
MCP protocol โœ… โŒ โœ…

Requirements

  • Python 3.10+
  • mcp>=1.0.0
  • pydantic>=2.0
  • httpx>=0.24

License

Apache License 2.0 โ€” see LICENSE for details.

Links


Built by Bonanza Labs ๐Ÿงจ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bonanza_mcp-0.1.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bonanza_mcp-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file bonanza_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: bonanza_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for bonanza_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f96131926652f6a5764326692841641aefe33b6f329a5b8734bd1ef3970d6ee1
MD5 39caf1fae02a328c06edefcdf5d4f037
BLAKE2b-256 dd25b33acb0c4ec5c162bb970ab90967ba17a3f07e1bce38484e3875f21ceef6

See more details on using hashes here.

File details

Details for the file bonanza_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bonanza_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for bonanza_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45101af91bc04549f3c7c47a7ce434bc5efa1dc72916ddcc4b5d99ef9a477e2d
MD5 a577527875b8562c2dd77b0b5f070739
BLAKE2b-256 cb3102a9d9d8cfac2dbed84410515645f2f893b40937d76f36b7e7362b034fd7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page