polymarket-mcp
Provides real-time access to Polymarket prediction market data, enabling search, browsing, and analysis of prediction markets through natural language.
README
Polymarket MCP Server
A Model Context Protocol (MCP) server that provides real-time access to Polymarket prediction market data. Browse, search, and analyze prediction markets directly from Claude, Cursor, or any MCP-compatible client.
No API key required — all endpoints are public and read-only.
Features
- Search prediction markets by keyword
- Browse events and markets with rich filtering (category, volume, liquidity, date)
- View real-time outcome probabilities and market details
- Analyze order book depth, bid-ask spreads, and price history
- Track top traders on the leaderboard and top position holders
Quick Start
Option 1: Local (stdio mode)
Use with Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"polymarket": {
"command": "npx",
"args": ["-y", "polymarket-mcp"]
}
}
}
Use with Claude Code:
claude mcp add polymarket -- npx -y polymarket-mcp
Use with Cursor — add to .cursor/mcp.json:
{
"mcpServers": {
"polymarket": {
"command": "npx",
"args": ["-y", "polymarket-mcp"]
}
}
}
Option 2: Remote Server (HTTP mode)
If you have a server running the MCP HTTP service, connect via URL:
{
"mcpServers": {
"polymarket": {
"url": "http://YOUR_SERVER_IP:3000/mcp"
}
}
}
Or with Cloudflare Tunnel:
{
"mcpServers": {
"polymarket": {
"url": "https://your-tunnel-domain.trycloudflare.com/mcp"
}
}
}
Server Deployment
1. Install & Build
git clone https://github.com/suy2014/polymarket-mcp.git
cd polymarket-mcp
npm install
npm run build
2. Run
Stdio mode (for local use):
node dist/index.js
HTTP mode (for remote access):
# Default port 3000
node dist/index.js --http
# Custom port
PORT=8080 node dist/index.js --http
# Or use environment variable
MCP_HTTP=1 PORT=3000 node dist/index.js
3. Production (pm2)
npm install -g pm2
PORT=3000 pm2 start dist/index.js --name polymarket-mcp -- --http
pm2 save
pm2 startup # auto-start on reboot
4. Expose via Cloudflare Tunnel (optional)
If your server is behind a firewall or doesn't have a domain:
# Install cloudflared
curl -L -o cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
chmod +x cloudflared
# Create tunnel (generates a public URL)
./cloudflared tunnel --url http://localhost:3000
# Output: https://xxx-xxx.trycloudflare.com
Users can then connect with the tunnel URL:
{
"mcpServers": {
"polymarket": {
"url": "https://xxx-xxx.trycloudflare.com/mcp"
}
}
}
5. Health Check
curl http://localhost:3000/health
# {"status":"ok","sessions":0}
Available Tools (12)
Discovery & Search
| Tool | Description |
|---|---|
search_markets |
Search markets/events by keyword (e.g. "Trump", "Bitcoin", "AI") |
list_events |
Browse events with filtering by tag, volume, liquidity, status |
list_markets |
Browse individual markets with sorting and filtering |
list_tags |
List all category tags (politics, crypto, sports, etc.) |
Market Details
| Tool | Description |
|---|---|
get_event |
Get event details with all associated markets and probabilities |
get_market |
Get single market details including condition ID and token IDs |
Pricing & Order Book
| Tool | Description |
|---|---|
get_prices |
Get current midpoint prices (probabilities) for tokens |
get_spreads |
Get bid-ask spreads to assess liquidity |
get_price_history |
Get historical price data (1h/6h/1d/1w/1m/all intervals) |
get_orderbook |
Get full order book with bid/ask depth |
Analytics
| Tool | Description |
|---|---|
get_market_holders |
Top position holders for a market |
get_leaderboard |
Trader rankings by PnL or volume |
Example Conversations
"What are the hottest prediction markets right now?"
→ Calls list_events sorted by volume
"What's the probability of Bitcoin reaching $200k?"
→ Calls search_markets with query "Bitcoin 200k"
"Show me the price history for this market over the past week"
→ Calls get_price_history with interval "1w"
"How liquid is this market? Show me the order book"
→ Calls get_orderbook + get_spreads
"Who are the top traders on Polymarket?"
→ Calls get_leaderboard sorted by PnL
Tool Workflow
Most analysis flows follow this pattern:
search_markets / list_events → Find markets of interest
↓
get_event / get_market → Get details (condition_id, clobTokenIds)
↓
get_prices / get_price_history → Current & historical probabilities
get_orderbook / get_spreads → Liquidity analysis
get_market_holders → Position analysis
Key identifiers:
condition_idis used for price history and holders.clobTokenIdsare used for prices, spreads, and order books. Both come fromget_marketorget_eventresponses.
API Sources
| API | Base URL | Used For |
|---|---|---|
| Gamma API | gamma-api.polymarket.com |
Events, markets, tags, search |
| CLOB API | clob.polymarket.com |
Order book, prices, spreads, history |
| Data API | data-api.polymarket.com |
Holders, leaderboard |
Requirements
- Node.js >= 18 (uses built-in
fetch) - No API keys needed
Development
git clone https://github.com/suy2014/polymarket-mcp.git
cd polymarket-mcp
npm install
npm run build
npm run dev # watch mode
Test with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.js
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。