KU

kukapay/uniswap-trader-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

40 stars 15 forks 质量 66 趋势 0MIT

kukapay/uniswap-trader-mcp 是从 https://github.com/kukapay/uniswap-trader-mcp. 导入的 MCP 候选服务器。

概览

kukapay/uniswap-trader-mcp 是从 https://github.com/kukapay/uniswap-trader-mcp. 导入的 MCP 候选服务器。

概述(AI 翻译)

一个面向AI代理的MCP服务器,用于在Uniswap DEX上自动进行跨多个区块链的代币交换。

特色

  • 价格报价:通过多跳路由优化获取代币交换的实时报价。
  • 交换执行:在Uniswap V3上执行交换,可配置滑动容忍度和截止时间。
  • 掉期建议:根据流动性、费用和最优路径生成交易建议。
  • 多链支持:兼容以太坊、Optimism、Polygon、Arbitrum、Celo、BNB Chain、Avalanche和Base。

先修条件

  • Node.js:版本14.x或更高。
  • npm:用于包管理。
  • 钱包:带有私钥用于执行交换的资金钱包。
  • RPC 端点:访问支持链的区块链 RPC URL(如 Infura、Alchemy)。

安装

通过Smithery安装

通过Smithery自动安装Uniswap Trader MCP for Claude Desktop:

手动安装

  1. 克隆仓库:

  2. 安装依赖系统:

配置

用途

支持链条

支持以下区块链。确保每条链都配置在“chainConfigs”中。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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

Installing via Smithery

To install Uniswap Trader MCP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @kukapay/uniswap-trader-mcp --client claude

Manual 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")
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install @kukapay/uniswap-trader-mcp --client claude
新手?先看 mcpskill.org 教程 →

配置

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