MCP Hub
Back to servers

graph-polymarket-mcp

An MCP server that enables querying Polymarket prediction market data through The Graph subgraphs. It provides tools for accessing market stats, trader P\&L, user positions, and orderbook activity using AI agents.

Updated
Mar 1, 2026

graph-polymarket-mcp

MCP server for querying Polymarket prediction market data via The Graph subgraphs.

Exposes 9 tools that AI agents (Claude, Cursor, etc.) can use to query market data, trader P&L, positions, activity, and orderbook trades.

Prerequisites

You need a free Graph API key (takes ~2 minutes):

  1. Go to The Graph Studio
  2. Connect your wallet (MetaMask, WalletConnect, etc.)
  3. Click "API Keys" in the sidebar and create one
  4. Free tier includes 100,000 queries/month

Installation

npm install -g graph-polymarket-mcp

Or use directly with npx:

npx graph-polymarket-mcp

Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "graph-polymarket": {
      "command": "npx",
      "args": ["-y", "graph-polymarket-mcp"],
      "env": {
        "GRAPH_API_KEY": "your-api-key-here"
      }
    }
  }
}

Claude Code

claude mcp add graph-polymarket -- npx -y graph-polymarket-mcp

Set the environment variable GRAPH_API_KEY before running.

Cursor / Other MCP Clients

Use the stdio transport with npx graph-polymarket-mcp as the command, passing GRAPH_API_KEY as an environment variable.

Available Tools

Core Tools

ToolDescription
list_subgraphsList all available Polymarket subgraphs with descriptions and key entities
get_subgraph_schemaGet the full GraphQL schema for a specific subgraph
query_subgraphExecute a custom GraphQL query against any subgraph

Domain-Specific Tools

ToolDescriptionSubgraph
get_market_dataGet market/condition data with outcomes and volumesMain
get_account_pnlGet a trader's P&L and performance metricsBeefy P&L
get_user_positionsGet a user's current positionsSlimmed P&L
get_recent_activityGet recent splits, merges, and redemptionsActivity
get_orderbook_tradesGet recent order fillsOrderbook
get_global_statsGet aggregate platform statisticsMain

Subgraphs

NameIPFS HashDescription
MainQmdyCguLEisTtQFveEkvMhTH7UzjyhnrF9kpvhYeG4QX8aComplete ecosystem data
Beefy P&LQmbHwcGkumWdyTK2jYWXV3vX4WyinftEGbuwi7hDkhPWqGComprehensive P&L tracking
Slimmed P&LQmZAYiMeZiWC7ZjdWepek7hy1jbcW3ngimBF9ibTiTtwQUMinimal position data
ActivityQmf3qPUsfQ8et6E3QNBmuXXKqUJi91mo5zbsaTkQrSnMAPPosition management events
OrderbookQmVGA9vvNZtEquVzDpw8wnTFDxVjB6mavTRMTrKuUBhi4tOrder fill analytics

Example Queries

Once connected, an AI agent can:

  • "What are the current Polymarket global stats?"
  • "Show me the latest 20 orderbook trades"
  • "What are the positions for address 0x...?"
  • "Get the P&L for trader 0x...?"
  • "Query the main subgraph for all conditions with more than 100 trades"

Development

git clone https://github.com/PaulieB14/graph-polymarket-mcp.git
cd graph-polymarket-mcp
npm install
npm run build
GRAPH_API_KEY=your-key node build/index.js

License

MIT

Reviews

No reviews yet

Sign in to write a review