{
  "markdown": "# Kalshi MCP Server\n\nmcp-name: io.github.yakub268/kalshi\n\n[![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)\n[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n\n**Model Context Protocol server for Kalshi prediction markets.** Search, analyze, and trade prediction markets directly through Claude Desktop.\n\nBuilt with production-grade authentication and rate limiting from a live trading system with 4+ months of uptime.\n\n## Features\n\n### Tools (6)\n- **`search_markets`** - Search by keyword, get prices/volume\n- **`get_market_details`** - Full market info + orderbook depth\n- **`get_portfolio`** - Account balance + open positions\n- **`get_trending_markets`** - Top markets by 24h volume\n- **`place_order`** - Execute limit orders\n- **`get_series_markets`** - All markets in a series (e.g., Fed events)\n\n### Resources (2)\n- **`kalshi://balance`** - Current account balance\n- **`kalshi://positions`** - Open positions list\n\n## Installation\n\n### Prerequisites\n1. **Kalshi API credentials**: Get from [kalshi.com/profile/api-keys](https://kalshi.com/profile/api-keys)\n   - Download your API key ID\n   - Download the RSA private key (.pem file)\n\n2. **Python 3.10+**\n\n### Quick Install (PyPI)\n\n```bash\npip install kalshi-mcp\n```\n\n### From Source\n\n```bash\n# Clone repository\ngit clone https://github.com/yakub268/kalshi-mcp.git\ncd kalshi-mcp\n\n# Install dependencies\npip install -e .\n```\n\n### Claude Desktop Configuration\n\nAdd to your Claude Desktop config file:\n\n**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"kalshi\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"kalshi_mcp\"],\n      \"env\": {\n        \"KALSHI_API_KEY\": \"your-api-key-here\",\n        \"KALSHI_PRIVATE_KEY_PATH\": \"C:\\\\Users\\\\YourName\\\\.trading_keys\\\\kalshi_private_key.pem\"\n      }\n    }\n  }\n}\n```\n\n**Note**:\n- Replace `your-api-key-here` with your actual Kalshi API key\n- Update the private key path to where you saved your `.pem` file\n- On Windows, use double backslashes (`\\\\`) in paths\n\n### Test the Connection\n\nRestart Claude Desktop, then try:\n\n```\nWhat's my Kalshi balance?\n```\n\nor\n\n```\nSearch for bitcoin prediction markets\n```\n\n## Usage Examples\n\n### Search for Markets\n```\nSearch for markets about the Federal Reserve\n```\n\n### Get Market Analysis\n```\nShow me details for ticker KXFED-26MAR19-B5.25\n```\n\n### Check Portfolio\n```\nWhat's my current Kalshi portfolio?\n```\n\n### Place an Order\n```\nBuy 10 contracts of KXHIGHNYC-26FEB20-B34.5 YES at 25 cents\n```\n\n## Authentication\n\nThis server uses **RSA-PSS signature authentication**:\n1. Each request is signed with your private key\n2. Kalshi verifies the signature with your public key\n3. Thread-safe rate limiting (150ms between requests)\n4. Automatic retry on 429 rate limit errors\n\n**Security**: Your private key never leaves your machine. The server only signs requests locally.\n\n## Rate Limiting\n\n- Built-in 150ms spacing between requests (~6.6 req/s)\n- Automatic exponential backoff on 429 errors (0.5s → 1s → 2s)\n- Safe for concurrent use across multiple Claude conversations\n\n## Architecture\n\nBuilt on production code from a live Kalshi trading bot:\n- **Authentication**: Reused from `kalshi_client.py` (4+ months uptime)\n- **Rate limiting**: Shared across all client instances\n- **Error handling**: Battle-tested retry logic\n- **Market discovery**: Liquidity scoring from `scanner.py`\n\n## Contributing\n\nIssues and PRs welcome! This is an open-source project built to fill a gap in the MCP ecosystem.\n\n## License\n\nMIT License - see LICENSE file\n\n## Acknowledgments\n\n- Built with [FastMCP](https://github.com/jlowin/fastmcp)\n- Kalshi API documentation: [docs.kalshi.com](https://docs.kalshi.com)\n- Production code from my [trading bot arsenal](https://github.com/yakub268/trading_bot)\n\n---\n\n**Questions?** Open an issue or reach out on GitHub.\n",
  "bytes": 3981,
  "sha": "586944034cd494edb90366c8972e43c7b79b5fa1da1bba0b794ed332f9911498",
  "repo_slug": "yakub268/kalshi-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_yakub268_kalshi_0714b999/readme"
}