Skip to main content

Kalshi MCP Server

mcp-name: io.github.yakub268/kalshi

MCP Python

Model Context Protocol server for Kalshi prediction markets. Search, analyze, and trade prediction markets directly through Claude Desktop.

Built with production-grade authentication and rate limiting from a live trading system with 4+ months of uptime.

Features

Tools (6)

  • search_markets - Search by keyword, get prices/volume
  • get_market_details - Full market info + orderbook depth
  • get_portfolio - Account balance + open positions
  • get_trending_markets - Top markets by 24h volume
  • place_order - Execute limit orders
  • get_series_markets - All markets in a series (e.g., Fed events)

Resources (2)

  • kalshi://balance - Current account balance
  • kalshi://positions - Open positions list

Installation

Prerequisites

  1. Kalshi API credentials: Get from kalshi.com/profile/api-keys

    • Download your API key ID
    • Download the RSA private key (.pem file)
  2. Python 3.10+

Quick Install (PyPI)

pip install kalshi-mcp

From Source

# Clone repository
git clone https://github.com/yakub268/kalshi-mcp.git
cd kalshi-mcp

# Install dependencies
pip install -e .

Claude Desktop Configuration

Add to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "kalshi": {
      "command": "python",
      "args": ["-m", "kalshi_mcp"],
      "env": {
        "KALSHI_API_KEY": "your-api-key-here",
        "KALSHI_PRIVATE_KEY_PATH": "C:\\Users\\YourName\\.trading_keys\\kalshi_private_key.pem"
      }
    }
  }
}

Note:

  • Replace your-api-key-here with your actual Kalshi API key
  • Update the private key path to where you saved your .pem file
  • On Windows, use double backslashes (\\) in paths

Test the Connection

Restart Claude Desktop, then try:

What's my Kalshi balance?

or

Search for bitcoin prediction markets

Usage Examples

Search for Markets

Search for markets about the Federal Reserve

Get Market Analysis

Show me details for ticker KXFED-26MAR19-B5.25

Check Portfolio

What's my current Kalshi portfolio?

Place an Order

Buy 10 contracts of KXHIGHNYC-26FEB20-B34.5 YES at 25 cents

Authentication

This server uses RSA-PSS signature authentication:

  1. Each request is signed with your private key
  2. Kalshi verifies the signature with your public key
  3. Thread-safe rate limiting (150ms between requests)
  4. Automatic retry on 429 rate limit errors

Security: Your private key never leaves your machine. The server only signs requests locally.

Rate Limiting

  • Built-in 150ms spacing between requests (~6.6 req/s)
  • Automatic exponential backoff on 429 errors (0.5s → 1s → 2s)
  • Safe for concurrent use across multiple Claude conversations

Architecture

Built on production code from a live Kalshi trading bot:

  • Authentication: Reused from kalshi_client.py (4+ months uptime)
  • Rate limiting: Shared across all client instances
  • Error handling: Battle-tested retry logic
  • Market discovery: Liquidity scoring from scanner.py

Contributing

Issues and PRs welcome! This is an open-source project built to fill a gap in the MCP ecosystem.

License

MIT License - see LICENSE file

Acknowledgments


Questions? Open an issue or reach out on GitHub.

Metadata

Release files for kalshi-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kalshi-mcp 0.1.1
File Size Uploaded
kalshi_mcp-0.1.1.tar.gz 7.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for kalshi-mcp 0.1.1
File Interpreter ABI Platform
kalshi_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 MB

Release files / kalshi_mcp-0.1.1.tar.gz

Download URL kalshi_mcp-0.1.1.tar.gz
Size 7.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1cd9206506523bc87255d4b6e35d5d3bf754a94847d3759ebf540d93fdfefce4
BLAKE2b-256 checksum
How to use checksums
5b7fc8fe12a09ed12ec6bef6892097c72f90d115bb6ca3b5d00d56fdf005052f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / kalshi_mcp-0.1.1-py3-none-any.whl

Download URL kalshi_mcp-0.1.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c9f610a9816fc45adac903eb4a5cfa593627eb49fe7555a509ed22cb18c4ca1
BLAKE2b-256 checksum
How to use checksums
88c7a8787463dd62db28306ffc7fb6f63c7c100edc1da25af219d959c079406a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page