Agent API
NeoXSwap Agent Integration
Programmatic access for AI agents via MCP and REST. Quote and build unsigned swaps on local Anvil — agents sign transactions locally.
Quick start
- Start the dev stack:
npm run dev - Build MCP server:
pnpm run build -w @xdex/mcp-server - Copy MCP config from /agents/cursor-mcp.json
- Ask your agent to
list_poolsthenquote_swap
MCP tools
| Tool | Description |
|---|---|
| list_pools | All indexed pools |
| get_pool | Pool details by address |
| get_stats | Global TVL/volume |
| quote_swap | On-chain swap quote |
| build_swap_tx | Unsigned calldata (no signing) |
| simulate_swap | eth_call preview |
| get_limit_order_signing_instructions | EIP-191 message format |
Safety rules
- Never expose MCP or API to the public internet without authentication
build_swap_txreturns unsigned transactions — sign with your wallet- Native-out swaps must use
multicall(handled by SDK) - Default chain is Anvil 31337; testnet requires explicit env flags