Give Claude access to Kalshi prediction markets β browse live odds, analyze price history, and trade YES/NO contracts.
Built on the Model Context Protocol (MCP), this server connects Claude (and any MCP-compatible AI) directly to the Kalshi Trade API v2.
First MCP server for Kalshi. Ask Claude "What are the current odds on the Fed rate decision?" and get a live answer.
| Tool | Description | Tier |
|---|---|---|
get_markets |
Browse open/settled markets with filters | π Free |
get_market_details |
Live odds, volume, order book for a market | π Free |
get_market_price_history |
OHLC candlestick data (1-min, hourly, daily) | π Free |
get_portfolio |
Account balance and open positions | π Pro |
place_order |
Buy YES/NO contracts (dry-run confirmation) | π Pro |
get_order_history |
Fills, settlements, open orders | π Pro |
git clone https://github.com/shadowfax-mitch/kalshi-mcp-server
cd kalshi-mcp-server
pip install -r requirements.txtOr install as a package:
pip install kalshi-mcp-serverAdd to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"kalshi": {
"command": "python",
"args": ["-m", "kalshi_mcp.server"],
"cwd": "/path/to/kalshi-mcp-server"
}
}
}{
"mcpServers": {
"kalshi": {
"command": "python",
"args": ["-m", "kalshi_mcp.server"],
"cwd": "/path/to/kalshi-mcp-server",
"env": {
"KALSHI_API_KEY": "your-api-key-uuid",
"KALSHI_PRIVATE_KEY_PATH": "/absolute/path/to/private_key.pem"
}
}
}
}{
"mcpServers": {
"kalshi": {
"command": "kalshi-mcp",
"env": {
"KALSHI_API_KEY": "your-api-key-uuid",
"KALSHI_PRIVATE_KEY_PATH": "/absolute/path/to/private_key.pem"
}
}
}
}After saving the config, restart Claude Desktop. You'll see a π¨ tools icon β click it to verify Kalshi tools are loaded.
- Go to https://kalshi.com/account/settings
- Navigate to API β Create API Key
- Download your RSA private key PEM file
- Copy your API key UUID
- Set both as environment variables (see config above)
Security: Never commit your private key or API key to version control.
Store them securely β they provide full trading access to your account.
Once configured, talk to Claude naturally:
"Show me open BTC prediction markets"
β get_markets(series_ticker="KXBTC15M")
"What are the most liquid markets right now?"
β get_markets(status="open", limit=20)
"Show me recently settled markets"
β get_markets(status="settled", limit=10)
"Get the full details for KXBTC15M-24NOV1913-T10000 including the order book"
β get_market_details("KXBTC15M-24NOV1913-T10000")
"Show me the hourly price chart for this market over the last 48 hours"
β get_market_price_history("KXBTC15M-...", period_interval=60, lookback_hours=48)
"Get 1-minute candles for the last hour"
β get_market_price_history("...", period_interval=1, lookback_hours=1)
"What's my current balance and positions?"
β get_portfolio()
"Show me my recent trades and P&L"
β get_order_history(include_fills=True, include_settlements=True)
Claude automatically uses a dry-run confirmation flow:
"Buy 10 YES contracts on KXBTC15M-... at 65 cents"
Claude:
1. Calls place_order(..., dry_run=True) β preview
2. Shows you:
π ORDER PREVIEW (not submitted):
Ticker: KXBTC15M-24NOV1913-T10000
Side: YES
Contracts: 10
Limit price: 65Β’ ($0.65)
Estimated cost: $6.50
Max payout: $10.00
Max profit: $3.50
3. Asks: "Shall I submit this order?"
4. On confirmation: calls place_order(..., dry_run=False)
List Kalshi prediction markets.
| Parameter | Type | Default | Description |
|---|---|---|---|
status |
str | "open" |
"open", "closed", or "settled" |
series_ticker |
str | Filter by series (e.g. "KXBTC15M", "NASDAQ100D") |
|
event_ticker |
str | Filter by event | |
limit |
int | 20 |
Results per page (max 200) |
cursor |
str | Pagination cursor |
Full detail for a single market including live order book.
| Parameter | Type | Default | Description |
|---|---|---|---|
ticker |
str | required | Market ticker |
include_orderbook |
bool | true |
Fetch live order book |
OHLC candlestick price history.
| Parameter | Type | Default | Description |
|---|---|---|---|
ticker |
str | required | Market ticker |
period_interval |
int | 60 |
Candle size in minutes: 1, 60, or 1440 |
lookback_hours |
int | 24 |
Hours of history (1β168) |
Account balance and open positions. No parameters.
Place a limit buy order.
| Parameter | Type | Default | Description |
|---|---|---|---|
ticker |
str | required | Market ticker |
side |
str | required | "yes" or "no" |
count |
int | required | Number of contracts |
price_cents |
int | required | Limit price in cents (1β99) |
dry_run |
bool | true |
Preview without submitting (always start here) |
Pricing guide:
- Each contract pays $1.00 if you're correct, $0.00 if wrong
price_cents=65means you pay 65Β’ and profit 35Β’ if correctprice_centsreflects the market's implied probability (65Β’ β 65% chance)
Recent trading activity.
| Parameter | Type | Default | Description |
|---|---|---|---|
include_fills |
bool | true |
Recent executed trades |
include_settlements |
bool | true |
Settled contracts with P&L |
include_open_orders |
bool | true |
Resting limit orders |
ticker |
str | Filter to specific market | |
limit |
int | 25 |
Records per section |
Claude Desktop
β
β MCP (stdio)
βΌ
kalshi_mcp/server.py β FastMCP server, tool definitions, formatting
β
βΌ
kalshi_mcp/client.py β Kalshi REST API client (httpx)
β
βΌ
kalshi_mcp/auth.py β RSA-PSS signing (Kalshi API v2 auth scheme)
β
βΌ
https://api.elections.kalshi.com/trade-api/v2
Auth scheme (RSA-PSS):
Signature = RSA-PSS(
message = f"{unix_timestamp}{METHOD}{/trade-api/v2/endpoint}",
hash = SHA-256,
mgf = MGF1(SHA-256),
salt_len = 32
)
Headers:
KALSHI-ACCESS-KEY = api_key_uuid
KALSHI-ACCESS-SIGNATURE = base64(signature)
KALSHI-ACCESS-TIMESTAMP = unix_timestamp_seconds
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Type check
mypy kalshi_mcp/
# Lint
ruff check kalshi_mcp/
# Test the server manually (stdio transport)
python -m kalshi_mcp.serverkalshi-mcp-server/
βββ kalshi_mcp/
β βββ __init__.py # Package metadata
β βββ server.py # MCP server & tool definitions
β βββ client.py # Kalshi API client
β βββ auth.py # RSA-PSS authentication
βββ tests/
β βββ test_client.py # Unit tests
βββ README.md
βββ requirements.txt
βββ pyproject.toml
βββ .env.example
- Market browsing β search and filter thousands of markets
- Live odds β real-time YES/NO prices and order books
- Price history β OHLC candlestick data for any market
- No API credentials required
Everything in Free, plus:
- Portfolio view β balance, positions, unrealized P&L
- Order placement β buy YES/NO contracts with confirmation flow
- Order history β fills, settlements, open orders
Available at: PaidMCP | GitHub Sponsors
- Never trade with funds you can't afford to lose. Prediction markets carry real financial risk.
- Store your API key and private key securely. Never commit them to version control.
- The
place_ordertool defaults todry_run=Trueβ orders require explicit confirmation. - Consider setting position size limits at the Kalshi account level as an extra safeguard.
"Auth init failed (free-tier only)"
β Check that KALSHI_API_KEY is a valid UUID and KALSHI_PRIVATE_KEY_PATH points to your PEM file.
"Kalshi API 401"
β Your key may be expired or revoked. Regenerate at kalshi.com/account/settings.
"Kalshi API 403"
β You may be trying a pro feature without valid credentials, or your account may be restricted.
Tools not showing in Claude Desktop
β Verify the cwd path in your config. Restart Claude Desktop after any config change.
"period_interval must be 1, 60, or 1440"
β Kalshi only supports these candle sizes. Use 1 (minute), 60 (hourly), or 1440 (daily).
Pull requests welcome! Please open an issue first for significant changes.
git clone https://github.com/shadowfax-mitch/kalshi-mcp-server
cd kalshi-mcp-server
pip install -e ".[dev]"
pytest tests/MIT License β see LICENSE
This is an unofficial third-party tool. It is not affiliated with, endorsed by, or sponsored by Kalshi Inc. Use of the Kalshi API is subject to Kalshi's Terms of Service. Trading prediction markets involves financial risk.