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://api.xdcai.tech/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 on the XDC network only (mainnet, chainId 50). The address is an EVM address that looks identical on every chain, so USDC sent on Ethereum, Polygon, or any other network will not arrive and may be lost. 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
How to ask your agent
Agents pay for exactly what you ask. Include the word marketplace so the agent discovers a live API and calls it, instead of answering from memory or guessing a URL.
Check the XDC AI marketplace for a USDC-on-XDC data API and call it.
List the marketplace services, then use the most relevant one to get the ADGM compliance rules.
Search the marketplace for rates, USDC, and summary, then pay for the best match.
Show the most-used services in the marketplace.
Show my transaction history with the tx hashes and xdcscan links.
Verify that a given transaction hash went through.
Trigger words that make the agent discover first: marketplace, list services, search the marketplace, most-used. Without them, an agent may answer from memory instead of calling a live, paid API.
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.