Skip to main content
Glama
Birantx2

polymarket-mcp-server

by Birantx2
README.md
# Polymarket MCP Server

[![npm](https://img.shields.io/npm/v/polymarket-mcp-server)](https://www.npmjs.com/package/polymarket-mcp-server)
[![Node](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org)

> A **Model Context Protocol (MCP) server** that gives Claude β€” and any MCP client β€” read-only access to [Polymarket](https://polymarket.com), the largest prediction market. Search markets, pull live order books and price history, inspect any wallet's positions, and **rank the liquidity-reward markets by where you actually earn the most per dollar quoted.**

**No API keys. No wallet. No signup.** Every tool runs against Polymarket's public APIs, so it works the second you add it to Claude.

```
"Claude, find me Polymarket markets paying the most liquidity rewards with the least competition."
```

---

## Why this exists

Most prediction-market tooling stops at "list the markets." This server adds the thing market-makers actually care about: **`list_reward_markets`** ranks Polymarket's maker-reward programs by `daily reward pool Γ· on-book competition` β€” surfacing where resting liquidity earns the best rate, not just which markets exist.

Built on the official [`@modelcontextprotocol/sdk`](https://github.com/modelcontextprotocol/typescript-sdk), Zod-validated, with graceful error envelopes and a short in-process cache so repeated questions in a single Claude turn stay fast.

## 60-second quickstart

### Claude Code

```bash
claude mcp add polymarket -- npx -y polymarket-mcp-server
```

### Claude Desktop

Add this to your `claude_desktop_config.json`
(`~/Library/Application Support/Claude/` on macOS, `%APPDATA%\Claude\` on Windows):

```json
{
  "mcpServers": {
    "polymarket": {
      "command": "npx",
      "args": ["-y", "polymarket-mcp-server"]
    }
  }
}
```

Restart Claude Desktop, and the tools appear under the πŸ”Œ menu. That's it β€” no credentials to configure.

### Cursor / other MCP clients

Point any MCP client at the stdio command `npx -y polymarket-mcp-server`.

## Tools

| Tool | What it does |
|------|--------------|
| `search_markets` | Full-text search across events & markets β†’ questions, prices, liquidity, volume, and token IDs. |
| `get_market` | Full detail for one market (by ID or slug), enriched with live midpoint & spread per outcome. |
| `get_orderbook` | Live bids/asks for an outcome token, with best bid/ask, midpoint, and spread computed. |
| `get_price_history` | Historical probability time series with summary stats; auto-downsampled for long ranges. |
| `list_reward_markets` | **The differentiator.** Markets paying maker rewards, ranked by pool Γ· competition. |
| `get_trader_activity` | Any wallet's public positions, recent activity, or total portfolio value (whale-watching). |

### Example: ranking reward markets

```
You:    Which Polymarket reward markets have the best pool-to-competition right now?
Claude: (calls list_reward_markets)
        1. "Will Roberto SΓ‘nchez Palomino win the 2026 Peruvian presidential election?"
           daily pool $2,000 Β· max spread 3.5Β’ Β· min size 20 Β· competition $40.7k Β· score 0.049
        ...
```

`score = dailyRewardPool / (competitionNotional + 1)`, where `competitionNotional` is the notional liquidity (Ξ£ priceΒ·size) already resting within the scoring spread on the order book β€” a proxy for how crowded the reward is.

## How it works

```
Claude / MCP client  ──stdio──▢  polymarket-mcp-server
                                       β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β–Ό                     β–Ό                     β–Ό
          Gamma API            CLOB API              Data API
   (markets, search)   (books, prices, rewards)  (wallet positions)
```

- **Read-only & credential-free** β€” only public endpoints are called.
- **Zod-validated inputs** on every tool; malformed input is rejected cleanly.
- **Graceful errors** β€” upstream failures come back as readable messages, never raw stack traces.
- **Short TTL cache** (60s) on hot queries to respect public rate limits.

## Local development

```bash
git clone https://github.com/Birantx/polymarket-mcp-server.git
cd polymarket-mcp-server
npm install
npm run build
npm test          # end-to-end smoke test against the live public APIs
```

Run it directly over stdio:

```bash
node dist/index.js
```

## Roadmap

- `v0.1` (this release): read-only tools, credential-free.
- `v0.2` (demand-driven): optional authenticated order placement via the CLOB client, gated behind explicit key configuration.

## Disclaimer

This is an unofficial, community-built tool and is **not affiliated with Polymarket**. It is read-only and for informational use. Nothing here is financial advice. Prediction markets may be restricted in your jurisdiction.

## License

MIT Β© 2026 β€” see [LICENSE](./LICENSE).

---

*Keywords: Polymarket MCP server, Model Context Protocol, Claude, Anthropic, prediction markets, market making, liquidity rewards, MCP tools, AI trading research.*

TDQS

A4.4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct role: search for discovery, get_market for single-market detail, get_orderbook for token order book depth, get_price_history for token history, list_reward_markets for reward-ranked opportunities, and get_trader_activity for wallet activity. The only potential overlapβ€”market-level pricing from get_market versus token-level order book data from get_orderbookβ€”is explicitly differentiated by scope and intended use.

Naming Consistency5/5

All tool names use consistent snake_case with a clear verb_noun pattern: search_markets, get_market, get_orderbook, get_price_history, list_reward_markets, get_trader_activity. The verbs are standard and predictable across the set.

Tool Count5/5

Six tools is well-scoped for a read-only Polymarket data and analytics server, covering discovery, detail, order book, history, rewards, and wallet activity without bloating the surface. Each tool earns its place by supporting a distinct read-only workflow.

Completeness4/5

The surface covers the core public-data workflows: market discovery, market detail, token order books, price history, reward-market ranking, and wallet activity. Minor gaps exist, such as no dedicated event-detail endpoint beyond search results and no market-level trade history endpoint, but agents can work around these with the provided tools.

Maintenance

ActivityInactive
ResponsivenessNo issues