PancakeSwap PoolSpy MCP server

Tracks newly created PancakeSwap liquidity pools in real-time, providing detailed metrics like token pairs, transaction counts, volume, and TVL for DeFi traders and analysts on BNB Smart Chain.
Back to servers
Setup instructions
Provider
kukapay
Release date
Mar 17, 2025
Language
Python
Stats
5 stars

This MCP server tracks newly created liquidity pools on PancakeSwap, providing real-time data for DeFi analysts, traders, and developers. It fetches pools created within a specified time range and delivers detailed metrics like pool address, tokens, creation time, transaction count, volume, and TVL.

Prerequisites

  • Python 3.10 or newer
  • An API key from The Graph to access the PancakeSwap subgraph

Installation

Via Smithery

For Claude Desktop users, install the server automatically using Smithery:

npx -y @smithery/cli install @kukapay/pancakeswap-poolspy-mcp --client claude

Manual Installation

First, clone the repository and navigate into the project directory:

git clone https://github.com/kukapay/pancakeswap-poolspy-mcp.git
cd pancakeswap-poolspy-mcp

Then install the required dependencies:

uv add mcp[cli] httpx dotenv

Client Configuration

Add the following configuration to your client's settings:

{
  "mcpServers": {
    "PancakeSwap-PoolSpy": {
      "command": "uv",
      "args": ["--directory", "path/to/pancakeswap-poolspy-mcp", "run", "main.py"],
      "env": {
        "THEGRAPH_API_KEY": "your api key from The Graph"
      }
    }
  }
}

Make sure to replace "your api key from The Graph" with your actual API key.

Usage

Running the Server

To run the server in development mode for local testing:

mcp dev main.py

This launches the MCP Inspector interface where you can interact with the available tools.

Available Tool: get_new_pools_bsc

The server provides a single tool to fetch newly created PancakeSwap pools on the BNB Smart Chain.

Parameters:

  • time_range_seconds (int, optional): Time range in seconds to look back for new pools. Default: 300 seconds (5 minutes)
  • limit (int, optional): Maximum number of pools to return. Default: 100 pools

Examples:

For the default query (last 5 minutes, up to 100 pools):

get_new_pools_bsc()

For a custom query (last 10 minutes, up to 50 pools):

get_new_pools_bsc(600, 50)

Sample Output Format

Newly Created Trading Pools (Last 5 Minutes, Limit: 100):
Pool Address: 0x1234...5678
Tokens: WETH/USDC
Created At: 2025-03-16 12:00:00 UTC
Block Number: 12345678
Transaction Count: 10
Volume (USD): 1234.56
Total Value Locked (USD): 5678.90

Pool Address: 0x9abc...def0
Tokens: CAKE/BNB
Created At: 2025-03-16 12:01:00 UTC
Block Number: 12345679
Transaction Count: 5
Volume (USD): 789.12
Total Value Locked (USD): 3456.78

Example Prompts

When working with this MCP server, try using prompts like:

  • "List newly created PancakeSwap pools from the last 1 hour"
  • "Display PancakeSwap pools created within the last 2 minutes"

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "PancakeSwap-PoolSpy" '{"command":"uv","args":["--directory","path/to/pancakeswap-poolspy-mcp","run","main.py"],"env":{"THEGRAPH_API_KEY":"your api key from The Graph"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "PancakeSwap-PoolSpy": {
            "command": "uv",
            "args": [
                "--directory",
                "path/to/pancakeswap-poolspy-mcp",
                "run",
                "main.py"
            ],
            "env": {
                "THEGRAPH_API_KEY": "your api key from The Graph"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "PancakeSwap-PoolSpy": {
            "command": "uv",
            "args": [
                "--directory",
                "path/to/pancakeswap-poolspy-mcp",
                "run",
                "main.py"
            ],
            "env": {
                "THEGRAPH_API_KEY": "your api key from The Graph"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later