MCP server for Polymarket prediction markets — 31 tools combining The Graph subgraphs + Polymarket REST APIs (Gamma + CLOB) for market search, live prices, order books, trader P&L, open interest, and resolution data
官方说明ket data via The Graph subgraphs and Polymarket REST APIs.** Exposes 31 tools that AI agents (Claude, Cursor, etc.) can use to search markets, get real-time CLOB prices and order books, query on-chain data, trader P&L, positions, activity, open interest, market resolution status, and trader profiles.
配置模板(请按你的客户端调整)
claude mcp add graph-polymarket-mcp -- npx -y graph-polymarket-mcp
**MCP server for querying Polymarket prediction market data via The Graph subgraphs and Polymarket REST APIs.** Exposes 31 tools that AI agents (Claude, Cursor, etc.) can use to search markets, get real-time CLOB prices and order books, query on-chain data, trader P&L, positions, activity, open interest, market resolution status, and trader profiles. **v2.0.0** — adds 10 new tools powered by Polymarket's Gamma and CLOB APIs (inspired by polymarket-cli): market search, event browsing, live prices, spreads, order books, price history, and more. No API key needed for these tools — they hit Polymarket's public REST endpoints directly. > Published to the MCP Registry as io.github.PaulieB14/graph-polymarket-mcp 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 Or use directly with npx: Configuration Claude Desktop Add to your claude_desktop_config.json: Claude Code 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. OpenClaw / Remote Agents (SSE) > **The SSE transport has no authentication.** Anyone who can reach the port can call every tool, > and those calls spend *your* GRAPH_API_KEY quota. --http binds 0.0.0.0 inside a container, > so publish it to 127.0.0.1 on the host and put a reverse proxy with TLS and auth in front of > anything reachable off-box. For local agents, prefer the default stdio transport — it has no > network surface at all. Start the server with the HTTP transport: Then point your agent at the SSE endpoint: Transport Modes | Invocation | Transports | Use case | |---|---|---| | npx graph-polymarket-mcp | stdio | Claude Desktop, Cursor, Claude Code | | npx graph-polymarket-mcp --http | stdio + SSE :3851 | Dual — local + remote agents | | npx graph-polymarket-mcp --http-only | SSE :3851 | OpenClaw, remote deployments | A /health endpoint is available at http://localhost:3851/health when HTTP transport is active. Available Tools Core Tools | Tool | Description | |------|-------------| | list_subgraphs | List all available Polymarket subgraphs with descriptions and key entities | | get_subgraph_schema | Get the full GraphQL schema for a specific subgraph | | query_subgraph | Execute a custom GraphQL query against any subgraph | Domain-Specific Tools | Tool | Description | Subgraphs | |------|-------------|-----------| | get_market_data | Get market/condition data with outcomes and resolution status | Main | | get_global_stats | Get platform stats: market counts + real volume/fees/trades | Main + Orderbook | | get_account_pnl | Get a trader's P&L and performance metrics (winRate, profitFactor, maxDrawdown) | Beefy P&L | | get_top_traders | Leaderboard ranked by PnL, winRate, volume, or profitFactor. Cross-refs Orderbook to flag rows where OB volume exceeds Beefy-tracked volume and surface OB-only traders absent from the leaderboard. | Beefy P&L + Orderbook | | get_daily_stats | Daily volume, fees, trader counts, and market activity (1–90 days) | Beefy P&L | | get_market_positions | Top holders for a specific outcome token with their P&L | Beefy P&L | | get_user_positions | Current token positions. Cross-refs Orderbook: flags ⚠ orderbook-only entry when totalBought=0 but OB volume exists, and ⚠ mixed entry when OB volume > 2× split collateral. | Slimmed P&L + Orderbook | | get_recent_activity | Unified chronological feed interleaving splits, merges, and redemptions with orderbook fills. Supports optional address filter. | Activity + Orderbook |