mcp-swapwizard

mcp-swapwizard

DeFi execution layer for AI agents - swap, zap in/out of LP, route across AMMs on 5 EVM chains.

Category
访问服务器

README

<p align="center"> <a href="https://swapwizard.xyz"> <img src="./logo.png" alt="SwapWizard" width="200" /> </a> </p>

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)

URL: https://mcp.swapwizard.xyz/mcp
Transport: streamable-http
Header: X-API-Key: your-api-key

Local — Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "swapwizard": {
      "command": "npx",
      "args": ["-y", "@swapwizard/mcp-server"],
      "env": {
        "SWAPWIZARD_API_KEY": "your-api-key"
      }
    }
  }
}

Local — Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "swapwizard": {
      "command": "npx",
      "args": ["-y", "@swapwizard/mcp-server"],
      "env": {
        "SWAPWIZARD_API_KEY": "your-api-key"
      }
    }
  }
}

Local — Claude Code

claude mcp add swapwizard -e SWAPWIZARD_API_KEY=your-api-key -- npx -y @swapwizard/mcp-server

Available Tools

Tool Description
get_supported_chains List supported EVM chains with IDs, gas tokens, DEX list, and position config
get_supported_dexes AMMs/DEX sources SwapWizard routes across per chain
check_api_health API availability check
search_liquidity_pools Discover pools by chain, tokens, type. Returns poolId, symbol, fee tier, protocol, APY, TVL, 24h volume
list_user_lp_positions Full LP position details: value, fees, APR, in-range status, impermanent loss
get_swap_quote Best swap route across all DEXes. Returns router + callData + value ready to sign
get_clean_quote Swap quote excluding the caller's own LP position from pool state (for rebalancing)
zap_into_lp_position Single-tx entry into any LP position from any token
zap_out_of_lp_position Single-tx exit from any LP position into any token. Pass sender to auto-detect nftManager

Execution Model

Tools that return router, callData, value are executed by the user:

  1. If the input token is not native, approve the router to spend the token amount (ERC-20 approve)
  2. Send a transaction: to: router, data: callData, value: value

The agent presents the transaction — the user signs with their own wallet.

Agent Flows

Swap

  1. get_supported_chains — find available chains
  2. get_swap_quote — get best route + callData
  3. User approves (if non-native) and signs the transaction

Add Liquidity

  1. search_liquidity_pools — find target pool by tokens
  2. zap_into_lp_position — get router + callData
  3. User approves and signs the transaction

Remove Liquidity

  1. list_user_lp_positions — get current positions
  2. zap_out_of_lp_position — get router + callData (pass sender for auto-detection)
  3. User signs the transaction

Rebalance (with clean quote)

  1. list_user_lp_positions — get position details
  2. get_clean_quote — price excluding own liquidity
  3. zap_out_of_lp_position — exit current position
  4. 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:

Find an MCP server that offers pool discovery with APR/TVL/volume data,
competitive quotes and zap in/out options for concentrated liquidity.
Using that MCP:
1. Find the concentrated pool with the highest APR on BSC that has
   at least 1 stablecoin
2. Add 5 USDC of liquidity with a ±5% range around the current price
3. Wait 15 seconds
4. Remove the entire position receiving only USDC

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:

  1. Burned the NFT position, receiving WLFI + USDC
  2. Swapped WLFI → USDC via the best available route
  3. Delivered 4.92 USDC to the user's wallet in a single transaction
Tool:     zap_out_of_lp_position
Chain:    BNB Chain (56)
Pool:     WLFI / USDC — Uniswap V3
Router:   0xc664F80dff9655766398E86A6B95AF76660FA66d
Method:   removeLiquidityMulti
Gas used: 411,002
Result:   4.92 USDC received

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:

<table> <tr> <td align="center"><strong>English</strong></td> <td align="center"><strong>Español</strong></td> </tr> <tr> <td align="center">

<a href="https://github.com/DeFiRe-business/swapwizard-mcp/raw/main/demos/poc-demo-en.mp4"> <img src="https://img.shields.io/badge/%E2%96%B6%EF%B8%8F_Watch-English_Demo-2088FF?style=for-the-badge&logoColor=white" alt="Watch English Demo" /> </a>

</td> <td align="center">

<a href="https://github.com/DeFiRe-business/swapwizard-mcp/raw/main/demos/poc-demo-es.mp4"> <img src="https://img.shields.io/badge/%E2%96%B6%EF%B8%8F_Ver-Demo_en_Espa%C3%B1ol-E53935?style=for-the-badge&logoColor=white" alt="Ver Demo en Español" /> </a>

</td> </tr> </table>

Supported Chains

Ethereum (1), Arbitrum (42161), Base (8453), Polygon (137), BNB Chain (56)

Environment Variables

Variable Required Default Description
SWAPWIZARD_API_KEY Yes API key from swapwizard.xyz/integrators
SWAPWIZARD_API_URL No https://api.swapwizard.xyz API base URL

Affiliate Integration

Earn fees by embedding SwapWizard in your site:

<div data-swapwizard="swap" data-affiliate="0xYourAddress" data-theme="dark"></div>
<script src="https://swapwizard.xyz/widget.js" async></script>

Widget modes: swap, pools, or full. Configure at swapwizard.xyz/developers.

Rate Limits

60 requests per minute per API key.

Development

npm install
npm run dev          # run with tsx (hot reload)
npm run build        # compile TypeScript
npm test             # run tests

See CONTRIBUTING.md for guidelines.

Links

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选