@zenfix/intent-swap-mcp
v0.1.0
Published
MCP server for intent-based DeFi swaps — swap tokens with natural language
Maintainers
Readme
intent-swap MCP Server
An MCP (Model Context Protocol) server that lets AI agents execute DeFi swaps via natural language.
What it does
Connect this to Claude Desktop (or any MCP-compatible agent) and say:
"Swap 1 ETH for USDC"
"把0.5个以太换成USDT"
"Get me a quote for swapping 100 USDC to DAI"
The agent will parse your intent, fetch a real-time Uniswap V3 quote, and build the transaction for your wallet to sign.
Tools
| Tool | Description |
|------|-------------|
| parse_swap_intent | Natural language → structured swap params |
| get_token_price | Real-time USD price via CoinGecko |
| get_swap_quote | Live Uniswap V3 quote (best fee tier auto-selected) |
| build_swap_tx | Generate calldata for wallet signing |
| list_supported_tokens | All supported tokens with prices |
Supported Tokens
ETH, WETH, WBTC, USDC, USDT, DAI, ARB, UNI, LINK, MATIC, OP, PEPE, SHIB, AAVE, CRV
Setup
Install
npm install -g intent-swap-mcpClaude Desktop config
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"intent-swap": {
"command": "intent-swap-mcp",
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}OPENAI_API_KEY is optional — without it, the server uses rule-based parsing (works for most common intents).
Run locally (dev)
git clone https://github.com/Lovelle-Zhang/intent-swap
cd projects/intent-swap-mcp
npm install
npm run devArchitecture
User (natural language)
↓
parse_swap_intent → structured { fromToken, toToken, amount, ... }
↓
get_swap_quote → real-time Uniswap V3 quote (QuoterV2 on-chain)
↓
build_swap_tx → calldata for SwapRouter02
↓
User wallet signs & broadcastsNo custody. No API keys for on-chain operations. The server never holds private keys.
Security
- The server never requests or stores private keys
build_swap_txonly generates calldata — the user must sign in their own wallet- ERC-20 swaps require a separate
approvetransaction (noted in the response)
Roadmap
- [ ] ERC-4337 (Account Abstraction) support for smart contract wallets
- [ ] Multi-hop routing
- [ ] Conditional orders ("buy ETH when it drops below $3000")
- [ ] Arbitrum / Base / Optimism support
- [ ] Publish to npm
License
MIT
