
Graph Polymarket Mcp
io.github.PaulieB14由 GitHub 帳號 PaulieB14 發布v1.4.0更新於 Nov 3, 2026
Query Polymarket prediction markets via The Graph — 20 tools, 8 subgraphs
概覽
透過 The Graph 子圖與 Polymarket REST API 查詢 Polymarket 預測市場,提供市場搜尋、即時價格、訂單簿與交易者分析。
- 可以做什麼
- 搜尋與瀏覽市場和事件,讀取市場中繼資料與結算狀態
- 取得 CLOB 即時價格、買賣價差、訂單簿、最新成交與價格歷史
- 查詢鏈上分析資料:平台統計、每日統計、未平倉量與歷史快照
- 檢視交易者:損益、持倉、排行榜、活動紀錄、USDC 資金流與交易者檔案
- 對任一列出的子圖執行自訂 GraphQL 查詢並檢查子圖同步狀態
- 讀取 V2 建置者排行榜與依建置者歸因的成交紀錄
- 適用情境
- 適合讓助理研究預測市場、查看即時賠率與流動性,或分析鏈上交易者績效與未平倉量,而不必手寫 GraphQL。
- 執行需求
- 透過 npx 或全域 npm 安裝在本機以 stdio 執行(需要 Node.js)。子圖工具需要免費的 Graph API 金鑰,放在環境變數 GRAPH_API_KEY 中;Polymarket REST 工具不需金鑰。可選的 HTTP/SSE 模式預設使用 3851 埠,可用 MCP_HTTP_PORT 變更。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Graph Polymarket Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
graph-polymarket-mcp
[npm version] [MCP Registry] [smithery badge]
[圖片]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):
- Go to The Graph Studio
- Connect your wallet (MetaMask, WalletConnect, etc.)
- Click "API Keys" in the sidebar and create one
- 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_KEYquota.--httpbinds0.0.0.0inside a container, so publish it to127.0.0.1on 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
A /health endpoint is available at http://localhost:3851/health when HTTP transport is active.
Available Tools
Core Tools
Domain-Specific Tools
Polymarket REST API Tools (no Graph API key needed)
CLOB V2 Tools
Polymarket migrated to V2 exchange contracts on 2026-04-28. These tools read the V2 subgraphs, which index from block 84902353 and hold no pre-migration history — V1 and V2 are different eras, not old and new.
Builder attribution is the capability V2 adds. Every V2 fill carries the builder code of the
frontend, bot or integrator that routed it, so "who is actually routing this flow" becomes an
answerable question — 3,325 builders as of 2026-08-08.
Two traps these tools handle for you. The V2 exchange contracts appear as Account rows, because
the exchange is the taker when an order matches the book — ranking accounts naively returns
0xe111…996b (176M fills) and 0xe222…0f59 (41M fills) above every human. get_v2_top_traders
excludes them. check_subgraph_freshness reports any subgraph's head block before you trust a number.
Data Sources
The Graph Subgraphs (requires GRAPH_API_KEY)
On-chain indexed data — authoritative for historical analytics, P&L, open interest, and resolution status.
Subgraphs
CLOB V2 — primary (from block 84902353)
Status verified via _meta on 2026-10-15.
V1 — legacy (pre-2026-04-28 migration history)
Open Interest is already a V2 deployment; it reads ConditionalTokens, which V2 left unchanged, so it has no migration discontinuity.
Which era to ask: all-time or pre-2026-04-28 → V1. Post-migration activity, or anything about
builders → V2. beefy_pnl keeps the hedge-fund metrics (winRate, profitFactor, maxDrawdown, daily
series) that V2 P&L does not have, so trader-quality scoring stays on V1.
Example Queries
Once connected, an AI agent can:
Market Discovery (Gamma API)
- "Search for prediction markets about AI"
- "Show me the most active Polymarket events right now"
- "Find markets about the 2024 election sorted by volume"
- "What markets are in the 'crypto' category?"
Live Trading Data (CLOB API)
- "What's the current price for the Trump YES token?"
- "Show me the full order book for this market"
- "What's the bid-ask spread on this token?"
- "Show me the price history for this market over the last week"
On-Chain Analytics (The Graph)
- "What are the current Polymarket global stats?"
- "Show me the latest 20 orderbook trades"
- "What are the positions for address 0x...?" (flags if wallet entered via OB buys only)
- "Get the P&L for trader 0x...?"
- "Which markets have the most open interest right now?" (flags dead-money OI on resolved markets)
- "Show me disputed markets on Polymarket"
- "Who are the top traders?" (flags any with OB volume not captured by Beefy P&L)
- "Show me the full trading history for wallet 0x..." (includes OB fills + entry type classification)
Development
License
MIT
來源:README.md,提交 f0790fb
工具
0版本歷史
1- v1.4.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分