
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 分