x402engine

50+ pay-per-call APIs for AI agents via HTTP 402 crypto micropayments. $0.001–$0.12 per call with USDC and USDm.

x402engine-mcp

MCP server for x402 Engine — giving AI agents access to 16 pay-per-call APIs via HTTP 402 micropayments.

Payments are made with USDC on Base, USDC on Solana, or USDm on MegaETH. Prices range from $0.001 to $0.12 per call.

Quick Start

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "x402engine": {
      "command": "npx",
      "args": ["-y", "x402engine-mcp"],
      "env": {
        "X402_DEV_BYPASS": "your-dev-bypass-secret"
      }
    }
  }
}

Claude Code

claude mcp add x402engine -- npx -y x402engine-mcp

Available Tools

Image Generation

ToolPriceDescription
generate_image$0.015-$0.12AI image generation (fast/quality/text tiers)

Code Execution

ToolPriceDescription
execute_code$0.005Sandboxed code execution (Python, JS, Bash, R)

Audio

ToolPriceDescription
transcribe_audio$0.10Audio-to-text transcription (Deepgram Nova-3)

Crypto & Market Data

ToolPriceDescription
get_crypto_price$0.001Current crypto prices
get_crypto_markets$0.002Top coins by market cap
get_crypto_history$0.003Historical price charts
get_trending_crypto$0.001Trending coins
search_crypto$0.001Search for coins

Blockchain & Wallet

ToolPriceDescription
get_wallet_balances$0.005Token balances for any wallet
get_wallet_transactions$0.005Transaction history
get_wallet_pnl$0.01Profit & loss analysis
get_token_prices$0.005DEX-derived token prices
get_token_metadata$0.002Token metadata

IPFS Storage

ToolPriceDescription
pin_to_ipfs$0.01Pin JSON to IPFS
get_from_ipfs$0.001Retrieve content from IPFS

Discovery

ToolPriceDescription
discover_servicesFreeList all services and pricing

Environment Variables

VariableRequiredDescription
X402_BASE_URLNoGateway URL (default: https://x402-gateway-production.up.railway.app)
X402_DEV_BYPASSNoDev bypass secret to skip payments
X402_PAYMENT_HEADERNoPre-signed payment header

Payment Networks

  • Base (EVM) — USDC, 6 decimals, ~2s confirmation
  • Solana — USDC, 6 decimals, ~400ms confirmation
  • MegaETH (EVM) — USDm, 18 decimals, ~10ms confirmation

How It Works

  1. Agent calls an MCP tool (e.g., get_crypto_price)
  2. MCP server makes HTTP request to x402engine.app
  3. Gateway returns 402 Payment Required with pricing
  4. Agent pays with crypto via the x402 protocol
  5. Gateway verifies payment on-chain and returns data

For automatic payment handling, use @x402/fetch in your agent code.

Links

Related Servers