Menu

Explorer & Settings

Tempo Explorer Submit Project
Back to all projects

x402r-mcp

by mrtinhnguyen · Updated 6 months ago

MCP server enabling AI agents to make x402 payments and use x402r refund protocol

In the AI payments ecosystem

x402r-mcp is an early-stage project in the AI payments / x402 ecosystem. It currently has 0 GitHub stars and 1 forks.

README.md View on GitHub →

x402r MCP Server

MCP server enabling AI agents to make x402 payments and interact with the x402r refund protocol.

Quick Start

pnpm install
pnpm run build
pnpm run inspector  # Test tools interactively

Configuration

Set environment variables:

EVM_PRIVATE_KEY=your_private_key        # Required
PINATA_API_KEY=your_key                  # Required for refund requests
PINATA_SECRET_KEY=your_secret            # Required for refund requests

Get free Pinata keys at pinata.cloud.

MCP Client Setup

Add to your MCP client config (Claude Desktop, VS Code, Cursor):

{
  "mcpServers": {
    "x402r": {
      "command": "node",
      "args": ["/path/to/x402r-mcp/build/index.js"],
      "env": {
        "EVM_PRIVATE_KEY": "0x..."
      }
    }
  }
}

Config locations:

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json
  • VS Code: .vscode/mcp.json

Tools

Tool Description
x402_fetch HTTP requests with automatic x402 payment handling
check_balance Check USDC balance
get_wallet_info Display wallet and network info
get_user_deposits List escrow deposits with refund eligibility
check_deposit_refundable Check if deposit is within refund window
create_refund_request Submit encrypted refund request (Lit Protocol + IPFS)
get_refund_request_status Check refund status
decrypt_refund_request Decrypt refund details (authorized parties only)

E2E Testing

Quick way to test the full refund flow:

  1. Create 3 test wallets — merchant, arbiter, client
  2. Start a sample merchant server using x402r-extensions example
  3. Register merchant & arbiter at app.x402r.org
  4. Test as client — use pnpm run inspector with this MCP server to make payments and request refunds
  5. Handle disputes — log in as arbiter at app.x402r.org to approve/deny refunds

Related

All MCP projects →