Skip to main content
Glama
PolyMarket MCP Server

PolyMarket MCP Server

by berlinbra

Servidor MCP de PolyMarket

insignia de herrería

Un servidor de Protocolo de Contexto de Modelo (MCP) que proporciona acceso a datos de predicción de mercado a través de la API de PolyMarket. Este servidor implementa una interfaz estandarizada para recuperar información de mercado, precios y datos históricos de los mercados de predicción.

Características

  • Datos de mercado de predicción en tiempo real con precios y probabilidades actuales

  • Información detallada del mercado, incluidas categorías, fechas de resolución y descripciones

  • Datos históricos de precios y volumen con marcos de tiempo personalizables (1 día, 7 días, 30 días, todos)

  • Manejo de errores integrado y gestión de límites de velocidad

  • Formato de datos limpio para un fácil consumo

Related MCP server: Polymarket MCP Server

Instalación

Instalación mediante herrería

Para instalar PolyMarket Predictions para Claude Desktop automáticamente a través de Smithery :

npx -y @smithery/cli install polymarket_mcp --client claude

Escritorio de Claude

  • En MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

  • En Windows: %APPDATA%/Claude/claude_desktop_config.json

    "mcpServers": {
        "polymarket-mcp": {
            "command": "uv",
            "args": [
            "--directory",
            "/Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp",
            "run",
            "polymarket-mcp" //or src/polymarket_mcp/server.py
            ],
            "env": {
                "KEY": "<insert poly market api key>",
                "FUNDER": "<insert polymarket wallet address"
            }
        }
    }

Ejecutando localmente

  1. Clonar el repositorio e instalar las dependencias:

Instalar bibliotecas

uv pip install -e .

Correr

Después de conectar el cliente Claude con la herramienta MCP a través del archivo json e instalar los paquetes, Claude debería ver las herramientas mcp del servidor:

Puede ejecutar el servidor usted mismo a través de: En el repositorio polymarket-mcp:

uv run src/polymarket_mcp/server.py

*Si desea ejecutar el inspector del servidor junto con el servidor:

npx @modelcontextprotocol/inspector uv --directory C:\\Users\\{INSERT_USER}\\YOUR\\PATH\\TO\\polymarket-mcp run src/polymarket_mcp/server.py
  1. Cree un archivo .env con su clave API de PolyMarket:

Key=your_api_key_here
Funder=poly market wallet address

Después de conectar el cliente Claude con la herramienta MCP a través del archivo json, ejecute el servidor: En el repositorio alpha-vantage-mcp: uv run src/polymarket_mcp/server.py

Herramientas disponibles

El servidor implementa cuatro herramientas:

  • get-market-info : Obtenga información detallada sobre un mercado de predicción específico

  • list-markets : Lista de mercados de predicción disponibles con opciones de filtrado

  • get-market-prices : Obtenga precios actuales e información comercial

  • get-market-history : Obtenga datos históricos de precios y volumen

obtener información del mercado

Esquema de entrada:

{
    "market_id": {
        "type": "string",
        "description": "Market ID or slug"
    }
}

Ejemplo de respuesta:

Title: Example Market
Category: Politics
Status: Open
Resolution Date: 2024-12-31
Volume: $1,234,567.89
Liquidity: $98,765.43
Description: This is an example prediction market...
---

mercados de listas

Esquema de entrada:

{
    "status": {
        "type": "string",
        "description": "Filter by market status",
        "enum": ["open", "closed", "resolved"]
    },
    "limit": {
        "type": "integer",
        "description": "Number of markets to return",
        "default": 10,
        "minimum": 1,
        "maximum": 100
    },
    "offset": {
        "type": "integer",
        "description": "Number of markets to skip (for pagination)",
        "default": 0,
        "minimum": 0
    }
}

Ejemplo de respuesta:

Available Markets:

ID: market-123
Title: US Presidential Election 2024
Status: Open
Volume: $1,234,567.89
---

ID: market-124
Title: Oscar Best Picture 2024
Status: Open
Volume: $234,567.89
---

obtener precios de mercado

Esquema de entrada:

{
    "market_id": {
        "type": "string",
        "description": "Market ID or slug"
    }
}

Ejemplo de respuesta:

Current Market Prices for US Presidential Election 2024

Outcome: Democratic
Price: $0.6500
Probability: 65.0%
---

Outcome: Republican
Price: $0.3500
Probability: 35.0%
---

obtener el historial del mercado

Esquema de entrada:

{
    "market_id": {
        "type": "string",
        "description": "Market ID or slug"
    },
    "timeframe": {
        "type": "string",
        "description": "Time period for historical data",
        "enum": ["1d", "7d", "30d", "all"],
        "default": "7d"
    }
}

Ejemplo de respuesta:

Historical Data for US Presidential Election 2024
Time Period: 7d

Time: 2024-01-20T12:00:00Z
Price: $0.6500
Volume: $123,456.78
---

Time: 2024-01-19T12:00:00Z
Price: $0.6300
Volume: $98,765.43
---

Manejo de errores

El servidor incluye un manejo integral de errores para diversos escenarios:

  • Limitación de velocidad (errores 429)

  • Claves API no válidas (errores 403)

  • ID de mercado no válidos (errores 404)

  • Problemas de conectividad de red

  • Condiciones de tiempo de espera de la API (tiempo de espera de 30 segundos)

  • Respuestas malformadas

Los mensajes de error se devuelven en un formato claro y legible para humanos.

Prerrequisitos

  • Python 3.9 o superior

  • httpx>=0.24.0

  • núcleo mcp

  • python-dotenv>=1.0.0

Contribuyendo

¡Agradecemos sus contribuciones! No dude en enviar una solicitud de incorporación de cambios. Para cambios importantes, primero abra una incidencia para comentar qué desea cambiar.

Available Tools

4 tools
get-market-historyC

Get historical price and volume data for a market

NameRequiredDescriptionDefault
market_idYesMarket ID or slug
timeframeNoTime period for historical data7d
get-market-infoC

Get detailed information about a specific prediction market

NameRequiredDescriptionDefault
market_idYesMarket ID or slug
get-market-pricesB

Get current prices and trading information for a market

NameRequiredDescriptionDefault
market_idYesMarket ID or slug
list-marketsB

Get a list of prediction markets with optional filters

NameRequiredDescriptionDefault
limitNoNumber of markets to return (default: 10)
offsetNoNumber of markets to skip (for pagination)
statusNoFilter by market status (e.g., open, closed, resolved)

Tool Schema Changelog

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

  1. 4 tool updatesv1.0.0
    • First observedget-market-history
    • First observedget-market-info
    • First observedget-market-prices
    • First observedlist-markets

TDQS

B3.1/5.0

Scored across 4 tools

Disambiguation3/5

The tools have overlapping purposes that could cause confusion. get-market-history, get-market-info, and get-market-prices all retrieve data about a specific market, making it unclear which to use for different needs. However, the descriptions provide some guidance on the type of data each returns (historical vs. current vs. detailed info), which helps reduce misselection.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with hyphens (e.g., get-market-history, list-markets). The naming is predictable and uniform across all four tools, making it easy for agents to understand the pattern and purpose at a glance.

Tool Count3/5

With only 4 tools, the server feels thin for a prediction market domain, which typically involves actions like creating markets, placing bets, or managing positions. While the tools cover data retrieval well, the lack of operational tools (e.g., trade, create-market) suggests the scope is limited, bordering on under-provisioned for the apparent purpose.

Completeness2/5

There are significant gaps in the tool surface for a prediction market server. The tools only support read-only operations (get and list), with no ability to interact with markets (e.g., trade, resolve, create). This will cause agent failures when trying to perform common actions in this domain, as the surface is severely incomplete for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessLimited data

Related MCP Connectors

Related MCP Servers

  • 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
    -
  • A
    license
    B
    quality
    D
    maintenance
    Enables LLM agents to interact with Polymarket prediction markets, including market discovery, real-time pricing, analytics, account management, and trading with built-in safety guards.
    34
    MIT