Uniswap Trader MCP

Uniswap Trader MCP

Automate token swaps on Uniswap across multiple blockchains for AI agents.

34
Stars
11
Forks
34
Watchers
2
Issues
Uniswap Trader MCP provides an MCP server interface enabling AI agents to automate token swaps on Uniswap V3 across several EVM-compatible blockchains. It offers real-time price quoting, optimized trade route suggestions, and direct execution of swaps with configurable slippage and deadlines. Multi-chain support allows seamless integration with networks such as Ethereum, Polygon, Arbitrum, and others for robust DeFi trading automation.

Key Features

Real-time Uniswap token swap price quoting
Automated swap execution on Uniswap V3
Multi-hop route optimization for best pricing
Configurable slippage tolerance and deadlines
Support for multiple blockchains (Ethereum, Polygon, Arbitrum, etc.)
Trading suggestions based on liquidity and fees
Integration via Smithery for AI platforms
Wallet and RPC endpoint configuration
Schema-defined tools for price and swap operations
Developer-friendly installation and setup guides

Use Cases

Automated DeFi trading by AI agents
Fetching real-time Uniswap swap price quotes
Executing cross-chain token swaps programmatically
Optimizing swap routes for best execution prices
Generating algorithmic trading suggestions
Integrating Uniswap swaps into AI workflows
Building DeFi bots that operate on several blockchains
Dynamic liquidity and fee analysis for token trades
Risk-managed swaps with slippage and deadline settings
Enabling decentralized exchanges for smart agents

README

Uniswap Trader MCP

smithery badge

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:

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

Manual Installation

  1. Clone the Repository:

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

    bash
    npm install
    

Configuration

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

Star History

Star History Chart

Repository Owner

kukapay
kukapay

User

Repository Details

Language JavaScript
Default Branch main
Size 46 KB
Contributors 2
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

JavaScript
97.63%
Dockerfile
2.37%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • EVM MCP Server

    EVM MCP Server

    Unified Model Context Protocol server for multi-chain EVM blockchain access

    EVM MCP Server provides a comprehensive Model Context Protocol-compliant interface for blockchain services across 30+ EVM-compatible networks. It enables AI agents and other clients to interact programmatically with Ethereum, Optimism, Arbitrum, Base, Polygon, and more via standardized tools and resources. Features include blockchain data access, smart contract interactions, token transfers (including NFTs), ENS name resolution, and multi-network support. The server ensures a consistent and context-aware interface for AI and software agents to discover and leverage on-chain functionality.

    • 340
    • MCP
    • mcpdotdirect/evm-mcp-server
  • Blockchain MCP powered by Tatum

    Blockchain MCP powered by Tatum

    MCP server for universal blockchain data access across 130+ networks.

    Blockchain MCP powered by Tatum is a Model Context Protocol (MCP) server that enables large language models (LLMs) to read and write blockchain data across more than 130 networks. It provides unified access to both the Tatum Blockchain Data API and direct RPC gateways, supporting tools for retrieving balances, portfolios, transactions, and more. The platform is designed for seamless integration via API key and configurable MCP client setups, making it easier to build blockchain-aware AI solutions. Comprehensive documentation and extensive network compatibility facilitate robust development and scalability.

    • 12
    • MCP
    • tatumio/blockchain-mcp
  • Alpaca Trading MCP Server

    Alpaca Trading MCP Server

    MCP server interface for real-time stock and crypto trading via Alpaca.

    Alpaca Trading MCP Server provides a Model Context Protocol (MCP) compliant server that acts as an interface to the Alpaca trading API. It enables users to manage portfolios, place trades, access real-time and historical market data, and handle account information programmatically. The server exposes standardized resources and tools for account management, trading, asset information, and market analytics, offering integration with MCP clients such as Claude Desktop.

    • 33
    • MCP
    • laukikk/alpaca-mcp
  • Wallet Inspector MCP

    Wallet Inspector MCP

    Empowering AI agents to inspect wallet balances and onchain activity across multiple blockchains.

    Wallet Inspector MCP is an MCP server that enables AI agents to query wallet balances and view onchain activity on major EVM chains as well as the Solana blockchain. It supports flexible output formats, multi-chain querying, and is designed for integration with MCP-compatible clients such as Claude Desktop CLI. The tool facilitates secure, natural language interactions to check balances, activities, and transaction histories for any supported wallet address.

    • 7
    • MCP
    • kukapay/wallet-inspector-mcp
  • MCP XRPL Server

    MCP XRPL Server

    Unified Model Context Protocol server for seamless AI-driven interaction with the XRP Ledger.

    MCP XRPL Server provides a comprehensive Model Context Protocol implementation for the XRP Ledger, enabling AI agents to access blockchain services seamlessly across MainNet, TestNet, and DevNet. It offers an extensive suite of features including account management, token transfers, NFT operations, DIDs, AMM operations, and oracle interactions, all via a standardized MCP interface. The server supports context-driven interactions, making XRPL functionality readily accessible for AI-powered agents.

    • 5
    • MCP
    • RomThpt/mcp-xrpl
  • Mifos MCP - Model Context Protocol (MCP)

    Mifos MCP - Model Context Protocol (MCP)

    Enabling AI agents to access and operate on financial data in the Mifos X ecosystem using Model Context Protocol.

    Mifos MCP provides a Model Context Protocol (MCP) interface tailored for the Mifos X ecosystem, empowering AI agents to interact with financial data and perform operations within the platform. It offers a Java (Quarkus) implementation, with easy configurability via environment variables and native executable support. Developers can test and debug deployments with the MCP Inspector, and detailed instructions ensure smooth setup and integration. Comprehensive examples demonstrate practical banking and financial automation workflows.

    • 17
    • MCP
    • openMF/mcp-mifosx
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results