uniswap-pools-mcp

uniswap-pools-mcp

An MCP server for querying Uniswap pools/pairs by token address, delivering clean, structured results for easy integration and analysis.

Category
访问服务器

Tools

get_token_pools_v2

Query all Uniswap V2 pairs for a specific token and return as a formatted markdown table. Parameters: token_address (str): The Ethereum address of the token to query (e.g., '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'). ctx (Context): The API context for logging and error handling. Returns: A markdown-formatted string containing a table with columns: Version, ID, Pair, Volume USD, ReserveUSD.

get_pool_data

Query a specific Uniswap pool/pair by version (v2, v3, v4) and ID and return as markdown text. Parameters: version (str): The Uniswap version to query ('v2', 'v3', or 'v4'). pool_id (str): The Ethereum address of the pool or pair to query (e.g., '0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc'). ctx (Context): The API context for logging and error handling. Returns: A markdown-formatted string containing details of the pool/pair, including Version, ID, Pair, Token0 Address, Token1 Address, Fee Tier, Volume USD, Liquidity/ReserveUSD, and Fees USD.

get_token_pools

Query all Uniswap V2, V3, and V4 pools/pairs for a specific token and return as a formatted markdown table. Parameters: token_address (str): The Ethereum address of the token to query (e.g., '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'). ctx (Context): The API context for logging and error handling. Returns: A markdown-formatted string containing a table with columns: Version, ID, Pair, Fee Tier, Volume USD, Liquidity/ReserveUSD, Fees USD, sorted by Volume USD in descending order.

get_token_pools_v3

Query all Uniswap V3 pools for a specific token and return as a formatted markdown table. Parameters: token_address (str): The Ethereum address of the token to query (e.g., '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'). ctx (Context): The API context for logging and error handling. Returns: A markdown-formatted string containing a table with columns: Version, ID, Pair, Fee Tier, Volume USD, Liquidity.

get_token_pools_v4

Query all Uniswap V4 pools for a specific token and return as a formatted markdown table. Parameters: token_address (str): The Ethereum address of the token to query (e.g., '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'). ctx (Context): The API context for logging and error handling. Returns: A markdown-formatted string containing a table with columns: Version, ID, Pair, Fee Tier, Volume USD, Liquidity.

README

Uniswap Pools MCP

An MCP server for querying Uniswap pools/pairs by token address, delivering clean, structured results for easy integration and analysis.

GitHub License Python Version Status

Features

  • Query Uniswap Pools/Pairs:
    • Fetch V2, V3, and V4 pools/pairs for a given token address.
    • Retrieve specific pool/pair details by version (v2, v3, v4) and ID.
  • Formatted Output:
    • Returns data in markdown tables for combined pool queries.
    • Provides markdown text summaries for specific pool/pair queries, including token addresses.

Installation

Prerequisites

  • Python: Version 3.10 or higher.
  • uv: A Python package manager (recommended for dependency management).
  • The Graph API Key: Required for querying Subgraphs. Obtain one from The Graph.

Setup

  1. Clone the Repository:

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

    uv sync
    
  3. Installing to Claude Desktop:

    Install the server as a Claude Desktop application:

    uv run mcp install main.py --name "Uniswap Pools"
    

    Configuration file as a reference:

    {
       "mcpServers": {
           "Uniswap Pools": {
               "command": "uv",
               "args": [ "--directory", "/path/to/uniswap-pools-mcp", "run", "main.py" ],
               "env": { "THEGRAPH_API_KEY": "thegraph-api-key"}               
           }
       }
    }
    

    Replace /path/to/uniswap-pools-mcp with your actual installation path, and thegraph-api-key with your API key from The Graph.

Usage

The server provides several tools to query Uniswap pool/pair data.

Tools

  1. Get All Pools/Pairs for a Token:

    def get_token_pools(token_address: str) -> str:
    
    • Description: Queries all Uniswap V2, V3, and V4 pools/pairs for a given token address.

    • Parameters:

      • token_address (str): Ethereum address of the token (e.g., 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 for USDC).
    • Output: Markdown table with columns: Version, ID, Pair, Fee Tier, Volume USD, Liquidity/ReserveUSD, Fees USD.

    • Example:

      Prompt:

      Get Uniswap pools for token at address 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
      

      Output:

      | Version | ID                                         | Pair      | Fee Tier | Volume USD | Liquidity/ReserveUSD | Fees USD |
      |---------|--------------------------------------------|-----------|----------|------------|---------------------|----------|
      | v2      | 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc | USDC/WETH | 3000     | 2000000.0  | 500000.0            | N/A      |
      | v3      | 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640 | USDC/WETH | 500      | 1000000.0  | 123456789           | 5000.0   |
      | v4      | 0x1234567890abcdef1234567890abcdef12345678 | USDC/WETH | 1000     | 500000.0   | 987654321           | 2500.0   |
      
  2. Get Specific Pool/Pair by Version and ID:

    def get_pool_data(version: str, pool_id: str) -> str:
    
    • Description: Queries a specific Uniswap pool/pair by version (v2, v3, or v4) and ID.

    • Parameters:

      • version (str): Uniswap version (v2, v3, or v4).
      • pool_id (str): Ethereum address of the pool or pair (e.g., 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc).
    • Output: Markdown text with details: Version, ID, Pair, Token0 Address, Token1 Address, Fee Tier, Volume USD, Liquidity/ReserveUSD, Fees USD.

    • Example:

      Prompt:

      Get Uniswap V2 pool data by ID 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc
      

      Output:

      **Uniswap V2 Pair Details**
      - **Version**: v2
      - **ID**: 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc
      - **Pair**: USDC/WETH
      - **Token0 Address**: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
      - **Token1 Address**: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
      - **Fee Tier**: 3000 (0.3%)
      - **Volume USD**: 2000000.0
      - **Liquidity/ReserveUSD**: 500000.0
      - **Fees USD**: N/A
      

License

This project is licensed under the MIT License. See the LICENSE file for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选