The Kalshi MCP Server enables AI agents to interact with Kalshi, a regulated prediction market exchange in the US. This server provides comprehensive access to market data, real-time pricing, order books, portfolio management, and trading capabilities.
By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to discover prediction markets, analyze odds (probabilities), execute trades, and track portfolio performance directly through their context window, bridging the gap between AI and regulated prediction markets.
- Market Discovery: Search and filter prediction markets by status, series, or event keywords.
- Real-time Pricing: Access live price data, implied probabilities, and depth-of-market (order books) for any market.
- Portfolio Tracking: Monitor account balance, positions, trade history, fills, and settlements.
- Trading Operations: Place limit or market orders, cancel orders, and manage positions.
To use this server without installing it globally:
npx @iqai/mcp-kalshigit clone https://github.com/IQAIcom/mcp-kalshi.git
cd mcp-kalshi
pnpm install
pnpm run buildAdd the following configuration to your MCP client settings (e.g., claude_desktop_config.json).
{
"mcpServers": {
"kalshi": {
"command": "npx",
"args": ["-y", "@iqai/mcp-kalshi"],
"env": {
"KALSHI_API_KEY": "your_api_key_here",
"KALSHI_PRIVATE_KEY_PATH": "./path/to/your/private-key.pem"
}
}
}
}{
"mcpServers": {
"kalshi": {
"command": "node",
"args": ["/absolute/path/to/mcp-kalshi/dist/index.js"],
"env": {
"KALSHI_API_KEY": "your_api_key_here",
"KALSHI_PRIVATE_KEY_PATH": "/absolute/path/to/private-key.pem"
}
}
}
}| Variable | Required | Description | Default |
|---|---|---|---|
KALSHI_API_KEY |
Yes | Your Kalshi API key ID | - |
KALSHI_PRIVATE_KEY_PATH |
Yes* | Path to your RSA private key PEM file | - |
KALSHI_PRIVATE_KEY_PEM |
Yes* | RSA private key as PEM string (alternative to path) | - |
*Either KALSHI_PRIVATE_KEY_PATH or KALSHI_PRIVATE_KEY_PEM is required.
- Log in to your Kalshi account
- Go to Settings > API Keys
- Create a new API key pair
- Download and save your private key securely
- Note your API Key ID
- "What prediction markets are currently open on Kalshi?"
- "Show me markets related to cryptocurrency"
- "Find markets about the S&P 500"
- "Get the order book for INXD-25JAN20"
- "What is the current implied probability for this market?"
- "Show me recent trades on this market"
- "What's my current account balance?"
- "Show me my open positions"
- "What trades have I made today?"
- "List my recent settlements"
- "Place a limit buy order for 10 Yes contracts at 45 cents on [market]"
- "Cancel my order with ID [order_id]"
- "Show me all my resting orders"
Cancel multiple orders at once (up to 20 orders per batch).
| Parameter | Type | Required | Description |
|---|---|---|---|
ids |
array | β | Array of order IDs to cancel (max 20) |
Get the current account balance and portfolio value. Values are returned in dollars.
No parameters
Get the current orderbook for a market showing bid prices and quantities for both Yes and No sides.
| Parameter | Type | Required | Description |
|---|---|---|---|
ticker |
string | β | The market ticker |
depth |
number | Depth of orderbook to retrieve (1-100, default 10) |
pnpm run buildpnpm run watchpnpm run lint
pnpm run formatsrc/tools/: Individual tool definitionssrc/services/: API client and business logicsrc/lib/: Shared utilities (config, http)src/index.ts: Server entry point
Your RSA private key is used to sign API requests. Here's what you need to know:
Your Key Stays Safe:
- The MCP server runs entirely on your local machine
- Your private key never leaves your computer
- No data is sent to any third-party servers except Kalshi's official API
Important Security Practices:
- Never commit your private key to version control
- Never share your configuration file containing the key path
- Only use this on trusted, secure machines
This project is an unofficial tool and is not directly affiliated with Kalshi. It interacts with financial and prediction market data. Users should exercise caution and verify all data independently. Trading in prediction markets involves risk.