predmarket-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@predmarket-mcp What are the odds of a US recession in 2027 on Kalshi vs Polymarket?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
predmarket-mcp
An MCP server that gives AI agents live prediction-market data from Kalshi and Polymarket.
Live board → Markets that ask the same question on both venues, the price gap between them, and the look-alikes the matcher refused. Rebuilt from the live APIs every 6 hours by scripts/build_dashboard.py.
Ask Claude (or any MCP client) things like "What are the odds of a US recession in 2027 on Kalshi vs Polymarket?" or "Show me the order book and last day of trading for the December Fed cut market". The agent calls these tools, gets clean venue-neutral data and answers with real numbers.
6 read-only tools: search, quote, order book, recent trades, price history and cross-venue comparison
One data model for both venues: every price is a YES probability from 0 to 1, Kalshi NO bids are converted to YES asks, and Polymarket NO-token fills are converted to YES prices
Built for agent workloads: pooled HTTP clients, per-venue rate limiting, retries that honor
Retry-After, and a TTL cache that collapses duplicate concurrent requestsCross-venue matching that avoids look-alikes: 12 rules make pairs agree on thresholds, dates, place, stage (nominee ≠ confirmed), direction and more, not just share words. Each refusal comes with a readable reason
No API keys: uses only the venues' public market-data endpoints
MCP client (Claude Desktop, Claude Code, LangGraph agent, ...)
│ stdio (JSON-RPC)
▼
┌──────────────────────────── predmarket-mcp ────────────────────────────┐
│ server.py 6 tools, input clamping, venue interleaving │
│ matching.py cross-venue pairing (title similarity + close date) │
│ text.py tokenizer + inverted index (fallback Kalshi search) │
│ kalshi.py ─┐ ┌─ polymarket.py │
│ └── http.py: rate limit · retry · TTL cache · dedupe ──────┘│
└───────────────┬────────────────────────────────────────┬───────────────┘
▼ ▼
Kalshi Trade API v2 (public) Polymarket Gamma · CLOB · Data APITools
Tool | What it returns |
| Open markets matching keywords, with bid/ask/mid, volume and close time. Results alternate between venues |
| Current quote and details for one market (Kalshi ticker or Polymarket slug) |
| YES bids and asks, best first, plus the spread |
| Latest fills, newest first, as YES prices |
| Hourly (≤7 days) or daily points, with first/last/min/max summary |
| Markets that appear to ask the same question on both venues, ranked by price gap |
Example, compare_venues("recession") (live output, trimmed, Nov 2026):
[{
"similarity": 0.297,
"price_gap": 0.06,
"kalshi": {"id": "KXRECSSNBER-27", "title": "Will there be a recession in 2027? (Yes)", "mid": 0.215},
"polymarket": {"id": "us-recession-by-end-of-2027", "title": "US recession by end of 2027?", "mid": 0.275}
}]A price gap is a starting point, not an arbitrage. This pair shows why: the Kalshi ticker resolves on an NBER recession call, and Polymarket's market has its own rules and cut-off. Venues often define the "same" event differently, so the server tells the agent to check resolution rules before treating a gap as an opportunity.
Related MCP server: MCP Prediction Markets
Quick start
Requires Python 3.12+ and uv.
git clone https://github.com/bprakashputta/predmarket-mcp
cd predmarket-mcp
uv sync
uv run predmarket-mcp # speaks MCP over stdioClaude Desktop
Add this to claude_desktop_config.json (Settings → Developer → Edit Config), then restart Claude Desktop:
{
"mcpServers": {
"predmarket": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/predmarket-mcp", "run", "predmarket-mcp"]
}
}
}Claude Code
claude mcp add predmarket -- uv --directory /absolute/path/to/predmarket-mcp run predmarket-mcpFrom your own code
examples/client.py starts the server over stdio, lists the tools and calls two of them, which is what an agent framework does under the hood:
uv run python examples/client.py "fed rate"Design notes
Kalshi search. The documented Kalshi API has no keyword search. The server uses the public search endpoint behind kalshi.com's search box: one request, about 0.3 s, quotes included. That endpoint isn't part of the documented API, so if it fails the server falls back to its own inverted index of every open event, built from the documented
/eventsendpoint and cached for 10 minutes. An earlier version always built that index: a cold search took about 10 s and 50+ requests and could trip Kalshi's rate limit.Rate limits. Each venue client spaces its requests evenly (5 req/s for Kalshi) instead of bursting and then backing off. On 429 or 5xx it retries with exponential backoff and honors
Retry-After. A 15-topiccompare_venuessweep makes 30 requests with zero 429s.Caching. Quotes are cached for 5 seconds and searches for 30 seconds. If an agent fires the same request several times in parallel, only one upstream call is made.
Cross-venue matching. Titles are tokenized, stop words removed, and long forms folded into one token ("United States" →
us, "Federal Reserve" →fed). Similarity is Jaccard weighted by word rarity in the result set, so "Fed" and "2026" count less than "dissent" or "shutdown". Before scoring, a pair must pass 12 title rules, checked in order.incompatibility_reason(a, b)returns the first one that fails as plain text ("different dates: Nov 13 vs Nov 9"):Action word. Share at least one, not just a name or a date ("Who will dissent at the FOMC? (Powell)" ≠ "Powell out from the Fed Board").
Negation. "cuts" ≠ "no cuts".
Year. 2026 ≠ 2027.
Dates. Nov 13 ≠ Nov 9, and "by June 30 (Before July)" ≠ "by the July meeting". "Before Jan 1" counts as the same deadline as "by Dec 31".
Timing. A state on a date ≠ something happening by that date ("shut down on Dec 12" ≠ "shutdown by December 12").
Period. A quarter ≠ the whole year ("recession starts in Q1 2026" ≠ "recession by end of 2026").
Place. UK GDP ≠ US GDP. Unplaced macro titles (GDP, inflation, recession, the Fed) count as US, the way both venues word them.
Stage. Nominated ≠ confirmed, announced ≠ agreed ("become the next Justice" ≠ "be the next nominee").
Qualifier. An emergency cut ≠ any cut.
Direction. A rate cut ≠ a rate increase.
Threshold. 3.5% ≠ 3.0%, while 25bps = 25 bps.
Comparison. Above, below and touch differ ("above $150k on Dec 31" ≠ "reach $150k in 2026", "more than 25bps" ≠ "25bps").
Close times must be within 45 days. When the earlier market closes within two weeks, they must also be within a quarter of its remaining life, because three days is noise for a year-end question but a different bet for a weekly crypto price. Pairs are one-to-one.
These rules came from live data. Without them, a 3.5% Fed-funds threshold was paired with a 3.0% one and showed a fake 98-point gap, and the board's widest "gaps" were a Nov 13 vs Nov 9 crypto price and a nominee vs a confirmed justice. Each rule has a regression test built from real title pairs.
Units. Prices are probabilities. Volume stays in each venue's own unit (
contractson Kalshi,usdon Polymarket) and is labeled, never mixed.
Development
uv sync
uv run pytest # no network: HTTP is mocked with respx
uv run ruff check .
# the live board: build a snapshot from the real APIs, then serve site/
uv run python scripts/build_dashboard.py --out site/data.json
python3 -m http.server -d site 8000Limitations
Read-only market data. It doesn't place orders and never touches an account.
Matching works on titles. It finds candidates; a human or the agent must still confirm the contracts resolve the same way.
The primary Kalshi search uses an undocumented public endpoint. If it changes, search falls back to the slower index automatically.
Kalshi multivariate "combo" markets are excluded because they aren't comparable across venues.
Public endpoints change. The venue adapters are small and isolated so they're easy to update.
Not financial advice. Not affiliated with Kalshi or Polymarket.
License
MIT
Available Tools
6 toolscompare_venuesBRead-only
Search both venues and pair markets that appear to ask the same question.
price_gap = Polymarket mid minus Kalshi mid. Pairs must share the question's key words and agree on dates, place, stage, thresholds, direction and negation, and close at similar times, but they are still candidates: always confirm the resolution rules match before acting on a gap.
Inputs: query (required), limit, min_similarity. Returns: result
get_marketARead-only
Current quote and details for one market (Kalshi ticker or Polymarket slug).
Inputs: venue (required), market_id (required). Returns: object
get_orderbookBRead-only
YES-side order book: bids best-first, asks best-first, plus the spread.
Kalshi NO bids are converted to YES asks (a NO bid at p equals a YES ask at 1 - p).
Inputs: venue (required), market_id (required), depth. Returns: object
get_price_historyBRead-only
YES price history: hourly points up to 7 days, daily points beyond that (max 90 days).
Inputs: venue (required), market_id (required), hours. Returns: object
get_recent_tradesBRead-only
Most recent fills, newest first, each expressed as a YES price.
Inputs: venue (required), market_id (required), limit. Returns: result
search_marketsBRead-only
Find open markets by keywords, e.g. "fed rate cut december" or "bitcoin 150k".
Returns market id, title, YES bid/ask/mid, volume and close time for each match.
Inputs: query (required), limit, venue. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct data need: discovery (search_markets), single-market quote (get_market), order book depth (get_orderbook), trade tape (get_recent_trades), time series (get_price_history), and cross-venue matching (compare_venues). The only superficial overlap is search_markets vs compare_venues, but the latter is explicitly scoped to pairing markets across two venues.
All six tools use a consistent snake_case verb_noun convention: search_markets, get_market, get_orderbook, get_recent_trades, get_price_history, compare_venues. There is no mixing of casing or verb styles.
Six tools is well-scoped for a read-only prediction-market data server. Each tool covers a distinct query surface and none appear redundant or gratuitous.
The surface covers discovery, quotes, order books, trades, history, and cross-venue comparison, which is strong for market data. A minor gap is that compare_venues warns users to confirm resolution rules, but no dedicated tool clearly exposes those rules; get_market may include details, but this is not explicit.
Maintenance
Related MCP Connectors
Calibrated world model for AI agents. 40 tools: world state, markets, trading. Kalshi + Polymarket.
Live prediction markets: Polymarket + Kalshi prices, odds, order books. Pay-per-call USDC, no key.
Read-only prediction-market data across Kalshi, Polymarket, Limitless: venues, fees, lookups, stats.
Your agent needs the crowd's number — live odds on elections, policy, macro prints and sport, from the venues where people put money behind the opinion. **What you can ask for** • "What are the current odds on this event?" • "List the open markets on this topic across both venues." • "Show recent trades and how the price moved." • "What is the implied probability now versus a week ago?" **How to use it** Point any MCP client at https://mcp.aisa.one/prediction-market-data/mcp and sign in with OAuth — there is no key to create or paste. 5 tools: Kalshi markets and trades, Polymarket markets, events and activity. **Why this rather than the source** Both venues in one shape, so the same question can be priced twice. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Read the odds here, then ask the same agent for the market data or the news behind them — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/finance/mcp for equities, crypto and prediction markets in one place.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables real-time access to Polymarket prediction market odds, allowing AI agents to retrieve events, markets, and search for predictions with formatted outputs.5MIT
- AlicenseAqualityDmaintenanceProvides search, trending, odds, arbitrage, and category browsing for prediction markets (Polymarket & Kalshi) via the Model Context Protocol, enabling AI agents to access live market data without API keys.51MIT
- AlicenseAqualityDmaintenanceEnables AI agents to browse, search, and trade on Polymarket prediction markets, including viewing markets, order books, balances, and placing/canceling orders.1129 npmMIT
- AlicenseBqualityBmaintenanceEnables MCP-compatible AI agents to research and trade prediction markets on Polymarket and Kalshi, including market search, orderbooks, price history, positions, order routing, and on-chain builder-code attribution, plus overshoot and dispute-risk signals.42112 PyPI1MIT