# A402 Pay MCP

> A402 Pay MCP is an open-source MCP server for agent payments. MCP server that pays x402 APIs on Solana from your own wallet under strict spending rules. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, API
- **Repository:** https://github.com/agent402-dev/agent402-toolkit/tree/HEAD/packages/pay-mcp
- **MCP Registry name:** io.github.agent402-dev/a402-pay-mcp
- **Categories:** [agent payments](https://ai-powered.com/categories/agent-payments)
- **Listing updated:** 2026-11-20

## About

The README says this server lets an AI agent call x402 paid HTTP APIs on Solana and settle in USDC, or in A402 if you explicitly enable it. Payments are signed from a wallet key file on your own machine, and nothing is signed unless every configured rule passes. Out of the box, with no allowlists set, every payment is refused.

Each request is checked against allowed domains, trusted recipient addresses, per-payment and per-day USDC caps, a daily payment count, and optional human confirmation through MCP elicitation. A402 has its own two limits, both of which must be set before any A402 payment is made. The server also keeps a local JSONL payment log, and daily totals are counted from that file.

It suits developers and operators who want an agent to buy API access without giving it an open-ended wallet. The project's documentation stresses using a small, dedicated wallet, since the server does not hold funds, run a facilitator, or exchange currencies.

## Features

- **Rules checked before signing:** Every payment must pass domain, recipient, asset and amount rules before a transaction is signed.
- **Default-deny configuration:** With no allowlists configured, all payments are refused until the user sets them.
- **Spending caps:** Per-payment and per-UTC-day USDC limits, plus a daily payment count, bound total exposure.
- **Human confirmation option:** Payments at or above a set amount can require approval via MCP elicitation.
- **Quote binding:** Passing a quoteId from x402_quote refuses payment if the amount, asset or recipient changed.
- **Local payment history:** A payment_history tool reads a local log that never stores keys or signed payloads.

## Good for

- Let an agent pay small per-call fees for x402-protected APIs within a fixed daily budget
- Check payment requirements for a URL with x402_quote before deciding whether to pay
- Review recent agent payments and settlement transaction IDs from a local log
- Restrict an agent to a short list of approved API domains and recipient addresses

## Install

### Claude Code (Terminal)

```sh
claude mcp add a402-pay-mcp --env X402_RPC_URL='<X402_RPC_URL>' -- npx -y @agent402-dev/pay-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "a402-pay-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@agent402-dev/pay-mcp"
      ],
      "env": {
        "X402_RPC_URL": "<X402_RPC_URL>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "a402-pay-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@agent402-dev/pay-mcp"
      ],
      "env": {
        "X402_RPC_URL": "<X402_RPC_URL>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "a402-pay-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@agent402-dev/pay-mcp"
      ],
      "env": {
        "X402_RPC_URL": "<X402_RPC_URL>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "a402-pay-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@agent402-dev/pay-mcp"
      ],
      "env": {
        "X402_RPC_URL": "<X402_RPC_URL>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "a402-pay-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@agent402-dev/pay-mcp"
      ],
      "env": {
        "X402_RPC_URL": "<X402_RPC_URL>"
      }
    }
  }
}
```

## Tools

- `x402_fetch`: Fetch a URL and pay only if the rules pass.
- `x402_quote`: Show payment requirements and which rules pass; never signs; returns quoteId.
- `wallet_status`: Show address, balances, today's usage, limits and allowlists.
- `payment_history`: Show the local payment log.

## FAQ

### What happens if I do not configure any limits or allowlists?

Every payment is refused. The README says the allowed domains and trusted recipient variables must be set, and without them nothing is paid.

### Can A402 Pay MCP pay in A402 as well as USDC?

Yes, but only if A402 is listed in the allowed assets and both A402 limits are set. Otherwise A402 payments are refused.

### Does the server hold funds or evaluate the APIs A402 Pay MCP pays?

No. The README states it does not hold funds, operate a facilitator, or judge tokens or APIs, and it signs from the user's own wallet.

### How do I install A402 Pay MCP?

The README gives Claude Code and Claude Desktop examples that run the npm package with npx, and requires Node 20 or newer.

### Is A402 Pay MCP free?

Yes. A402 Pay MCP is open source, so you can use and self-host it for free.

### How do I add A402 Pay MCP to Claude Code?

Run this command in your terminal: claude mcp add a402-pay-mcp --env X402_RPC_URL='<X402_RPC_URL>' -- npx -y @agent402-dev/pay-mcp

### What are the best alternatives to A402 Pay MCP?

The closest alternatives to A402 Pay MCP are X402 Payagent MCP, X402engine MCP, Hilt Pay Agent Commerce, AgnicPay and Clawpay.

## Where this comes from

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

## Alternatives

- [X402 Payagent MCP](https://ai-powered.com/mcp/x402-payagent-mcp): X402 Payagent MCP is an open-source MCP server for finance and payments.
- [X402engine MCP](https://ai-powered.com/mcp/x402engine-mcp): X402engine MCP is a paid MCP server for agent tooling.
- [Hilt Pay Agent Commerce](https://ai-powered.com/mcp/hilt-pay-agent-commerce): Hilt Pay Agent Commerce is an MCP server for agent payments.
- [AgnicPay](https://ai-powered.com/mcp/agnicpay): AgnicPay is an MCP server for agent payments.
- [Clawpay](https://ai-powered.com/mcp/clawpay): Clawpay is an open-source MCP server for finance and payments.
- [x402 Trust Board](https://ai-powered.com/mcp/x402-trust-board): x402 Trust Board is a freemium MCP server for agent payments.
- [Pay](https://ai-powered.com/mcp/pay): Pay is a paid MCP server for agent payments.
- [Nory X402](https://ai-powered.com/mcp/nory-x402): Nory X402 is an MCP server for agent payments.

---
Source: https://ai-powered.com/mcp/a402-pay-mcp
