by kukapay
Automates token swaps on Uniswap DEX across multiple blockchains for AI agents, providing real-time price quotes, optimized routing, and configurable trade execution.
Automates token swaps on Uniswap V3 for AI agents, supporting eight EVM‑compatible chains. It delivers real‑time price quotes, multi‑hop route optimization, and execution with slippage and deadline controls.
INFURA_KEY
and WALLET_PRIVATE_KEY
.serverConfig
.getPrice
and executeSwap
through the Model Context Protocol, supplying required parameters such as chainId
, tokenIn
, tokenOut
, amounts, and trade type.getPrice
and executeSwap
schemas designed for seamless integration with AI agents.Q: Which blockchains are supported? A: Ethereum, Optimism, Polygon, Arbitrum, Celo, BNB Chain, Avalanche, and Base.
Q: How do I set the slippage tolerance?
A: Provide slippageTolerance
(percentage) in the executeSwap
request; default is 0.5%.
Q: What environment variables are required?
A: INFURA_KEY
for RPC access and WALLET_PRIVATE_KEY
for signing transactions.
Q: Can I get a price quote without executing a trade?
A: Yes, use the getPrice
tool with the desired parameters.
Q: How is the server started?
A: Use the npx
command defined in the serverConfig
section below.
An MCP server for AI agents to automate token swaps on Uniswap DEX across multiple blockchains.
To install Uniswap Trader MCP for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @kukapay/uniswap-trader-mcp --client claude
Clone the Repository:
git clone https://github.com/kukapay/uniswap-trader-mcp.git
cd uniswap-trader-mcp
Install Dependencies:
npm install
{
"mcpServers": {
"Uniswap-Trader-MCP": {
"command": "node",
"args": ["path/to/uniswap-trader-mcp/server/index.js"],
"env": {
"INFURA_KEY": "your infura key",
"WALLET_PRIVATE_KEY": "your private key"
}
}
}
}
The following blockchains are supported. Ensure each chain is configured in chainConfigs.js
with a valid RPC URL, WETH address, and SwapRouter address.
Chain ID | Name | Notes |
---|---|---|
1 | Ethereum | Mainnet, widely used for Uniswap trades |
10 | Optimism | Layer 2, requires Optimism RPC |
137 | Polygon | Fast and low-cost, uses MATIC as native |
42161 | Arbitrum | Layer 2, Arbitrum One network |
42220 | Celo | Mobile-first blockchain, uses CELO |
56 | BNB Chain | Binance Smart Chain, uses BNB |
43114 | Avalanche | High-throughput, uses AVAX |
8453 | Base | Coinbase’s Layer 2, built on Optimism |
getPrice
Fetches a price quote for a Uniswap swap.
Schema:
chainId
: Number (default: 1)tokenIn
: String (e.g., "NATIVE"
or token address)tokenOut
: String (e.g., "NATIVE"
or token address)amountIn
: String (optional, required for "exactIn"
)amountOut
: String (optional, required for "exactOut"
)tradeType
: "exactIn"
or "exactOut"
(default: "exactIn"
)Example prompt:
Get me a price quote for swapping 1 ETH to DAI on Ethereum.
Output:
{
"chainId": 1,
"tradeType": "exactIn",
"price": "3000.50",
"inputAmount": "1.000000",
"outputAmount": "3000.50",
"minimumReceived": "2985.50",
"maximumInput": "1.005000",
"route": [
{
"tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tokenOut": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"fee": 3000
}
],
"estimatedGas": "150000"
}
executeSwap
Executes a swap on Uniswap.
Schema:
chainId
: Number (default: 1)tokenIn
: StringtokenOut
: StringamountIn
: String (optional, required for "exactIn"
)amountOut
: String (optional, required for "exactOut"
)tradeType
: "exactIn"
or "exactOut"
(default: "exactIn"
)slippageTolerance
: Number (default: 0.5, in percentage)deadline
: Number (default: 20, in minutes)Example prompt:
Swap 1 ETH for DAI on Ethereum with a 0.5% slippage tolerance and a 20-minute deadline.
Output:
{
"chainId": 1,
"txHash": "0x1234...abcd",
"tradeType": "exactIn",
"amountIn": "1.000000",
"outputAmount": "2990.75",
"minimumReceived": "2985.50",
"maximumInput": "1.005000",
"fromToken": "NATIVE",
"toToken": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"route": [
{
"tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tokenOut": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"fee": 3000
}
],
"gasUsed": "145000"
}
MIT License. See LICENSE for details.
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "Uniswap-Trader-MCP": { "command": "npx", "args": [ "-y", "@kukapay/uniswap-trader-mcp" ], "env": { "INFURA_KEY": "<YOUR_INFURA_KEY>", "WALLET_PRIVATE_KEY": "<YOUR_PRIVATE_KEY>" } } } }
Discover more MCP servers with similar functionality and use cases
by stripe
Enables popular agent frameworks to integrate with Stripe APIs via function calling, providing tools for MCP, Python, and TypeScript.
by goat-sdk
GOAT is the largest agentic finance toolkit for AI agents, enabling them to become economic actors by leveraging blockchains, cryptocurrencies, and wallets.
by financial-datasets
Provides AI assistants with tools to retrieve income statements, balance sheets, cash flow statements, stock prices, market news, and crypto information via the Model Context Protocol.
by razorpay
Enables seamless interaction with Razorpay APIs via Model Context Protocol, allowing developers and AI agents to capture payments, manage orders, process refunds, handle settlements, and more through a unified MCP interface.
by armorwallet
Armor Crypto MCP provides a unified interface for AI agents to interact with the crypto ecosystem, including wallet management, swaps, staking, and multi-chain operations.
by alpacahq
Alpaca’s MCP server lets you trade stocks and options, analyze market data, and build strategies through Alpaca's Trading API.
by XeroAPI
Provides a bridge between the Model Context Protocol and Xero's API, enabling standardized access to Xero accounting and business features.
by kukapay
Integrates the Freqtrade cryptocurrency trading bot with an MCP server, exposing the bot's REST API as tools that AI agents can call for fully automated trading operations.
by kukapay
Offers over 50 cryptocurrency technical analysis indicators and corresponding trading strategies, enabling AI agents and developers to assess market trends and generate buy, hold, or sell signals.