Polymarket MCP Server Real-Time Market Prices
Monitor real-time prediction market prices with the MCP server, search markets, analyze prices, and spot trading opportunities on Polymarket.
npx -y @ozgureyilmaz/polymarket-mcpOverview
The Polymarket MCP Server is a lightweight service for monitoring and searching real-time prediction market prices on Polymarket. It continuously ingests price updates, normalizes market metadata, and exposes search and streaming APIs so developer tools, dashboards, and trading bots can quickly find markets, analyze price movements, and identify trading opportunities.
Built for developers and data engineers, the MCP server is useful when you need low-latency market data without polling the public site. It centralizes price history, provides full-text market search, and supports realtime subscriptions so you can drive visualizations, alerts, and automated strategies against a consistent API.
Features
- Real-time price ingestion and normalization for Polymarket markets
- REST search API to find markets by title, tags, or category
- WebSocket (or Server-Sent Events) stream for live price updates
- Price history and simple time-series aggregation (candles, ticks)
- Lightweight caching and pagination for efficient queries
- Configurable thresholds and alert hooks for price movement detection
- Docker-ready and environment-configurable for deployment
Installation / Configuration
Clone the repository and run locally, or use the provided Docker image.
- Clone and install (Node.js example)
# install dependencies (npm or yarn)
- Environment variables
Create a .env file or set environment variables as needed:
PORT=8080
POLYMARKET_API_URL=https://api.polymarket.com/graphql
INGEST_INTERVAL_MS=15000
CACHE_TTL_SECONDS=30
DATABASE_URL=postgres://user:pass@localhost:5432/polymarket
- Docker
# build
# run
Note: Adjust INGEST_INTERVAL_MS and CACHE_TTL_SECONDS to tune freshness vs. API usage.
Available Resources
API endpoints (default base: http://localhost:8080)
| Method | Path | Description |
|---|---|---|
| GET | /health | Health check |
| GET | /markets/search?q={query}&limit=20 | Full-text search for markets |
| GET | /markets/{marketId} | Market metadata and current price |
| GET | /markets/{marketId}/history?from=&to=&interval=1m | Price history (candles or ticks) |
| GET | /prices/latest | Latest prices for all cached markets (paginated) |
| WS | /ws | WebSocket endpoint for live price updates |
Example search request:
Sample search response (JSON):
WebSocket subscription example (wscat):
# install wscat (npm i -g wscat)
# Example subscription message:
{ }
# Server will push:
{ }
Use Cases
Market discovery dashboard
- Use /markets/search to let users browse and filter markets by keywords, categories, or tags. Stream live prices through the WebSocket to update UI components with sub-second latency.
Arbitrage and trading signals
- Run a continuous scan of /prices/latest combined with historical candles to detect sudden price divergences or cross-market patterns. Configure alert thresholds to trigger webhooks when opportunities appear.
Backtesting and analytics
- Pull market history via /markets/{marketId}/history to compute indicators (moving averages, volatility) and validate strategies before committing capital.
Automated monitoring and notifications
- Subscribe to specific markets on the WebSocket and forward large price movements to Slack, email, or a monitoring dashboard for traders and researchers.
Tips for Developers
- Cache results on the client for infrequently changing metadata; only subscribe to WebSocket updates for price-sensitive workflows.
- Use pagination on /prices/latest when scanning large lists to avoid memory spikes.
- Honor rate limits for any upstream Polymarket APIs you configure; tune INGEST_INTERVAL_MS accordingly.
Repository and source code: https://github.com/ozgureyilmaz/polymarket-mcp
If you need schema details (OpenAPI or JSON schemas), check the repo’s docs/ or api/ directory for up-to-date contract definitions.