Submit

X402 Payment Gated Http

@merkleworks

Use: Allows AI agents to call payment-gated HTTP APIs using the x402 protocol. Send a request; if the server returns 402 Payment Required, the MCP server handles the challenge, payment, and retry with proof, then returns the API response. Primary tool: paid_http_request.
Overview

What it does
x402 Payment-Gated HTTP lets AI agents call HTTP APIs that use the x402 protocol. If the API responds with 402 Payment Required, the MCP server handles the challenge, builds the payment, and retries with a proof, then returns the final response.

Primary tool

  • paid_http_request — Send a request to a URL; if the server returns 402, the flow (parse challenge → pay → retry with proof) runs automatically and the tool returns the API response.

Other tools

  • discover_x402_api — Find payable endpoints (e.g. from /.well-known/x402 or by probing).
  • pay_x402_endpoint — Call a known x402 endpoint with full control.
  • parse_x402_challenge / verify_x402_proof — Inspect and verify x402 headers.

Install

npx @merkleworks/x402-mcp

Example (Cursor)
Add to .cursor/mcp.json:

{
  "mcpServers": {
    "x402": {
      "command": "npx",
      "args": ["@merkleworks/x402-mcp"]
    }
  }
}

Example tool call

  • Tool: paid_http_request

  • Input: { "url": "https://your-x402-api.example.com/v1/expensive", "method": "GET" }

Server Config

{
  "mcpServers": {
    "x402": {
      "command": "npx",
      "args": [
        "@merkleworks/x402-mcp"
      ]
    }
  }
}
© 2025 MCP.so. All rights reserved.

Build with ShipAny.