anchor-x402

v0.3.2
io.github.hypeprinter007-stack/anchor-x402 Checked 1 day ago Published 3 months ago

x402-paid agent tools: 18 over HTTP, 14 over stdio.

Values you need

VariableWhat it is
ANCHOR_WALLET_PRIVATE_KEYrequired secret EVM private key (0x-prefixed hex). The wallet pays for x402 calls in USDC on Base mainnet. Fund with USDC before use.

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add anchor-x402 -e 'ANCHOR_WALLET_PRIVATE_KEY=<ANCHOR_WALLET_PRIVATE_KEY>' -- npx -y anchor-x402-mcp@0.2.3
Add to claude_desktop_config.json
{
  "mcpServers": {
    "anchor-x402": {
      "args": [
        "-y",
        "anchor-x402-mcp@0.2.3"
      ],
      "command": "npx",
      "env": {
        "ANCHOR_WALLET_PRIVATE_KEY": "<ANCHOR_WALLET_PRIVATE_KEY>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "anchor-x402": {
      "args": [
        "-y",
        "anchor-x402-mcp@0.2.3"
      ],
      "command": "npx",
      "env": {
        "ANCHOR_WALLET_PRIVATE_KEY": "<ANCHOR_WALLET_PRIVATE_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "ANCHOR_WALLET_PRIVATE_KEY",
      "id": "anchor-wallet-private-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "anchor-x402": {
      "args": [
        "-y",
        "anchor-x402-mcp@0.2.3"
      ],
      "command": "npx",
      "env": {
        "ANCHOR_WALLET_PRIVATE_KEY": "${input:anchor-wallet-private-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.anchor-x402]
command = "npx"
args = ["-y", "anchor-x402-mcp@0.2.3"]
env = { "ANCHOR_WALLET_PRIVATE_KEY" = "<ANCHOR_WALLET_PRIVATE_KEY>" }

Remote (hosted)

Run in a terminal
claude mcp add --transport http anchor-x402 https://api.anchor-x402.com/mcp
Add to Settings → Connectors → Add custom connector (or claude_desktop_config.json via mcp-remote)
{
  "mcpServers": {
    "anchor-x402": {
      "args": [
        "-y",
        "mcp-remote",
        "https://api.anchor-x402.com/mcp"
      ],
      "command": "npx"
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "anchor-x402": {
      "url": "https://api.anchor-x402.com/mcp"
    }
  }
}
Add to .vscode/mcp.json
{
  "servers": {
    "anchor-x402": {
      "type": "http",
      "url": "https://api.anchor-x402.com/mcp"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.anchor-x402]
command = "npx"
args = ["-y", "mcp-remote", "https://api.anchor-x402.com/mcp"]

For AI agents

  1. Ask the user for: ANCHOR_WALLET_PRIVATE_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: anchor_hash, screen_wallet, attest_decision, decode_tx, resolve_name, token_price, decode_calldata, parse_datetime, ….
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json