pypi kalshi-mcpstdioMITupdated 6mo ago
Model Context Protocol server for Kalshi prediction markets. Search, analyze, and trade prediction markets directly through Claude Desktop.
O que dá para fazer com kalshi?
Kalshi MCP Server
mcp-name: io.github.yakub268/kalshi
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/volumeget_market_details- Full market info + orderbook depthget_portfolio- Account balance + open positionsget_trending_markets- Top markets by 24h volumeplace_order- Execute limit ordersget_series_markets- All markets in a series (e.g., Fed events)
Resources (2)
kalshi://balance- Current account balancekalshi://positions- Open positions list
Installation
Prerequisites
-
Kalshi API credentials: Get from kalshi.com/profile/api-keys
- Download your API key ID
- Download the RSA private key (.pem file)
-
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-herewith your actual Kalshi API key - Update the private key path to where you saved your
.pemfile - 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:
- Each request is signed with your private key
- Kalshi verifies the signature with your public key
- Thread-safe rate limiting (150ms between requests)
- 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
- Built with FastMCP
- Kalshi API documentation: docs.kalshi.com
- Production code from my trading bot arsenal
Questions? Open an issue or reach out on GitHub.
Instalação
Adicione kalshi ao seu cliente. Escolha o que você usa.
claude mcp add kalshi-mcp -- uvx kalshi-mcpcodex mcp add kalshi-mcp -- uvx kalshi-mcpamp mcp add kalshi-mcp -- uvx kalshi-mcp{
"mcpServers": {
"kalshi-mcp": {
"command": "uvx",
"args": [
"kalshi-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"kalshi-mcp": {
"command": "uvx",
"args": [
"kalshi-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"kalshi-mcp","command":"uvx","args":["kalshi-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"kalshi-mcp": {
"command": "uvx",
"args": [
"kalshi-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"kalshi-mcp": {
"command": "uvx",
"args": [
"kalshi-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"kalshi-mcp": {
"command": "uvx",
"args": [
"kalshi-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"kalshi-mcp": {
"type": "local",
"command": "uvx",
"args": [
"kalshi-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"kalshi-mcp": {
"command": {
"path": "uvx",
"args": [
"kalshi-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
uvx kalshi-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
Pontuação
59 / 100
Aceitável
- Documentação22/25
- Manutenção9/25
- Confiança13/20
- Capacidade3/15
- Instalação12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 192 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Histórico de versões
| Versões | Publicada |
|---|---|
| 0.1.1Mais recente | 21 de fev. de 2026 |