# PaulieB14/graph-polymarket-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/PaulieB14/graph-polymarket-mcp  
**GitHub Stars:** 4  
**npm Downloads (last month):** 498  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/paulieb14-graph-polymarket-mcp

## Description
Polymarket prediction market data via The Graph — markets, positions, orders, user activity, and real-time odds.

## Tools
Capabilities this server exposes over MCP:

- **list_subgraphs** — List all available Polymarket subgraphs with descriptions and key entities
- **get_subgraph_schema** — Get the full GraphQL schema (introspection) for a Polymarket subgraph
- **query_subgraph** — Execute a custom GraphQL query against a Polymarket subgraph
- **get_market_data** — Get Polymarket market/condition data including outcomes and volumes from the Main subgraph
- **get_account_pnl** — Get a trader's P&L and performance metrics from the Beefy P&L subgraph
- **get_user_positions** — Get a user's current positions from the Slimmed P&L subgraph. Falls back gracefully if indexers are behind.
- **get_recent_activity** — Get recent splits, merges, and redemptions from the Activity subgraph
- **get_orderbook_trades** — Get recent order fills from the Orderbook subgraph
- **get_global_stats** — Get aggregate Polymarket platform statistics. Combines market counts from the Main subgraph with accurate volume/fee/trade data from the Orderbook subgraph.
- **get_daily_stats** — Get daily platform statistics from the Beefy P&L subgraph: volume, fees, trader counts, and market activity per day. Use this for trend analysis and historical performance.
- **get_top_traders** — Get the top Polymarket traders ranked by realized P&L, win rate, or volume from the Beefy P&L subgraph.
- **get_market_positions** — Get the top positions for a specific market token from the Beefy P&L subgraph. Shows who holds the largest positions and their P&L.
- **get_market_open_interest** — Get the top Polymarket markets ranked by open interest (USDC locked in outstanding positions). This data is unique to the Open Interest subgraph — no other Polymarket subgraph tracks OI.
- **get_oi_history** — Get hourly open interest snapshots for a specific Polymarket market. Use this to chart OI trends over time. The conditionId can be obtained from get_market_open_interest or the main subgraph.
- **get_global_open_interest** — Get the total open interest across all Polymarket markets — the aggregate USDC locked in outstanding positions platform-wide.
- **get_market_resolution** — Get the UMA oracle resolution status for Polymarket markets. Shows whether a market is initialized, proposed, disputed, or resolved, plus proposed/final prices and dispute history.
- **get_disputed_markets** — Get Polymarket markets that were disputed during the UMA oracle resolution process. Disputes happen when someone challenges a proposed outcome — these are high-signal events.
- **get_market_revisions** — Get moderator revisions/updates for Polymarket markets. Shows when and how moderators intervened in market resolution.
- **get_trader_profile** — Get a trader's on-chain profile from the Traders subgraph: when they first appeared, their recent CTF events (splits, merges, transfers), and USDC flows.
- **get_trader_usdc_flows** — Get USDC deposit/withdrawal history for a trader. Shows inbound and outbound USDC transfers, useful for tracking when traders fund or withdraw from Polymarket.
- **search_markets** — Search Polymarket prediction markets by text query. Returns market metadata including question, prices, volume, liquidity, and CLOB token IDs. Uses the Gamma API for real-time market discovery. Chain with: get_clob_market(conditionId) for live order books, get_live_prices(clobTokenIds) for token-level pricing, get_market_open_interest for capital locked, or get_market_resolution for oracle status.
- **get_market_info** — Get detailed Polymarket market info by slug or condition ID. Returns full market metadata from the Gamma API including description, prices, outcomes, and CLOB token IDs. Use the returned conditionId to query get_clob_market for live CLOB data, get_market_open_interest for OI, or get_market_resolution for oracle status.
- **list_polymarket_events** — List Polymarket events (groups of related markets). Events bundle multiple Yes/No markets under one topic (e.g. 'US Presidential Election 2024' contains many candidate markets). Uses the Gamma API.
- **get_polymarket_event** — Get a single Polymarket event with all its associated markets. An event groups related prediction markets under one topic.
- **get_live_prices** — Get real-time CLOB prices for Polymarket outcome tokens. Returns the current best price for buying or selling. Token IDs come from: clobTokenIds in search_markets/get_market_info, or token_id in get_clob_market.
- **get_live_spread** — Get the real-time bid-ask spread for a Polymarket outcome token. Returns best bid, best ask, and spread. Useful for assessing market liquidity and trading costs.
- **get_live_orderbook** — Get the full real-time order book (bids and asks) for a Polymarket outcome token from the CLOB. Shows all resting limit orders with prices and sizes.
- **get_price_history** — Get historical price data for a Polymarket outcome token. Returns time-series price points for charting and trend analysis.
- **get_last_trade** — Get the last trade price for a Polymarket outcome token from the CLOB.
- **get_clob_market** — Get CLOB market details by condition ID. Returns token IDs (token_id) with live prices, minimum order/tick sizes, and market status. This is the bridge between on-chain condition IDs and CLOB trading data. Use the returned token_id values with get_live_prices, get_live_spread, get_live_orderbook, get_price_history, or get_market_positions.
- **search_markets_enriched** — Power tool: search Polymarket markets then auto-enrich each result with live CLOB prices and on-chain resolution status. Combines Gamma API + CLOB API + The Graph in one call — no need to chain tools manually.
- **get_builder_leaderboard** — Rank Polymarket CLOB V2 builders by routed volume, order count or fees. A 'builder' is the frontend/bot/integrator whose code is attached to a fill — this answers 'who is actually routing the flow', which no V1 subgraph can, because the V1 contracts never emitted it. V2-era only (from block 84902353, migration 2026-04-28).
- **get_v2_top_traders** — Top real traders on Polymarket CLOB V2 by volume or trade count, with the exchange contracts excluded. Use this rather than querying accounts directly: the V2 exchange is itself the `taker` when an order matches the book, so it accumulates an Account row and outranks every human by an order of magnitude. V2-era only (from block 84902353).
- **get_builder_activity** — Recent fills routed by one Polymarket CLOB V2 builder code, with that builder's aggregate totals. Use get_builder_leaderboard first to find a builder id. V2-era only.
- **check_subgraph_freshness** — Report how far behind chainhead a subgraph is, by reading its _meta block. Worth calling before trusting any 'current' or 'latest' number, because a lagging subgraph returns stale data rather than an error — it succeeds, it is just answering about the past.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "graph-polymarket-mcp": {
    "command": "npx",
    "args": ["-y","graph-polymarket-mcp"],
    "env": {
      "GRAPH_API_KEY": "",
      "MCP_HTTP_PORT": ""
    }
  }
}
```

**Requires environment variables:** `GRAPH_API_KEY`, `MCP_HTTP_PORT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What PaulieB14/graph-polymarket-mcp MCP server does

PaulieB14/graph-polymarket-mcp MCP server gives an MCP-compatible agent access to Polymarket prediction-market data from several sources. The Graph-backed tools cover indexed on-chain information, including market conditions, trader P&L, positions, fills, transfers, open interest, oracle resolution, disputes, and moderator revisions. Public Gamma API tools handle market and event discovery, while CLOB tools expose current and historical trading data.

The server is suited to research and monitoring workflows rather than placing trades. Agents can look up a market, obtain its condition or token identifiers, then follow those identifiers into live prices, spreads, order books, price history, open interest, or resolution details.

## How it works

The server can run over the default stdio transport or expose an SSE endpoint through HTTP. Its GraphQL utilities let an agent list available subgraphs, inspect a subgraph schema, and submit a custom query. Higher-level tools select the relevant subgraph and return domain-specific results.

Data is split across sources. Main, Beefy P&L, Slimmed P&L, Activity, Orderbook, Open Interest, Resolution, and Traders subgraphs support different parts of the indexed dataset. Gamma supplies market metadata and event groupings; the CLOB API supplies token prices, spreads, order books, last trades, and price history. Some tools cross-reference multiple sources to surface differences such as orderbook-only activity or open interest on resolved markets.

## Setup and configuration

Install the package globally with npm or run it directly with npx. Graph-backed queries require `GRAPH_API_KEY`, obtained from The Graph Studio. The documented free tier includes 100,000 queries per month. Gamma and CLOB tools do not require this key.

For local clients, configure the command as `npx -y graph-polymarket-mcp` and pass the key as an environment variable. HTTP mode starts SSE on port 3851 by default; `MCP_HTTP_PORT` changes the port. `--http` enables stdio and SSE together, while `--http-only` enables SSE alone. A `/health` endpoint is available in HTTP mode.

## Tools and capabilities

- Discover subgraphs, inspect schemas, and run custom GraphQL queries.
- Search markets and browse related Polymarket events.
- Read market metadata, outcome prices, liquidity, volume, and CLOB token IDs.
- Retrieve live prices, bid-ask spreads, complete order books, last trades, and historical price points.
- Analyze P&L, win rate, drawdown, positions, top traders, market holders, and daily platform statistics.
- Inspect fills, splits, merges, redemptions, USDC flows, open interest, and hourly OI history.
- Check UMA resolution states, disputes, revisions, and trader profiles.

## Limitations and notes

PaulieB14/graph-polymarket-mcp depends on indexed subgraph data, so freshness can vary; the positions tool is documented to fall back when indexers are behind. The CLOB V2 subgraphs represent a separate post-migration era and do not contain pre-migration history. HTTP SSE has no built-in authentication: anyone who can reach the port can invoke tools and consume the configured Graph API quota. For local use, stdio avoids that network exposure; remote deployments should place HTTP behind access controls and TLS.

_Full upstream README: https://allmcps.com/mcp/paulieb14-graph-polymarket-mcp/readme_

