Fetches a price quote for a Uniswap swap with parameters for chain, tokens, amounts, and trade type
Executes a token swap on Uniswap with configurable slippage tolerance and deadline
Uniswap Trader is a specialized tool that enables AI agents to interact with the Uniswap decentralized exchange across multiple blockchain networks. It provides real-time price quotes, executes token swaps with configurable parameters, and generates trading suggestions based on liquidity and fees. With support for eight major blockchains including Ethereum, Optimism, Polygon, and Arbitrum, this tool allows for seamless cross-chain trading operations. The MCP server handles complex operations like multi-hop route optimization and slippage tolerance configuration, making decentralized trading accessible to AI systems.
Uniswap Trader is an MCP server that enables AI agents to interact with the Uniswap decentralized exchange (DEX) across multiple blockchain networks. It simplifies the process of getting price quotes and executing token swaps with optimized routes and configurable parameters.
Before using Uniswap Trader, you'll need:
If you're using Claude Desktop, you can install Uniswap Trader automatically using Smithery:
npx -y @smithery/cli install @kukapay/uniswap-trader-mcp --client claude
git clone https://github.com/kukapay/uniswap-trader-mcp.git
cd uniswap-trader-mcp
npm install
To use Uniswap Trader with your AI assistant, you'll need to add it to your configuration file. Make sure to replace the placeholder values with your actual Infura key and wallet private key:
{
"mcpServers": {
"Uniswap-Trader-MCP": {
"command": "node",
"args": ["path/to/uniswap-trader-mcp/index.js"],
"env": {
"INFURA_KEY": "your_infura_key",
"WALLET_PRIVATE_KEY": "your_private_key"
}
}
}
}
Uniswap Trader works with the following blockchain networks:
| Chain ID | Name | Notes | |----------|------|-------| | 1 | Ethereum | Main Uniswap network | | 10 | Optimism | Layer 2 solution | | 137 | Polygon | Fast and low-cost transactions | | 42161 | Arbitrum | Layer 2 scaling solution | | 42220 | Celo | Mobile-first blockchain | | 56 | BNB Chain | Binance Smart Chain | | 43114 | Avalanche | High-throughput chain | | 8453 | Base | Coinbase's Layer 2 network |
Each chain must be properly configured in the chainConfigs.js
file with valid RPC URLs, WETH addresses, and SwapRouter addresses.
You can ask for price quotes between any supported tokens on the available networks:
Get me a price quote for swapping 1 ETH to DAI on Ethereum.
To perform an actual token swap:
Swap 0.1 ETH for USDC on Polygon with a 0.5% slippage tolerance.
For more complex operations, you can specify exact parameters:
Get a price quote for swapping 500 USDC to ETH on Arbitrum using exactIn trade type.
If you encounter issues: