Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

MCP server that enables AI agents to automatically pay for and access paywalled content via the x402 payment protocol.

README.md

x402-fetch-mcp

MCP (Model Context Protocol) server that enables AI agents to automatically pay for and access paywalled content using the x402 payment protocol.

What is x402?

x402 is a payment protocol that uses HTTP status code 402 (Payment Required) to enable micropayments for web content. When an AI agent encounters a 402 response, this MCP server automatically handles the payment using USDC on Base network.

Features

  • Automatic Payments: Seamlessly handles 402 Payment Required responses
  • Secure Key Storage: Private keys stored in ~/.x402/config.json (not environment variables)
  • Base Network Support: Works with Base Sepolia (testnet) and Base (mainnet)
  • Claude Code Integration: Works directly with Claude Code via MCP

Quick Start

1. Install and Setup

# Run the setup wizard
npx x402-fetch-mcp setup

You'll be prompted for:

  • Private Key: Your wallet's private key (0x... format)
  • Network: baseSepolia (testnet) or base (mainnet)

2. Add to Claude Code

claude mcp add x402 -- npx x402-fetch-mcp

3. Verify Installation

claude mcp list
# Should show: x402 - ✓ Connected

Usage

Once installed, Claude Code can automatically access paywalled content:

User: Fetch the content from https://learn402.xyz/demo/protected-content

Claude: I'll use the x402_fetch tool to access this paywalled content...
[Automatically pays $0.01 USDC and retrieves content]

Available Tools

x402_fetch

Fetches content from a URL with automatic x402 payment support.

Parameters:

  • url (required): The URL to fetch
  • method (optional): HTTP method (GET, POST, etc.)
  • headers (optional): Additional headers
  • body (optional): Request body for POST/PUT

x402_wallet_info

Returns information about the configured wallet.

Configuration

Config file location: ~/.x402/config.json

{
  "privateKey": "0x...",
  "network": "baseSepolia"
}

Check Configuration

npx x402-fetch-mcp-setup info

Update Configuration

npx x402-fetch-mcp setup
# Choose 'y' to overwrite existing config

Security

  • Private keys are stored in ~/.x402/config.json with 600 permissions
  • Keys are NOT stored in environment variables (prevents exposure via env command)
  • Never share your config file or commit it to version control

Network Support

| Network | Chain ID | USDC Contract | |---------|----------|---------------| | Base Sepolia | 84532 | 0x036CbD53842c5426634e7929541eC2318f3dCF7e | | Base | 8453 | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |

Getting Test USDC

For Base Sepolia testnet:

  1. Get testnet ETH from Base Sepolia Faucet
  2. Get test USDC from Circle Faucet

Demo

Try the x402 payment flow at learn402.xyz

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Finance & Payments servers.