Metadata-Version: 2.4
Name: prediction-market-mcp
Version: 0.2.0
Summary: MCP server exposing Polymarket + Kalshi + Manifold to Claude/LLMs, with 3-venue arb discovery.
Author: creampig666
License: MIT
Project-URL: Homepage, https://github.com/creampig666/prediction-market-mcp
Project-URL: Issues, https://github.com/creampig666/prediction-market-mcp/issues
Keywords: mcp,claude,anthropic,polymarket,kalshi,manifold,prediction-markets,arbitrage,llm
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.0
Requires-Dist: httpx>=0.25
Dynamic: license-file

# prediction-market-mcp

> Give Claude (or any MCP-compatible LLM) a live view into **Polymarket + Kalshi + Manifold**, plus a single tool that hunts for **3-venue** arb.
> 
> **Just want to look at Polymarket data without installing an MCP server?** Try the live dashboard: https://creampig666.github.io/prediction-markets-live/

An [MCP](https://modelcontextprotocol.io/) server in ~400 lines of Python. No keys, no auth, no signup. Stdio transport, Claude Desktop ready.

```
You:  "Find me anything interesting on bitcoin right now."
Claude (calls find_arb_opportunities("bitcoin")):
  "Polymarket has 'BTC > $150k by Jun 30' at 12%. Kalshi's matched
   contract is at 19%. Manifold's 'Bitcoin to $150k in 2026?' is at 22%.
   12 percentage points between Polymarket and Manifold — worth a
   look at whether they're really the same underlying..."
```

## What it exposes

11 tools across 3 venues:

| Tool | What it does |
|---|---|
| `polymarket_top_markets(limit)` | Top Polymarket markets by 24h volume |
| `polymarket_get_market(slug)` | Single market detail by slug |
| `polymarket_search(query, limit)` | Keyword search across active markets |
| `kalshi_top_events(limit)` | Active Kalshi events |
| `kalshi_get_market(ticker)` | Single Kalshi market by ticker |
| `kalshi_markets_for_event(event_ticker)` | All sub-markets under a Kalshi event |
| `kalshi_search_events(query)` | Keyword search across open Kalshi events |
| `manifold_top_markets(limit)` | Recent BINARY Manifold markets |
| `manifold_get_market(slug)` | Single Manifold market by slug |
| `manifold_search(query, limit)` | Keyword search across Manifold |
| **`find_arb_opportunities(query, min_divergence_pp)`** | **3-venue search + cross-pair divergence report. Returns matched pairs (any 2 of 3 venues) ranked by abs implied-prob gap.** |

All tools return structured JSON ready for the LLM to summarize.

## Install

```bash
pip install git+https://github.com/creampig666/prediction-market-mcp.git
```

Or local dev:

```bash
git clone https://github.com/creampig666/prediction-market-mcp.git
cd prediction-market-mcp && pip install -e .
```

## Hook it up to Claude Desktop

Edit your Claude Desktop config (on Windows: `%APPDATA%\Claude\claude_desktop_config.json`, on Mac: `~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "prediction-market": {
      "command": "prediction-market-mcp"
    }
  }
}
```

Restart Claude Desktop. The 8 tools above will appear in the tool list and you can ask things like:

- "What are the biggest Polymarket markets right now?"
- "Find Kalshi markets about the next Pope."
- "Run `find_arb_opportunities` on 'iran' and tell me which one has the biggest gap."

## Hook it up to other MCP clients

Anything that speaks MCP stdio works. The server has no state and no config — just run `prediction-market-mcp` and pipe JSON-RPC over stdin/stdout.

## How `find_arb_opportunities` works

1. Search **all three** venues (Polymarket / Kalshi / Manifold) for the keyword.
2. For Kalshi, drill from matched events into their sub-markets.
3. Build a flat candidate list of `{venue, label, yes_price, url}` per matched market.
4. Enumerate all cross-venue pairs (poly×kalshi, poly×manifold, kalshi×manifold).
5. Compute divergence in percentage points, filter by `min_divergence_pp` (default 3), sort desc, return top 30.

**Caveats** the LLM should know:

- It's a keyword match, not a semantic match. "BTC 150k" on one venue might be matched to "Bitcoin 150,000" on the other. Edge cases will produce false pairs.
- The matched markets may not be *exactly* the same underlying (timeframe, strike, resolution criteria can differ).
- Polymarket prices in this API are mid; Kalshi prices are last-trade. They're not directly tradeable.
- All of which is why the LLM should treat results as **leads to investigate**, not signals to act on.

## Family

- 🟢 [**polywatch**](https://github.com/creampig666/polywatch) — Polymarket alert CLI
- 🟢 [**kalshiwatch**](https://github.com/creampig666/kalshiwatch) — Kalshi alert CLI
- 🟢 [**manifold-watch**](https://github.com/creampig666/manifold-watch) — Manifold Markets alert CLI
- 🟢 [**polywatch-presets**](https://github.com/creampig666/polywatch-presets) — ready-made polywatch configs
- 🟢 [**prediction-markets-live**](https://github.com/creampig666/prediction-markets-live) — read-only Polymarket dashboard
- 🟢 **prediction-market-mcp** — you're here

## Tip jar

Free and stays free. If it surfaced an arb for you, tips welcome:

```
0x17Fb06dE9D5945eaFf6FBBf4c264E505D38182A4   # EVM (ETH / USDC / any EVM L2)
```

## License

MIT. See [LICENSE](./LICENSE).
