# PayStage x402 Guard — payment safety before the wallet signs

> PayStage x402 Guard — payment safety before the wallet signs is a freemium MCP server for finance and payments. Pre-signing payment checks for AI agents paying over x402 with USDC on Base. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** API, CLI, Self-hosted
- **Website:** https://paystage.xyz
- **Repository:** https://github.com/base-buzz/paystage/tree/HEAD/packages/x402-guard
- **MCP Registry name:** io.github.base-buzz/x402-guard
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments), [agent payments](https://ai-powered.com/categories/agent-payments)
- **Listing updated:** 2026-11-18

## About

The README frames it as a thin layer between an agent deciding to pay and the wallet signing. It wraps an x402 fetch call, evaluates the actual 402 challenge against a local policy file, and returns pay, review or do-not-pay before any signature happens. Refusals hand back the server's original challenge so the caller can log what was requested.

The server is read-only and never holds keys, so the agent remains the only signer. Policies cover amount caps, allowed payees, assets, networks, challenge timeouts and how to treat unknown payees. The npm packages include a stdio MCP server, a guarded fetch wrapper and verifier and client hooks for the x402 core SDK.

It suits developers building agents that buy paid APIs or MCP tools and want an explicit spend policy outside the wallet. The README is clear that it only evaluates before signing and cannot see what a seller does after settlement.

## Features

- **Pre-signature verdicts:** Each payment returns pay, review or do-not-pay before the wallet signs, with the rule that produced the result.
- **Local policy file:** Spending limits, allowed payees, assets, networks and unknown-payee handling are set in one JSON policy.
- **Read-only MCP server:** Ten MCP tools evaluate payments, batches, outstanding authorisations and velocity without signing anything.
- **Seller-side verifier hook:** A hook for resource servers aborts payments that break policy before facilitator verification runs.
- **Opt-in verdict logging:** Callbacks and an optional telemetry URL record verdicts without wallet addresses, signatures or request bodies.

## Good for

- Capping how much an autonomous agent can spend per x402 request
- Blocking payments to payees outside an allowlist
- Checking a 402 challenge before an agent pays an MCP server
- Validating a spend policy file before deploying an agent

## Install

### Claude Code (Terminal)

```sh
claude mcp add x402-guard -- npx -y @paystage/x402-guard
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "x402-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "x402-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "x402-guard": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "x402-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "x402-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}
```

## Tools

- `evaluate_mcp_payment`: Verifies the recipient and returns a pay, review or do_not_pay verdict before signing an x402 payment.
- `evaluate_batch`: Evaluates several payments against one policy, returning one verdict each in order.
- `list_outstanding_auths`: Lists ERC-20, Permit2 and EIP-3009 authorisations still outstanding.
- `evaluate_outstanding_auths`: Flags outstanding authorisations needing attention before the next payment.
- `evaluate_hip3_trade`: Checks a HIP-3 order against a trade policy, returning allow, review or do_not_trade.
- `evaluate_velocity`: Runs rolling rate and spend checks for bursts, spikes and runaway cadence.
- `verify_receipt`: Checks a receipt against the published signing key.
- `decode_payment_required`: Turns a 402 header into the JSON challenge.
- `validate_policy`: Checks a policy document on its own.
- `request_testnet_funds`: Drips 0.5 Base Sepolia USDC to an address once per 24 hours.

## FAQ

### Does it hold or sign with my keys?

No. The server returns a verdict and never signs; the agent stays the only signer.

### What does it not cover?

It cannot reverse settled payments, detect colluding payees or see what a seller does after payment.

### What does a hosted call cost?

The first 1,000 evaluations per IP per day are free without an account; beyond that the hosted API is $0.002 USDC per call over x402. The packages are MIT licensed.

### Which versions are signed with provenance?

The README says every version from 0.1.1 onward is built and signed by the repository's CI; 0.1.0 was published by hand without attestation.

### Is PayStage x402 Guard — payment safety before the wallet signs free?

PayStage x402 Guard — payment safety before the wallet signs has a free plan, with paid plans for more usage or features.

### How do I add PayStage x402 Guard — payment safety before the wallet signs to Claude Code?

Run this command in your terminal: claude mcp add x402-guard -- npx -y @paystage/x402-guard

### What are the best alternatives to PayStage x402 Guard — payment safety before the wallet signs?

The closest alternatives to PayStage x402 Guard — payment safety before the wallet signs are PayStage — x402 payment safety and spend policy, PayStage Preflight, PayStage Preflight, PayStage and Clawpay.

## Where this comes from

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

## Alternatives

- [PayStage — x402 payment safety and spend policy](https://ai-powered.com/mcp/paystage-x402-payment-safety-and-spend-policy): PayStage — x402 payment safety and spend policy is an open-source MCP server for finance and payments.
- [PayStage Preflight](https://ai-powered.com/mcp/paystage-preflight-2): PayStage Preflight is an open-source MCP server for finance and payments.
- [PayStage Preflight](https://ai-powered.com/mcp/paystage-preflight): PayStage Preflight is an open-source MCP server for finance and payments.
- [PayStage](https://ai-powered.com/mcp/paystage-2): PayStage is an open-source MCP server for security.
- [Clawpay](https://ai-powered.com/mcp/clawpay): Clawpay is an open-source MCP server for finance and payments.
- [MoneyTools payment-safety suite](https://ai-powered.com/mcp/moneytools-payment-safety-suite): MoneyTools payment-safety suite is a freemium MCP server for finance and payments.
- [PayStage](https://ai-powered.com/mcp/paystage): PayStage is an open-source MCP server for finance and payments.
- [SpendPreflight](https://ai-powered.com/mcp/spendpreflight): SpendPreflight is a freemium MCP server for finance and payments.

---
Source: https://ai-powered.com/mcp/paystage-x402-guard-payment-safety-before-the-wallet-signs
