Prediction Markets MCP Server

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.

Category
Visit Server

README

<p align="center"> <img src="docs/assets/logo.png" alt="Prediction Markets MCP" width="200"> </p>

Prediction Markets MCP Server

CI codecov License: MIT

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured