Cover image
Try Now
2025-03-28

Un servidor MCP para agentes de IA para automatizar los intercambios de tokens en UNISWAP DEX en múltiples cadenas de bloques.

3 years

Works with Finder

1

Github Watches

1

Github Forks

8

Github Stars

Uniswap Trader MCP

An MCP server for AI agents to automate token swaps on Uniswap DEX across multiple blockchains.

Features

  • Price Quotes: Get real-time price quotes for token swaps with multi-hop route optimization.
  • Swap Execution: Execute swaps on Uniswap V3 with configurable slippage tolerance and deadlines.
  • Swap Suggestions: Generate trading suggestions based on liquidity, fees, and optimal paths.
  • Multi-Chain Support: Compatible with Ethereum, Optimism, Polygon, Arbitrum, Celo, BNB Chain, Avalanche, and Base.

Prerequisites

  • Node.js: Version 14.x or higher.
  • npm: For package management.
  • Wallet: A funded wallet with a private key for executing swaps.
  • RPC Endpoints: Access to blockchain RPC URLs (e.g., Infura, Alchemy) for supported chains.

Installation

  1. Clone the Repository:

    git clone https://github.com/kukapay/uniswap-trader-mcp.git
    cd uniswap-trader-mcp
    
  2. Install Dependencies:

    npm install
    

Configuration

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

Usage

Supported Chains

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

Tools and Prompts

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

2. executeSwap

Executes a swap on Uniswap.

Schema:

  • chainId: Number (default: 1)
  • tokenIn: String
  • tokenOut: String
  • amountIn: 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"
}

License

MIT License. See LICENSE for details.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

    Reviews

    4 (1)
    Avatar
    user_La2b06v6
    2025-04-17

    I've been using the Uniswap-Trader-MCP by Kukapay, and it has significantly enhanced my trading experience. The clear documentation and intuitive interface made it easy to get started. If you're looking for a reliable and efficient trading application, check it out at https://github.com/kukapay/uniswap-trader-mcp. Highly recommended!