# mcp-x402

mcp-x402 was built for x402 payments, including protected-resource payments and paywall management. Its live endpoint is currently unavailable.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/crypto/x402
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-x402

## What it does

mcp-x402 is intended to expose x402 payment operations through MCP. Its tools cover paying for a protected resource, checking settlement, managing paywalls, reading a USDC balance, reviewing payment records, and listing supported networks and facilitators.

The setup expects `X402_API_KEY` and `X402_WALLET_ADDRESS`; `X402_NETWORK` can select `base` or `solana`, with `base` listed as the default. The server currently cannot reach a service because `api.x402.org` fails DNS resolution, so installing the package does not provide a working payment connection.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `X402_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-x402 -e X402_API_KEY=<X402_API_KEY> -- npx -y @codespar/mcp-x402
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add x402 --env X402_API_KEY=<X402_API_KEY> -- npx -y @codespar/mcp-x402
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "x402": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-x402"
            ],
            "env": {
                "X402_API_KEY": "<X402_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "x402": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-x402"
            ],
            "env": {
                "X402_API_KEY": "<X402_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e X402_API_KEY=<X402_API_KEY> x402 npx -y @codespar/mcp-x402
```
Replace <…> with your own values

## When to use it
- pay for an HTTP 402-protected resource
- verify that an x402 payment settled
- create or remove an x402 paywall
- check the USDC payment balance
- review payment records with filters

## Example prompts
- Ask the agent to check the USDC balance with `get_balance`.
- Ask it to verify whether a payment was received and settled with `verify_payment`.
- Ask it to list supported networks, tokens, and facilitators with `get_supported_networks`.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
