SuperAPI AI Directory

uniswap-trader-mcp

Automate token swaps on Uniswap across multiple blockchains.

Open website

About this tool

Uniswap Trader MCP is an MCP server for AI agents to automatically execute token swaps on the Uniswap decentralized exchange, with support for multiple blockchains.

Purpose: To let AI agents connect to Uniswap trading scenarios and complete operations such as quote queries, swap execution, and trade suggestion generation.

Main capabilities:

  • Price quotes: Obtain real-time price quotes for token swaps, with support for multi-hop route optimization.
  • Swap execution: Execute swaps on Uniswap V3, with configurable slippage tolerance and deadline.
  • Swap suggestions: Generate trade suggestions based on liquidity, fees, and the optimal path.
  • Multi-chain support: Compatible with Ethereum, Optimism, Polygon, Arbitrum, Celo, BNB Chain, Avalanche, and Base.

Usage: Uniswap Trader MCP can be automatically installed for Claude Desktop via Smithery, or installed manually. Manual installation steps:

  1. Clone the repository: git clone https://github.com/kukapay/uniswap-trader-mcp.git,然后 cd uniswap-trader-mcp
  2. Install dependencies: npm install

Prerequisites:

  • Node.js: version 14.x or higher.
  • npm: for package management.
  • Wallet: a funded wallet with a private key, used to execute swaps.
  • RPC endpoint: access to a blockchain RPC URL for the supported chains (for example, Infura, Alchemy).

Supported chains: The following blockchains are supported. Ensure that each chain has a valid RPC URL, WETH address, and SwapRouter address configured in chainConfigs.js.

Tools and prompts:

  • Get a price quote for a Uniswap swap. Parameters include: chainId (number, default 1), tokenIn (string, for example "NATIVE" or a token address), tokenOut (string, for example "NATIVE" or a token address), amountIn (string, optional, required when tradeType is "exactIn"), amountOut (string, optional, required when tradeType is "exactOut"), tradeType ("exactIn" or "exactOut", default "exactIn").
  • Execute a swap on Uniswap. Parameters include: tokenIn (string), tokenOut (string), slippageTolerance (number, default 0.5, in percent), deadline (number, default 20, in minutes).

Applicable scenarios: Multi-chain trading scenarios that require an AI agent to automatically obtain quotes, generate trade suggestions, or execute swaps on Uniswap.

Limitations: Usage involves a private key and a funded wallet, which you must keep safe yourself; executing swaps requires a configured RPC endpoint and valid chain configuration. The project uses the MIT license; see LICENSE for details.