MCP directory
SG

Spend Guard

by github.com/vulinh1704 · v0.2.0 · updated Oct 31, 2026

Budgets, payee allowlists, price-spike checks and human approval for agents paying x402 paywalls

npm

Run it locally

Install the package and point your AI client at it.

npm

npx -y @vulinh1704/[email protected]

Environment variables

  • SPEND_GUARD_POLICY

    Policy JSON file: networks, budgets, approval amount, spike ratio, known services and their payees. Without one, every payment waits for your approval.

  • SPEND_GUARD_RAILS

    How to pay: mock (pays nothing), near, arc, gateway, or a comma list. arc and gateway need ARC_PRIVATE_KEY, near needs NEAR_ACCOUNT_ID and NEAR_PRIVATE_KEY.

  • SPEND_GUARD_LEDGER

    Decisions file, read back on start so a restart keeps today's spend; servers on one file share one budget. Default ~/.spend-guard/ledger.jsonl; off keeps it in memory.

  • SPEND_GUARD_DASHBOARD_PORT

    Port of the approval dashboard on 127.0.0.1. 0 picks a free one; off means no dashboard, and payments that need approval are declined.

  • SPEND_GUARD_APPROVAL_TIMEOUT

    Seconds a payment waits for your answer before it is declined. Raise it together with your client's tool timeout.

  • SPEND_GUARD_MOCK_NETWORK

    Network the mock rail pretends to pay on.

  • ARC_PRIVATE_KEYsecret

    Agent key for the arc and gateway rails. Testnet keys only.

  • NEAR_ACCOUNT_ID

    Agent account for the near rail (testnet).

  • NEAR_PRIVATE_KEYsecret

    Agent key for the near rail. Testnet keys only.

More from github.com/vulinh1704

More MCP servers