x402 Wallet
v0.2.3Self-custodial x402 wallet for AI agents: pay any service in USDC or $THREE from your own key.
Values you need
| Variable | What it is | |
|---|---|---|
SOLANA_SECRET_KEY | optional secret | Base58 (or JSON byte-array) Solana secret key that signs payments and holds the USDC. Not needed for the read tools (find_services, inspect_endpoint, or x402_wallet with an explicit address). Treat like cash. |
SOLANA_RPC_URL | optional | Solana mainnet RPC endpoint. Defaults to the public cluster — bring your own (Helius / Quicknode / Triton) for production traffic. Default: https://api.mainnet-beta.solana.com |
MAX_PAY_USD | optional | Max USD a single pay_and_call may spend. Bounds a runaway or injected payment. Default: 1 |
REQUIRE_CONFIRM | optional | When on (default), pay_and_call refuses until re-issued with confirm:true. Set 0/false to disable the gate. Default: true |
THREE_WS_BASE | optional | Base URL of the three.ws API that serves /api/bazaar/search for find_services. Override only when self-hosting. Default: https://three.ws |
npm (npx) verified
Requires Node.js 18+
Run in a terminal
claude mcp add x402-mcp -- npx -y @three-ws/x402-mcp@0.2.3Add to
claude_desktop_config.json{
"mcpServers": {
"x402-mcp": {
"args": [
"-y",
"@three-ws/x402-mcp@0.2.3"
],
"command": "npx"
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"x402-mcp": {
"args": [
"-y",
"@three-ws/x402-mcp@0.2.3"
],
"command": "npx"
}
}
}Add to
.vscode/mcp.json{
"servers": {
"x402-mcp": {
"args": [
"-y",
"@three-ws/x402-mcp@0.2.3"
],
"command": "npx",
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.x402-mcp]
command = "npx"
args = ["-y", "@three-ws/x402-mcp@0.2.3"]For AI agents
- 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).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: x402_wallet, find_services, inspect_endpoint, pay_and_call.
- 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