SuperAPI AI Directory

anchor-x402-mcp

x402 pay-per-call wallet tools on Base and Solana: OFAC screening, wallet intel, hash anchoring, signed attestations, tx decoding and ENS/SNS resolution.

Open website

About this tool

Purpose

anchor-x402-mcp is an MCP server that exposes anchor-x402's services as tools that agents can call directly, commonly used for hash anchoring on Base mainnet and Solana, OFAC screening, wallet intelligence queries, signed attestations, transaction decoding, and ENS/SNS name resolution. It targets MCP-capable clients such as Claude Desktop, Claude Code, Cursor, Codex, and Continue.

Two transport modes

  • stdio (this package): requires a local process holding a funded EVM private key (environment variable ANCHOR_WALLET_PRIVATE_KEY), and that process pays for each call on the user's behalf. It is convenient to use, but it amounts to handing a hot wallet key to the process.
  • Streamable HTTP: POST https://api.anchor-x402.com/mcp, no installation and no need to hand over keys. It exposes all 18 services (four more than this package:roll_random、investigate_wallet、ledger_summary、ledger_report), paid per call via the PAYMENT-SIGNATURE request header, with the key always staying on the user's side. Clients with native support for remote MCP can use that URL directly; clients that only support launching a stdio process can connect through a bridge.

Protocol and payment method

Supported protocol versions:2026-07-28、2025-11-25、2025-06-18、2025-03-26, with the same endpoint covering both the stateless era and the initialize handshake era.server/discover and tools/list are free, whiletools/call is paid. Payment appears inside MCP as an ordinary x402 flow: an unpaid tools/call returns a result (rather than a JSON-RPC error), in which isError: true, the challenge information is located in structuredContent.accepts, and it carries the canonical payment-required header. After signing one of the options, retry the exact same call with PAYMENT-SIGNATURE . Returning the challenge as a result is intentional—the agent can read and pay it, whereas a JSON-RPC error would be swallowed by the client before the model ever sees it.

Tools and fees (stdio version)

14 tools in total, $0.001–$0.05 per call:

  • Commoditized basic capabilities (9 items, $0.001–$0.02)
  • General-purpose LLM endpoints (5 items, $0.01–$0.05), added in v0.2

The investigator (/v1/investigate, $1.77, asynchronous) and the hosted chatbot at chat.anchor-x402.com are not inside MCP and are accessed directly via the HTTP API and the browser, respectively.

Usage (configuration examples)

Claude Desktop: edit ~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or %APPDATA%\Claude\claude_desktop_config.json(Windows), then restart to let the agent call it. Example prompt: “Anchor the hash 7646dda1564bde0ef3f3971f4c002962df64246da4aa1d8c47247e7632494710 on mainnet”—it will call anchor_hash and pay $0.005 USDC from the wallet. Project-level: add it to the project's .mcp.json. Codex CLI (OpenAI): edit ~/.codex/config.toml, restart codex, and enter /mcp to confirm that anchor-x402 appears in the list of loaded servers. ChatGPT Desktop: Settings → Integrations → MCP servers → Add server, paste the configuration and restart, and the 14 tools will appear in any conversation with tool use enabled. Cursor: edit ~/.cursor/mcp.json(global) or <project>/.cursor/mcp.json(project scope). OpenAI Agents SDK (programmatic): the same package and environment variables, driven programmatically rather than by configuration. Continue / Smithery / generic MCP clients:command: npx,args: [-y, anchor-x402-mcp], with the wallet key carried in env; the MCP SDK handles the transport. It can also be installed via Smithery with a one-line command (replace --client claude with cursor、codex、windsurf etc.). The server speaks the MCP protocol over stdio and can be piped into any MCP-compatible client.

Wallet Funding

You need to prepare USDC on the Base mainnet for the wallet corresponding to ANCHOR_WALLET_PRIVATE_KEY . Any amount works—even $1 can buy 100 anchor calls or 1000 commodity-layer calls. USDC contract on Base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. You can bridge from Ethereum mainnet via bridge.base.org, or buy directly on Coinbase and withdraw to Base.

Payment Mechanism

The MCP server signs payments via x402 (Coinbase's open HTTP-native micropayment protocol). For each request: hit the anchor-x402 endpoint → receive a 402 with payment requirements → the server signs a USDC transfer authorization with your private key → retry the request with the signed payment, and the API settles through Coinbase's facilitator. Sub-second completion, no ledger, no account.

Environment Variables and Security Recommendations

If ANCHOR_WALLET_PRIVATE_KEYis not set, paid tool calls will return a friendly 402 message explaining how to set it./health and /openapi.json(not exposed as tools, but accessible via direct curl) work without payment. The private key is stored in the MCP client's configuration file. It should be treated as a hot wallet—only put in an amount you are willing to let it spend autonomously. Recommendations: generate a new wallet specifically for agent use; top it up regularly; do not reuse a wallet holding large funds. This MCP server only signs USDC payment authorizations to the treasury addresses known to anchor-x402 (visible in the 402 response), and cannot transfer wallet funds to arbitrary addresses. The source code is fully open source; auditing before installation is recommended.

Verifying Anchor Receipts

Every anchor_hash and attest_decision call returns Base + Solana transaction URLs that can be independently verified on public block explorers without paying again:

  • Base:https://basescan.org/tx/<base.tx> — the Input Data field contains the merkle root
  • Solana:https://solscan.io/tx/<solana.tx> — the Memo program data contains the same hex On-chain bytes are the receipt; the API response is just a convenient wrapper around it.

Troubleshooting

  • "Payment required (402). Set ANCHOR_WALLET_PRIVATE_KEY...": wallet not configured; add the environment variable to the MCP configuration and restart Claude Desktop.
  • "Payment failed (402). The wallet may be out of USDC...": insufficient wallet balance. Send USDC on Base to the address shown in the server startup logs (written to stderr as payer=0x… ).
  • "anchor-x402 request failed: ...": network or DNS issue. Check whether https://api.anchor-x402.com/health returns 200; otherwise check the status page.

Related Links

  • Live API:https://api.anchor-x402.com
  • MCP over HTTP:https://api.anchor-x402.com/mcp(全部 18 tools, no need to hand over keys)
  • MCP server card:https://anchor-x402.com/.well-known/mcp/server-card.json
  • Site/trust portal:https://anchor-x402.com
  • Status page:https://anchor-x402.betteruptime.com
  • Server source code:https://github.com/hypeprinter007-stack/anchor-x402
  • MCP server source code (this repository):https://github.com/hypeprinter007-stack/anchor-x402-mcp
  • x402 protocol:https://github.com/coinbase/x402
  • MCP specification:https://modelcontextprotocol.io