Prediction Markets MCP Server
Unified access to prediction market data from Kalshi and Polymarket, enabling natural language queries for real-time odds, orderbooks, and trade history.
README
<p align="center"> <img src="docs/assets/logo.png" alt="Prediction Markets MCP" width="200"> </p>
Prediction Markets MCP Server
An MCP server providing unified access to prediction market data from Kalshi and Polymarket.
[!WARNING] This project is in early development. APIs may change without notice.
Why Use This?
Prediction markets aggregate crowd wisdom into real-time probabilities. This MCP server lets you:
- Unify platforms — Query Kalshi and Polymarket through one interface
- Use natural language — Ask "What are the odds?" instead of parsing JSON APIs
- Get real-time data — Access prices, orderbooks, and trade history instantly
- Search efficiently — Full-text search across thousands of markets in <1ms
Instead of manually browsing market websites or writing API integration code, ask your AI assistant directly.
What Can You Ask?
Once connected, try these natural language queries:
- "What are the current odds on Polymarket for the next Fed rate decision?"
- "Show me all open Kalshi markets about the 2024 election"
- "Search Kalshi for markets about climate change"
- "Show me the orderbook for the next Fed rate decision on Kalshi"
Quick Start
Add to your MCP client configuration (e.g., ~/.claude.json for Claude Code):
{
"mcpServers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-mcp"],
"env": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
Note: Polymarket works without credentials. Kalshi credentials are optional but required for authenticated operations.
Restart your MCP client to load the server.
📖 Full documentation — Setup guides for 7 MCP clients, troubleshooting, and more.
Installation
This server is published on npm and runs via npx. No cloning or building required.
Configuration Format
Most MCP clients use the same JSON structure:
{
"mcpServers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-mcp"],
"env": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
Alternative runtimes: If you prefer Bun, use "command": "bunx" and "args": ["prediction-mcp"].
Client-Specific Locations
| Client | Configuration File |
|---|---|
| Claude Code | .mcp.json (project root) or ~/.claude.json (global) |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
| VS Code (Copilot) | .vscode/mcp.json (uses "servers" key instead of "mcpServers") |
| Cursor | .cursor/mcp.json or Cursor settings |
See the Getting Started guide for detailed setup instructions for all supported clients.
Credentials
Kalshi
Kalshi requires API credentials for authenticated requests:
KALSHI_API_KEY=your-api-key-id
KALSHI_PRIVATE_KEY_PATH=/path/to/private-key.pem
Get credentials at kalshi.com/account/profile.
Demo Environment
Kalshi provides a demo environment for testing with mock funds:
KALSHI_USE_DEMO=true
Demo credentials are separate from production—create a demo account at demo.kalshi.co.
Polymarket
Polymarket tools work without authentication—all read operations are public.
Available Tools
| Platform | Tools |
|---|---|
| Kalshi | kalshi_list_markets, kalshi_get_market, kalshi_get_orderbook, kalshi_get_trades, kalshi_search, etc. |
| Polymarket | polymarket_list_markets, polymarket_get_market, polymarket_get_orderbook, polymarket_get_price, etc. |
See Tools Reference for the full tool reference with parameters.
Run bun run docs:generate after modifying tools to keep documentation in sync.
Development
For contributors working on this project:
git clone https://github.com/shaanmajid/prediction-mcp.git
cd prediction-mcp
bun install
bun test # Run tests
bun run typecheck # Type check
bun run lint # Lint
bun run format # Format
Pre-commit hooks run these checks automatically via Husky.
Documentation
bun run docs:generate # Regenerate docs from source
bun run docs:check # Verify docs match source (CI uses this)
bun run docs:serve # Preview at localhost:8000
Project Structure
index.ts # Server entry point
src/
clients/
kalshi.ts # Kalshi API client
polymarket.ts # Polymarket Gamma + CLOB client
search/
cache.ts # Search index
service.ts # Search lifecycle
tools.ts # MCP tool handlers
validation.ts # Zod schemas
scripts/
bootstrap.ts # MCP registration helper
docs.ts # Doc generator CLI
Links
- Documentation (hosted) · docs/ (source)
- Tools Reference
- Configuration
- Kalshi API
- Polymarket API
- MCP Protocol
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。