[SwapWizard]
SwapWizard MCP Server
[npm]
[License: MIT]
Model Context Protocol (MCP) server for the SwapWizard DeFi API. Enables AI agents to get swap quotes, manage liquidity, and discover pools across 5 EVM chains.
Non-custodial: every tool returns router, callData, and value — the agent presents the transaction, the user signs with their own wallet. SwapWizard never holds keys.
Quick Start
1. Get an API Key
Go to swapwizard.xyz/integrators, connect your wallet, and sign a message (no gas cost).
2. Connect via MCP
Remote (no install)
Local — Claude Desktop
Add to claude_desktop_config.json:
Local — Cursor
Add to .cursor/mcp.json:
Local — Claude Code
Available Tools
All quote tools (get_swap_quote, get_clean_quote, zap_into_lp_position, zap_out_of_lp_position) accept an optional affiliateCode — an affiliate wallet address registered on-chain with SwapWizard, forwarded to the API so the affiliate fee is paid to that address.
Concentrated Liquidity Support
SwapWizard is not limited to classic V2-style LPs — 13 of the 22 integrated protocols are concentrated-liquidity (CL) AMMs, with full range management:
- Custom price ranges —
zap_into_lp_position accepts tickLower / tickUpper to mint a CL position in any range (omit for the protocol default). Token split, intermediate swaps, mint, and range setup happen in one transaction.
- Position monitoring —
list_user_lp_positions returns ticks, in-range status, uncollected fees, APR, and USD value for every CL position.
- Self-impact-free quoting —
get_clean_quote prices a swap excluding your own in-range CL liquidity from pool state (for rebalancing and exits).
- Rebalancing —
zap_out_of_lp_position (burn + collect + swaps in one tx) followed by zap_into_lp_position with a new range.
Protocols by chain
A built-in Split Router additionally splits orders across multiple DEXes on all 5 chains. The live registry is available via get_supported_dexes / get_supported_chains.
Execution Model
Tools that return router, callData, value are executed by the user:
- If the input token is not native, approve the router to spend the token amount (ERC-20 approve)
- Send a transaction:
to: router, data: callData, value: value
The agent presents the transaction — the user signs with their own wallet.
Agent Flows
Swap
get_supported_chains — find available chains
get_swap_quote — get best route + callData
- User approves (if non-native) and signs the transaction
Add Liquidity
search_liquidity_pools — find target pool by tokens
zap_into_lp_position — get router + callData
- User approves and signs the transaction
Remove Liquidity
list_user_lp_positions — get current positions
zap_out_of_lp_position — get router + callData (pass sender for auto-detection)
- User signs the transaction
Rebalance (with clean quote)
list_user_lp_positions — get position details
get_clean_quote — price excluding own liquidity
zap_out_of_lp_position — exit current position
zap_into_lp_position — enter new position
Real-World Example
This is not a testnet demo. After configuring a wallet private key and a SwapWizard API key, an autonomous agent was given this single prompt:
The agent discovered SwapWizard MCP, connected, and executed the full lifecycle autonomously. Here is the verified on-chain result:
Agent exits a WLFI/USDC Uniswap V3 position into USDC
On-chain proof: 0xede1afbc...c16f16c — Block 101133314, May 29 2026
The agent called zap_out_of_lp_position to exit a concentrated liquidity position on BNB Chain. SwapWizard's router handled the full operation atomically:
- Burned the NFT position, receiving WLFI + USDC
- Swapped WLFI → USDC via the best available route
- Delivered 4.92 USDC to the user's wallet in a single transaction
The agent requested the quote, the user approved the NFT and signed — no manual parameter tuning, no contract interaction, no slippage calculation. The MCP server auto-detected nftManager, dexName, and liquidityKind from the sender address.
PoC Bot Demos
Full run videos:
Supported Chains
Ethereum (1), Arbitrum (42161), Base (8453), Polygon (137), BNB Chain (56)
Environment Variables
Affiliate Integration
Earn fees by embedding SwapWizard in your site:
Widget modes: swap, pools, or full. Configure at swapwizard.xyz/developers.
Rate Limits
60 requests per minute per API key.
Development
See CONTRIBUTING.md for guidelines.
Links
License
MIT