Skip to main content
Glama
Polymarket Gamma MCP Server

Polymarket Gamma MCP Server

by Mavline

Polymarket Gamma MCP Server

MCP Server for working with the Polymarket Gamma Markets API - retrieving prediction market data, events, and analytics.

🚀 Features

📊 Core functions:

  • Trending markets - get popular markets with high volume

  • Market search - search by text in questions and descriptions

  • Category filtering - markets by tags (Politics, Sports, Crypto)

  • Market details - full information about a specific market

  • Events - get events with related markets

  • API Usage - track request usage

🔧 Technical features:

  • No API keys - public access to the Gamma API

  • TypeScript - strict typing and data validation

  • Retry logic - automatic retries on network errors

  • Formatted output - convenient data display in Russian

  • Limit tracking - API usage monitoring

Related MCP server: Polymarket MCP Server

📦 Installation

# Клонировать и установить зависимости
npm install

# Собрать проект
npm run build

# Запустить тесты
npm test

🛠️ Available tools

1. get_trending_markets

Get trending markets with high trading volume.

Parameters:

  • limit (number, default: 20) - number of markets

Example response:

{
  "summary": "Найдено 5 трендовых рынков",
  "apiUsage": "4/1000 запросов использовано, 996 осталось",
  "markets": "1. Will Joe Biden get Coronavirus before the election?\n   💰 Объём: $32,257 | 💧 Ликвидность: $0\n   🏷️ Теги: US-current-affairs\n   📊 Цены: Yes: 0.0% | No: 0.0%",
  "rawData": [...]
}

2. get_markets_by_category

Get markets by categories/tags.

Parameters:

  • tags (array of strings, required) - categories for filtering

  • limit (number, default: 50) - number of markets

Example:

{
  "tags": ["Politics", "US Election"],
  "limit": 20
}

3. search_markets

Search markets by text query.

Parameters:

  • query (string, required) - search query

  • limit (number, default: 30) - number of results

4. get_market_details

Get detailed information about a specific market.

Parameters:

  • marketId (string, required) - market ID

5. get_events

Get events with related markets.

Parameters:

  • limit (number, default: 20) - number of events

  • active (boolean, default: true) - only active events

  • orderBy (string) - sorting: volume, liquidity, endDate, createdAt

6. get_event_details

Get detailed information about an event.

Parameters:

  • eventId (string, required) - event ID

7. get_api_usage

Get API usage statistics.

🔗 API Endpoints

The server uses the following Gamma API endpoints:

  • GET /markets - list of markets

  • GET /markets/{id} - market details

  • GET /events - list of events

  • GET /events/{id} - event details

Base URL: https://gamma-api.polymarket.com

📊 Data structure

ProcessedMarket

{
  id: string;
  question: string;
  description?: string;
  outcomes: string[];
  prices: number[];
  volume: number;
  liquidity: number;
  endDate: string;
  tags: string[];
  active: boolean;
  closed: boolean;
  resolved: boolean;
  negRisk: boolean;
  spread?: number;
  slug: string;
  tokens: Array<{
    id: string;
    outcome: string;
    price: number;
    winner?: boolean;
  }>;
}

ProcessedEvent

{
  id: string;
  title: string;
  description?: string;
  slug: string;
  tags: string[];
  startDate?: string;
  endDate?: string;
  active: boolean;
  closed: boolean;
  volume?: number;
  liquidity?: number;
  marketsCount: number;
  topMarkets?: ProcessedMarket[];
}

🧪 Testing

# Основные тесты
npm test

# Отладка API структуры
node test/debug-api.js

⚠️ Limitations

  1. Public API - no keys, but with reasonable limits

  2. Read-only - cannot place orders (requires CLOB API)

  3. Simplified search - no full-text search yet

  4. Delayed data - not real-time quotes

🔄 Windsurf Integration

Add to mcp_config.json:

{
  "mcpServers": {
    "polymarket-gamma": {
      "command": "node",
      "args": ["C:/Users/pavelk/Desktop/Projects/my_own/Bet/polymarket/mcp-servers/polymarket-gamma-server/dist/index.js"],
      "cwd": "C:/Users/pavelk/Desktop/Projects/my_own/Bet/polymarket/mcp-servers/polymarket-gamma-server"
    }
  }
}

📈 Usage

This server is ideal for:

  • Market analytics - researching trends and volumes

  • Event monitoring - tracking new markets

  • Research - collecting data for analysis

  • Opportunity screening - finding interesting markets

For real trading, use a separate CLOB MCP Server.

🚀 Next steps

  1. ✅ Gamma API Server - ready and tested

  2. 🔄 CLOB API Server - for trading operations

  3. 🔄 WebSocket Server - for real-time data

  4. 🔄 Unified Server - combining all capabilities

Available Tools

8 tools
get_api_usageA

Get current API usage statistics and rate limits

Inputs: no named parameters.

get_event_detailsA

Get detailed information about a specific event by ID

Inputs: eventId (required).

get_eventsB

Get events with their associated markets

Inputs: limit, active, orderBy.

get_market_detailsB

Get detailed information about a specific market by ID

Inputs: marketId (required).

get_markets_by_categoryA

Get markets filtered by category/tags (Politics, Sports, Crypto, etc.)

Inputs: tags (required), limit.

get_sports_eventsC

Получить спортивные события с Polymarket (ПРАВИЛЬНЫЕ параметры)

Inputs: limit.

search_marketsA

Search markets by text query in question/description

Inputs: query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools are distinct: trending, category, search, details, events, event details, API usage. However, get_events and get_sports_events overlap somewhat, though the descriptions clarify sports is a subset. Search and category are clearly different. Overall, boundaries are mostly clear.

    Naming Consistency5/5

    All tools follow the consistent pattern of 'get_' + noun, with clear nouns like 'trending_markets', 'market_details', 'events', etc. No mixed conventions or unexpected verbs.

    Tool Count5/5

    8 tools are well-scoped for a read-only market data server. Each covers a distinct query type, and none feel redundant or excessive.

    Completeness4/5

    The surface covers market retrieval (trending, by category, search), market details, event listings and details, and API usage. Minor gaps like historical price data or market resolution info exist, but core read-only workflows are complete.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables access to Polymarket's prediction markets for analyzing market probabilities, trading activity, and event outcomes across politics, sports, crypto, and other categories through natural language queries.
      46 npm
      10
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to query Polymarket prediction markets, accessing real-time odds, market data, price history, order books, and trending markets across categories like politics, crypto, and sports through natural language.
      46 npm
      7
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables comprehensive read access to Polymarket prediction market data, including live prices, order books, and market statistics. It allows AI assistants to analyze events, search markets, and monitor real-time signals without requiring API keys or authentication.
      22
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables interaction with Polymarket prediction markets through read-only access to market data, events, orderbooks, and user positions, plus authenticated trading capabilities for creating and managing orders.
      1
      -