Back to MCP Catalog

Uniswap Trader MCP Server

Finance & FintechJavaScript
Automate token swaps on Uniswap DEX across multiple blockchains
Available Tools

getPrice

Fetches a price quote for a Uniswap swap with parameters for chain, tokens, amounts, and trade type

chainIdtokenIntokenOutamountInamountOuttradeType

executeSwap

Executes a token swap on Uniswap with configurable slippage tolerance and deadline

chainIdtokenIntokenOutamountInamountOuttradeTypeslippageTolerancedeadline

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.

Overview

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.

Prerequisites

Before using Uniswap Trader, you'll need:

  • Node.js (version 14.x or higher)
  • A funded cryptocurrency wallet with a private key for executing swaps
  • Access to blockchain RPC URLs (from providers like Infura or Alchemy) for your desired networks

Installation

Option 1: Install via Smithery (Recommended)

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

Option 2: Manual Installation

  1. Clone the repository:
git clone https://github.com/kukapay/uniswap-trader-mcp.git
cd uniswap-trader-mcp
  1. Install dependencies:
npm install
  1. Configure your environment with the necessary API keys and wallet information.

Configuration

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"
      }
    }
  }
}

Supported Blockchains

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.

Usage Examples

Getting Price Quotes

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.

Executing Swaps

To perform an actual token swap:

Swap 0.1 ETH for USDC on Polygon with a 0.5% slippage tolerance.

Advanced Usage

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.

Security Considerations

  • Always keep your private key secure and never share it.
  • Start with small test transactions before executing larger swaps.
  • Be aware of network fees and slippage parameters to avoid unexpected costs.
  • Consider using a dedicated wallet for automated trading operations.

Troubleshooting

If you encounter issues:

  1. Verify your RPC endpoints are working and have sufficient request capacity
  2. Ensure your wallet has enough funds for both the swap and gas fees
  3. Check that the tokens you're trying to swap have sufficient liquidity on Uniswap
  4. Confirm you're using the correct token addresses for the specific blockchain

Related MCPs

TastyTrade Portfolio Manager
Finance & FintechPython

Manage your TastyTrade brokerage account through Claude

Investor Agent
Finance & FintechPython

Financial analysis and investment insights for LLMs

Bankless Onchain
Finance & FintechTypeScript

Access and interact with blockchain data through the Bankless API

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.