Polymarket MCP Server
README.md
# Polymarket MCP Server
MCP server for [Polymarket](https://polymarket.com) prediction markets — powered by the official `polymarket-us` TypeScript SDK.
## Features
- **6 MCP tools** for reading market data, searching, and analyzing bets
- **Public data** — no API key needed for reading markets
- **Trading ready** — supports authenticated endpoints with API key
- **Dual mode** — runs as stdio MCP (DuckHive/OpenClaw) or HTTP server
## Installation
```bash
cd polymarket-mcp
npm install
```
## DuckHive / OpenClaw Setup
Add to `~/.duckhive.json`:
```json
{
"mcpServers": {
"polymarket": {
"command": "node",
"args": ["/path/to/polymarket-mcp.mjs"]
}
}
}
```
For trading (optional), add your API key:
```json
{
"mcpServers": {
"polymarket": {
"command": "node",
"args": ["/path/to/polymarket-mcp.mjs"],
"env": {
"POLYMARKET_KEY_ID": "your_key_id",
"POLYMARKET_SECRET_KEY": "your_secret_key"
}
}
}
}
```
Get your API key at: https://app.polymarket.com/api-keys
## Tools
| Tool | Description |
|------|-------------|
| `search_polymarket` | Search markets by keyword |
| `get_polymarket_market` | Full market details by slug |
| `get_polymarket_trending` | Trending events by volume |
| `get_polymarket_price` | Current odds + best bid/ask |
| `get_polymarket_bet_analysis` | Odds, profit calc, vig, value rating |
| `get_polymarket_events` | Browse events by category |
## HTTP Mode (testing)
```bash
node polymarket-mcp.mjs --http
curl http://localhost:3457/health
```
## Known 2026 Midterm Slugs
| Market | Slug |
|--------|------|
| Senate GOP win | `paccc-usse-midterms-2026-11-03-rep` |
| Senate Democrat win | `paccc-usse-midterms-2026-11-03-dem` |
| House Democrat win | `paccc-usho-midterms-2026-11-03-dem` |
| House GOP win | `paccc-usho-midterms-2026-11-03-rep` |
## Docs
- [Polymarket API Quickstart](https://docs.polymarket.us/getting-started/quickstart)
- [SDK Reference](https://docs.polymarket.us/api-reference/sdks/typescript/quickstart)
TDQS
A4.1/5.0
Scored across 6 tools
Disambiguation5/5
Each tool has a clearly distinct function: analysis, event listing, market details, price, trending, and search. No overlapping purposes.
Naming Consistency5/5
All tools use a consistent 'get_' or 'search_' prefix followed by the domain name 'polymarket' with underscore-separated words, making them predictable.
Tool Count5/5
Six tools is optimal for a prediction market server, covering browsing and analysis without being too sparse or overly numerous.
Completeness4/5
The tools cover key operations: listing, searching, getting details, pricing, trending, and analysis. However, actions like placing bets or managing accounts are absent, which might limit full workflow integration.
Maintenance
ActivityInactive
ResponsivenessNo issues