Skip to main content
Glama

uniswap-trader-mcp

Uniswap 交易者 MCP

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

特征

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

先决条件

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

安装

  1. 克隆存储库
    git clone https://github.com/kukapay/uniswap-trader-mcp.git cd uniswap-trader-mcp
  2. 安装依赖项
    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" } } } }

用法

支持的链

支持以下区块链。请确保在chainConfigs.js中配置每个链的有效 RPC URL、WETH 地址和 SwapRouter 地址。

链ID姓名笔记
1以太坊主网,广泛用于 Uniswap 交易
10乐观第 2 层,需要 Optimism RPC
137多边形快速且低成本,使用 MATIC 作为原生
42161仲裁第 2 层,Arbitrum One 网络
42220塞洛移动优先区块链,使用 CELO
56BNB链币安智能链,使用BNB
43114雪崩高通量,使用 AVAX
8453根据Coinbase 的 Layer 2,基于 Optimism

工具和提示

1. getPrice

获取 Uniswap 交换的报价。

架构

  • chainId :数字(默认值:1)
  • tokenIn :字符串(例如"NATIVE"或代币地址)
  • tokenOut :字符串(例如"NATIVE"或代币地址)
  • amountIn :字符串(可选, "exactIn"必需)
  • amountOut :字符串(可选, "exactOut"必需)
  • tradeType"exactIn""exactOut" (默认值: "exactIn"

示例提示:

Get me a price quote for swapping 1 ETH to DAI on Ethereum.

输出:

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

在 Uniswap 上执行交换。

架构

  • chainId :数字(默认值:1)
  • tokenIn :字符串
  • tokenOut :字符串
  • amountIn :字符串(可选, "exactIn"必需)
  • amountOut :字符串(可选, "exactOut"必需)
  • tradeType"exactIn""exactOut" (默认值: "exactIn"
  • slippageTolerance :数字(默认值:0.5,百分比)
  • deadline :数字(默认值:20,以分钟为单位)

示例提示:

Swap 1 ETH for DAI on Ethereum with a 0.5% slippage tolerance and a 20-minute deadline.

输出:

{ "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 许可证。详情请参阅许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

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

  1. 特征
    1. 先决条件
      1. 安装
        1. 配置
          1. 用法
            1. 支持的链
            2. 工具和提示
          2. 执照

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              An MCP server implementation that enables access to DexScreener API data, providing real-time information on DEX pairs, token profiles, and market statistics across multiple blockchains.
              Last updated -
              7
              6
              JavaScript
              The Unlicense
            • -
              security
              A
              license
              -
              quality
              An MCP server providing tools for AI agents to mint ERC-20 tokens across multiple blockchains.
              Last updated -
              6
              9
              JavaScript
              MIT License
              • Linux
              • Apple
            • -
              security
              A
              license
              -
              quality
              An MCP server for executing token swaps on the Solana blockchain using Jupiter's Ultra API, enabling users to fetch optimal swap orders and execute transactions with slippage control.
              Last updated -
              5
              12
              JavaScript
              MIT License
            • A
              security
              A
              license
              A
              quality
              An MCP server providing unified access to blockchain operations, bridging, swapping, and crypto trading strategies for AI agents.
              Last updated -
              20
              141
              Python
              GPL 3.0
              • Apple
              • Linux

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/kukapay/uniswap-trader-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server