Skip to main content
Glama
Odds Data

Odds Data

README.md
![OddsData - Prediction market data for AI models](public/odds-data-banner.png)

# Odds Data

**Prediction market data for AI models.**

Odds Data is an MCP server for AI models and agents to access public Polymarket prediction market data. It provides structured access to market and event discovery, details, historical probabilities, trending markets, outcome comparisons, order books, live prices, spreads, open interest, top holders and recent public trades.

> **Independent project.** Odds Data is not affiliated with or endorsed by Polymarket.

## Features

- Search prediction markets and events by text.
- Retrieve market details by ID or slug.
- Retrieve price history for the yes or no outcome of a market.
- Find the markets trading the most volume right now.
- Compare several markets side by side.
- Read the live order book, midpoint, best bid and ask, spread and last trade price of a market.
- See open interest, the top holders of a market and recent public trades.
- No API key or account credentials required.

## MCP tools

All tools are read-only. Prices are numbers from 0 to 1, so the price of the yes outcome is its implied probability.

| Tool | What it does |
| --- | --- |
| `search_markets` | Searches public markets by text. Markets are flattened out of the matching events, and each carries its event. Supports cursor pagination. |
| `get_market` | Fetches one market by `id` or `slug`, including description, outcomes with token IDs, prices, volume, liquidity, dates and status. |
| `get_market_history` | Returns price history for the `yes` or `no` outcome of a market. |
| `get_trending_markets` | Lists open markets ranked by 24-hour volume, optionally filtered by tag. |
| `compare_markets` | Fetches 2 to 10 markets in parallel and returns their facts side by side. Failed lookups are reported without failing the rest. |
| `search_events` | Searches public events by text. Each event comes with its volume, open interest, tags and its busiest markets. Supports cursor pagination. |
| `get_order_book` | Returns the order book of the yes or no outcome: bids and asks with sizes, best bid and ask, midpoint and spread. |
| `get_market_prices` | Returns the live midpoint, best bid and best ask of the yes and no outcome for 1 to 10 markets. |
| `get_market_spread` | Returns the bid-ask spread of the yes and no outcome for 1 to 10 markets. |
| `get_last_trade_prices` | Returns the price and side of the latest trade in the yes and no outcome for 1 to 10 markets. |
| `get_open_interest` | Returns open interest in USDC for 1 to 10 markets, or for all of Polymarket when no market is given. |
| `get_market_holders` | Lists the top holders of each outcome of a market, largest first, with optional entry price and profit and loss. Supports cursor pagination. |
| `get_public_trades` | Lists recent public trades, newest first, for one market or across Polymarket. Filter by side or size. Supports cursor pagination. |

### Parameters

**`search_markets`**
- `query` (string, required): search text, 1 to 200 characters.
- `limit` (integer, optional): maximum markets to return, 1 to 50. Default 10.
- `includeClosed` (boolean, optional): include closed or resolved markets. Default `false`.
- `cursor` (string, optional): the `nextCursor` from a previous result. Use it only with the same query.

**`get_market`**
- `id` (string) or `slug` (string): provide exactly one.

**`get_market_history`**
- `id` or `slug`: provide exactly one.
- `outcome` (`"yes"` or `"no"`, optional): default `"yes"`.
- `interval` (`"1h"`, `"6h"`, `"1d"`, `"1w"`, `"1m"` or `"max"`, optional): default `"1d"`. `"1m"` means one month.
- `bucketSeconds` (integer, optional): bucket width, 60 to 86400. The minimum is 300 for `"1w"` and 600 for `"1m"` and `"max"`. Omit it to let Polymarket choose.
- `maxPoints` (integer, optional): maximum points returned, 2 to 2000. Default 200. Longer series are evenly downsampled, keeping the first and last point.

**`get_trending_markets`**
- `limit` (integer, optional): number of markets, 1 to 50. Default 10.
- `tag` (string, optional): a Polymarket tag slug such as `politics`, or a numeric tag ID.

**`compare_markets`**
- `markets` (string array, required): 2 to 10 entries. Each is a numeric market ID, a market slug, or a polymarket.com URL.

**`search_events`**
- `query` (string, required): search text, 1 to 200 characters.
- `limit` (integer, optional): maximum events to return, 1 to 25. Default 10.
- `includeClosed` (boolean, optional): include closed or resolved events. Default `false`.
- `maxMarketsPerEvent` (integer, optional): markets listed under each event, busiest first, 0 to 20. Default 5.
- `cursor` (string, optional): the `nextCursor` from a previous result. Use it only with the same query.

**`get_order_book`**
- `id` or `slug`: provide exactly one.
- `outcome` (`"yes"` or `"no"`, optional): default `"yes"`.
- `depth` (integer, optional): price levels per side, 1 to 100. Default 10.

**`get_market_prices`, `get_market_spread` and `get_last_trade_prices`**
- `markets` (string array, required): 1 to 10 entries. Each is a numeric market ID, a market slug, or a polymarket.com URL. Failed lookups are reported without failing the rest.

**`get_open_interest`**
- `markets` (string array, optional): 1 to 10 entries, as above. Omit it for the global total.

**`get_market_holders`**
- `id` or `slug`: provide exactly one.
- `limit` (integer, optional): holders per outcome, 1 to 50. Default 10.
- `minShares` (number, optional): only holders with at least this many shares.
- `includePnl` (boolean, optional): include average entry price, current value and profit and loss. Default `false`.
- `cursor` (string, optional): the `nextCursor` from a previous result. Use it only with the same market and filters.

**`get_public_trades`**
- `id` or `slug` (optional): at most one. Omit both for the global feed.
- `side` (`"buy"` or `"sell"`, optional).
- `minTradeUsdc` (number, optional): only trades worth at least this many USDC.
- `limit` (integer, optional): number of trades, 1 to 100. Default 20.
- `cursor` (string, optional): the `nextCursor` from a previous result. Use it only with the same filters.

Every result is a single JSON text block. Errors are returned with `isError: true` and a stable `error.code` (`rate_limited`, `invalid_input`, `not_found`, `unsupported_market`, `upstream_error`, `network_error`, `aborted` or `internal_error`).

Full details, example calls and example responses are in the [documentation](https://www.oddsdata.app/docs/mcp).

## Requirements

- Node.js 24 or newer.
- [`@polymarket/client`](https://www.npmjs.com/package/@polymarket/client), the official Polymarket TypeScript SDK (used through its unauthenticated public client).
- [`@modelcontextprotocol/server`](https://www.npmjs.com/package/@modelcontextprotocol/server), the MCP SDK.
- No API key is needed for public market data.

## Installation

### npm

Odds Data is published on npm as [`oddsdata-mcp`](https://www.npmjs.com/package/oddsdata-mcp). Your MCP client launches it with one command, so there is nothing to install by hand:

```bash
npx -y oddsdata-mcp
```

Put that command in your client's MCP configuration (see [Supported MCP clients](#supported-mcp-clients)). The server takes no arguments and needs no environment variables.

### Run from source (development)

To work on the server itself, build it from the [`mcp/`](mcp) directory. The commands use [Bun](https://bun.sh), the tooling the server is built and tested with.

```bash
cd mcp
bun install
bun run build
node dist/index.js
```

Launched by hand, the server prints one readiness line on stderr and then waits for an MCP client on stdin. Logs go to stderr, and stdout carries only protocol messages.

## Supported MCP clients

Compatible with Claude Desktop, Kimi Code, Qwen Code and other MCP-compatible applications, AI agents, and clients - including future clients that support the Model Context Protocol (MCP).

Odds Data is a local stdio MCP server, so it works with any MCP client that can launch a local server process. The clients below have setup instructions here, and they all document support for local stdio servers. The list is not exhaustive. Each registers the server in its own place, but all of them run the same command and use the same key, `oddsdata`. None needs a remote endpoint, and Odds Data has none.

| Client | Where it is configured | Format |
| --- | --- | --- |
| Claude Desktop | `claude_desktop_config.json` | JSON (`mcpServers`) |
| Kimi Code | `~/.kimi-code/mcp.json` | JSON (`mcpServers`) |
| Qwen Code | `~/.qwen/settings.json` | JSON (`mcpServers`) |
| Claude Code | `claude mcp add`, or `.mcp.json` | CLI, or JSON (`mcpServers`) |
| OpenAI Codex | `~/.codex/config.toml`, or `codex mcp add` | TOML, or CLI |
| Cursor | `~/.cursor/mcp.json` or `.cursor/mcp.json` | JSON (`mcpServers`) |
| VS Code (GitHub Copilot) | `~/.copilot/mcp-config.json` or `.mcp.json` | JSON (`mcpServers`) |
| Windsurf | `mcp_config.json` | JSON (`mcpServers`) |
| Cline | `cline_mcp_settings.json` | JSON (`mcpServers`) |
| Roo Code | `mcp_settings.json` or `.roo/mcp.json` | JSON (`mcpServers`) |
| Gemini CLI | `~/.gemini/settings.json` or `.gemini/settings.json` | JSON (`mcpServers`), or CLI |
| Zed | `settings.json` | JSON (`context_servers`) |
| Continue | `.continue/mcpServers/*.yaml` | YAML (`mcpServers`) |
| Goose | `~/.config/goose/config.yaml` | YAML (`extensions`) |
| JetBrains AI Assistant | Settings, Tools, AI Assistant, Model Context Protocol (MCP) | JSON (`mcpServers`) |
| Other Compatible MCP Clients | Any client that can launch a local stdio server | See below |

Every client launches the server with `npx -y oddsdata-mcp`, which needs Node.js 24 or newer.

### Shared configuration

Most of these clients (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Cline, Roo Code, Gemini CLI and JetBrains AI Assistant) read the same `mcpServers` JSON object. The entry is identical everywhere; only the file differs. If the file already lists other servers, add `oddsdata` inside the existing `mcpServers` object. No `env` block is needed.

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

Client-specific notes:

- **Claude Desktop:** open Settings, Developer, Edit Config. Quit and reopen the app after saving, then check Connectors for `oddsdata` and its thirteen tools.
- **Claude Code:** `claude mcp add --transport stdio --scope user oddsdata -- npx -y oddsdata-mcp`. Check with `claude mcp list` or `/mcp`.
- **VS Code (GitHub Copilot):** the same object goes in `~/.copilot/mcp-config.json` or a workspace-root `.mcp.json`. VS Code's examples add `"type": "stdio"` to the entry. `.vscode/mcp.json` (a `servers` key) belongs to VS Code's deprecated Local harness.
- **Windsurf:** use Open MCP config file in Cascade, then refresh.
- **Cline and Roo Code:** open the MCP settings from the extension's panel and choose the configuration file. Roo Code also has a per-project `.roo/mcp.json`.
- **Gemini CLI:** put the entry in `~/.gemini/settings.json` (all projects) or `.gemini/settings.json` (one project). Check with `/mcp`.
- **JetBrains AI Assistant:** paste the entry in the New MCP Server dialog. If you already use Claude Desktop, Import from Claude reuses its configuration.

### Clients with a different format

**OpenAI Codex.** `codex mcp add oddsdata -- npx -y oddsdata-mcp`, or in `~/.codex/config.toml`:

```toml
[mcp_servers.oddsdata]
command = "npx"
args = ["-y", "oddsdata-mcp"]
```

**Zed.** The key is `context_servers`, in the Zed settings file:

```json
{
  "context_servers": {
    "oddsdata": {
      "command": "npx",
      "args": ["-y", "oddsdata-mcp"]
    }
  }
}
```

**Continue.** YAML in `.continue/mcpServers/oddsdata.yaml`. MCP tools are only available in agent mode.

```yaml
name: Odds Data
version: 0.0.1
schema: v1
mcpServers:
  - name: oddsdata
    type: stdio
    command: npx
    args:
      - "-y"
      - oddsdata-mcp
```

**Goose.** Add a custom Standard IO extension in goose Desktop, run `goose configure`, or edit `~/.config/goose/config.yaml`:

```yaml
extensions:
  oddsdata:
    name: oddsdata
    type: stdio
    cmd: npx
    args: ["-y", "oddsdata-mcp"]
    enabled: true
    timeout: 300
```

### Other Compatible MCP Clients

Compatibility is not limited to the clients above. Any other MCP client that can launch a local stdio server should be able to use Odds Data with the same two settings: command `npx` and the arguments `-y oddsdata-mcp`. No environment variables are required. Clients that accept only a remote HTTP MCP URL cannot use it.

## Limitations and scope

- **Read-only.** There is no trading, order execution, wallet operations, signing, or access to private account data. No tool accepts a wallet address. Holder and trade results include the public wallet addresses and display names that Polymarket itself shows.
- Only binary (yes/no) markets are supported. Legacy multi-outcome markets return an `unsupported_market` error and are left out of lists.
- Odds Data returns data only. It does not generate analysis or conclusions.
- The server runs over stdio. Clients that accept only remote HTTP MCP URLs cannot use it.
- Data comes from Polymarket through the official SDK and is subject to its availability and rate limits. Price history for old periods may be unavailable at fine bucket widths.

## Repository layout

| Path | Contents |
| --- | --- |
| `mcp/` | The MCP server (TypeScript). |
| `skills/` | The Odds Data [Agent Skill](https://github.com/Nomad07/oddsdata-mcp/blob/main/skills/odds-data/SKILL.md): guidance for AI agents using the tools. |
| `src/`, `public/`, `index.html` | The Odds Data website and documentation (Vite and React). |

To run the website locally: `bun install`, then `bun run dev`.

## Links

- Documentation: https://www.oddsdata.app/docs/mcp
- npm: https://www.npmjs.com/package/oddsdata-mcp
- GitHub: https://github.com/Nomad07/oddsdata-mcp
- X: https://x.com/nomadonmars

## License

Released under the MIT License. See [LICENSE](LICENSE).