kalshi-trading-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
kalshi-trading-mcp
A full-featured Model Context Protocol (MCP) server for Kalshi prediction markets. Includes 20+ tools for account management, market analysis, order execution, multi-source weather forecasting, ensemble model analysis, real-time METAR observations, and position drift monitoring.
Why This Server?
Most existing Kalshi MCP servers are thin API wrappers (5-10 tools). This one is different:
Multi-source weather forecasting — NWS, HRRR, GFS, ECMWF, Open-Meteo, and more
Probability analysis — Bucket math, edge calculation, maker fee impact
Safety controls — Price caps, daily limits, cash reserve, NO-only strategy
Position management — Drift analysis, METAR trend tracking, early exit signals
Cross-city intelligence — Correlated forecast errors, AFD change detection
Related MCP server: Liquid Trading MCP Server
Quick Start
Install
pip install kalshi-trading-mcpOr install from source:
git clone https://github.com/alexandermazza/kalshi-trading-mcp.git
cd kalshi-trading-mcp
pip install -e .Configure
Get your API credentials from Kalshi Settings
Create a
.envfile (or set environment variables):
KALSHI_API_KEY_ID=your-key-id
KALSHI_PRIVATE_KEY_PATH=/path/to/your/private_key.pem
KALSHI_ENV=demo # or 'prod' for real tradingUse with Claude Code
Add to your .mcp.json (or ~/.claude/mcp.json for global):
{
"mcpServers": {
"kalshi": {
"type": "stdio",
"command": "kalshi-mcp",
"env": {
"KALSHI_API_KEY_ID": "your-key-id",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/private_key.pem",
"KALSHI_ENV": "prod"
}
}
}
}Then ask Claude things like:
"What's my Kalshi balance?"
"Scan for weather trading opportunities"
"Analyze the NYC high temp market for tomorrow"
"Show me the ensemble forecast for Chicago"
Use with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"kalshi": {
"command": "kalshi-mcp",
"env": {
"KALSHI_API_KEY_ID": "your-key-id",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/private_key.pem",
"KALSHI_ENV": "prod"
}
}
}
}Tools Reference
Account & Positions
Tool | Description |
| Get cash balance, portfolio value, environment |
| List open positions with exposure |
Markets
Tool | Description |
| List markets with optional filtering by series/status |
| Get single market details including orderbook |
| List supported weather cities with coordinates |
Weather Forecasting
Tool | Description |
| Get weather forecast for a city/date |
| Multi-model data (HRRR, GFS, ECMWF) with spread analysis |
| Compare forecast vs market price — edge, probability, recommendation |
| Scan all cities for trading opportunities |
Weather Signals
Tool | Description |
| Check NWS/GFS update freshness for timing optimization |
| Get current airport observations (temperature, wind, visibility) |
| Track temperature trajectory for same-day positions |
| Check correlated city forecast errors |
| Detect Area Forecast Discussion guidance shifts |
Orders (Two-Step Confirmation)
Tool | Description |
| Prepare order for review (returns confirmation_id) |
| Execute or cancel a prepared order |
| Cancel a resting order |
| List unfilled orders with age/stale detection |
| Re-analyze resting orders for edge degradation |
Position Recovery
Tool | Description |
| Analyze forecast drift for early exit decisions |
Configuration
All settings are configurable via environment variables:
Required
Variable | Description |
| Your Kalshi API key ID |
| Path to your RSA private key (.pem) |
|
|
Safety Limits
Variable | Default | Description |
|
| Max cost per order ($) |
|
| Max daily trading volume ($) |
|
| Max contracts per order |
|
| Minimum cash to keep in account ($) |
|
| Max NO price in cents (payoff protection) |
|
| Only allow NO-side weather trades |
| (empty) | Comma-separated city codes to skip (e.g., |
Weather Analysis
Variable | Default | Description |
|
| Minimum edge to recommend a trade |
|
| Max edge (higher = edge paradox warning) |
|
| Dampen edges above this |
|
| How much to dampen (0.5 = halve excess) |
|
| Override NYC forecast std dev |
|
| Override CHI forecast std dev |
|
| Override DEN forecast std dev |
Optional API Keys (Improves Forecast Accuracy)
Variable | Description |
| |
| |
| |
|
The server works without these keys (NWS is free and always available), but adding more sources improves forecast accuracy through ensemble averaging.
Architecture
kalshi_trading_mcp/
├── server.py # FastMCP instance + lazy-loaded singletons
├── config.py # Env-based configuration
├── safety.py # Trade safety controls + audit logging
├── client/ # Kalshi REST API client
│ ├── client.py # API wrapper with dataclass models
│ └── auth.py # RSA signature authentication
├── tools/ # MCP tool definitions (20+ tools)
│ ├── account.py # Balance, positions
│ ├── markets.py # Market listing, details
│ ├── orders.py # Order flow + edge re-evaluation
│ ├── weather.py # Forecasts, analysis, scanning
│ ├── weather_signals.py # METAR, timing, cross-city, AFD
│ └── position_recovery.py # Drift analysis
├── forecasting/ # Weather data integration
│ ├── multisource.py # Multi-source forecast aggregation
│ ├── nbm.py # National Blend of Models
│ ├── metar.py # Airport observations
│ └── cities.py # City configs + correlations
├── analysis/ # Pure computation
│ ├── probability.py # CDF, edge, fee math
│ ├── ticker_parser.py # Kalshi ticker parsing
│ └── timing.py # Optimal trading windows
└── logging/
└── trade_log.py # JSONL audit trailSupported Cities
Code | City | High Series | Low Series |
NYC | New York | KXHIGHNY | KXLOWTNY |
CHI | Chicago | KXHIGHCH | KXLOWTCH |
MIA | Miami | KXHIGHMI | KXLOWTMI |
AUS | Austin | KXHIGHAT | KXLOWTAT |
HOU | Houston | KXHIGHHO | KXLOWTHO |
LAX | Los Angeles | KXHIGHLA | KXLOWTLA |
DEN | Denver | KXHIGHDE | KXLOWTDE |
PHL | Philadelphia | KXHIGHPH | KXLOWTPH |
Dependencies
Only 4 core dependencies:
fastmcp>=2.0.0— MCP protocol frameworkrequests>=2.31.0— HTTP client for APIscryptography>=41.0.0— RSA signature authpython-dotenv>=1.0.0— .env file support
License
MIT — see LICENSE for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI prediction market trading — real-time data, CLOB exchange, Prop Desk, 40+ tools
Calibrated world model for AI agents. 40 tools: world state, markets, trading. Kalshi + Polymarket.
Machine-payable prediction-market briefs and probability-change monitoring for AI agents.
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides prediction market intelligence, research, and strategy signals for platforms like Kalshi, Polymarket, and Robinhood. It enables AI assistants to perform market screening, arbitrage detection, and deep causal analysis to support informed trading decisions.271MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language trading of Hyperliquid perpetual futures, including portfolio checks, market data, order placement with confirmation, and position management.MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to trade on Kalshi through natural language, including placing orders, market data access, portfolio management, and paper trading with safety guardrails.608 npm3MIT
- 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.42121 PyPI1MIT