Add XDC AI to your agent
Pick your client below for exact steps. There are two install methods: sandboxed apps (claude.ai, ChatGPT) add the MCP connector - the flow runs server-side; apps with a terminal (Claude Code, Cursor, Codex, Hermes) run the CLI. Use 'Share' on a tab to copy a direct link to it.
Add the MCP connector
In claude.ai open Settings → Connectors → Add custom connector, name it XDC AI, and paste this URL:
https://xdctaskman-x402-server.vercel.app/mcpTools: login_start / login_verify, wallet_address / wallet_balance, marketplace_list, call, wallet_transfer.
Four commands, start to paid call
- 1
Install the CLI
Run it with npx, or wire the skill so the agent drives it autonomously.
npx xdcai --help - 2
Log in → get an XDC wallet
Email + one-time code. A custodial XDC wallet is created for the account (same email → same address, every machine).
npx xdcai login npx xdcai wallet address - 3
Fund with USDC
Send USDC to the wallet address. Gas is sponsored - no native XDC needed.
npx xdcai wallet balance - 4
Discover & call
Search the marketplace for the most relevant service, then call any x402 URL. On 402 the CLI signs a USDC authorization, resends with X-PAYMENT, and returns the result. --search ranks live services by tags + capability (comma-separated terms, best match first).
npx xdcai marketplace list --search weather,forecast npx xdcai call https://provider.example/x402/endpoint
Gasless by design
The agent signs an off-chain USDC authorization; a relayer submits it and pays the XDC gas. The agent only ever spends USDC - never gas, never a seed phrase.
Agent
Signs an EIP-3009 USDC authorization off-chain (X-PAYMENT).
Facilitator
Relayer verifies + submits it, paying the XDC gas.
Provider
USDC settles on XDC; the API returns its result.
Deterministic, parseable output
Every command prints exactly one JSON object to stdout. Logs and prompts go to stderr, so parsing stays clean.
# stdout - one JSON object per command
call → { "ok": true, "status": 200, "paid": "0.01 USDC", "txHash": "0x...", "explorer": "https://xdcscan.com/tx/0x...", "result": { ... } }
wallet transfer → { "success": true, "amount": "0.5", "token": "USDC", "to": "0x...", "txHash": "0x...", "explorer": "https://xdcscan.com/tx/0x..." }
login → { "loggedIn": true, "email": "...", "address": "0x..." }
whoami → { "loggedIn": true, "ownerId": "privy:...", "email": "...", "address": "0x..." }
# any failure
→ { "error": "<message>" } # and a non-zero exit code
# tip: set LOG_LEVEL=error to silence info logsCrawling this for an agent?
Everything here is also available as plain text/JSON so an LLM can read it directly:
Browse live services on the marketplace, or list your own API.