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

  1. Start the dev stack: npm run dev
  2. Build MCP server: pnpm run build -w @xdex/mcp-server
  3. Copy MCP config from /agents/cursor-mcp.json
  4. Ask your agent to list_pools then quote_swap

MCP tools

ToolDescription
list_poolsAll indexed pools
get_poolPool details by address
get_statsGlobal TVL/volume
quote_swapOn-chain swap quote
build_swap_txUnsigned calldata (no signing)
simulate_swapeth_call preview
get_limit_order_signing_instructionsEIP-191 message format

Safety rules

  • Never expose MCP or API to the public internet without authentication
  • build_swap_tx returns 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