# mcp-server-kalshi

Wires Kalshi prediction markets into your agent: browse markets, read settlement rules, and place orders through MCP tools.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 31
- Author: 9crusher
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/9crusher/mcp-server-kalshi
- Updated: 2026-09-19
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-server-kalshi

## What it does

The server covers a full trade cycle. `list_markets` and `get_market` locate a market, `get_market_orderbook` and `get_market_candlesticks` supply the numbers, and `get_market_rules` pulls together primary and secondary rules, early-close conditions and settlement sources. `fetch_rules_pdf` downloads the legal contract and extracts its text so the agent can read it. Orders go through `create_order`, `cancel_order`, `amend_order` and `decrease_order`. Kalshi offers no free-text search, so `list_markets` filters are how you look.

Safety defaults matter here. The server points at Kalshi's demo sandbox unless you set `KALSHI_ENV=prod`. Order-placing tools need `confirm=true`; without it you get a preview with a readable summary and the exact payload, and nothing is submitted. Market and rules tools run unauthenticated — an API key plus RSA private key are only required for portfolio and trading calls.

Prices are given as whole cents alongside `action` (buy/sell) and `side` (yes/no), and the server translates that into Kalshi's V2 format, buy-NO and sell-YES price inversion included. Running it locally takes Python 3.10+ and `uv sync`, then `uv run start`. Requests are signed with RSA-PSS, so trading tools stay dead until the `.pem` private key path is set.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `KALSHI_ENV`, `KALSHI_API_KEY`, `KALSHI_PRIVATE_KEY_PATH`, `BASE_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env KALSHI_ENV=<KALSHI_ENV> --env KALSHI_API_KEY=<KALSHI_API_KEY> --env KALSHI_PRIVATE_KEY_PATH=<KALSHI_PRIVATE_KEY_PATH> --env BASE_URL=<BASE_URL> --transport stdio mcp-server-kalshi -- uvx mcp-server-kalshi
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-server-kalshi <command>

### Codex

**Platform CLI**
```bash
codex mcp add mcp-server-kalshi --env KALSHI_ENV=<KALSHI_ENV> --env KALSHI_API_KEY=<KALSHI_API_KEY> --env KALSHI_PRIVATE_KEY_PATH=<KALSHI_PRIVATE_KEY_PATH> --env BASE_URL=<BASE_URL> -- uvx mcp-server-kalshi
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-server-kalshi <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-server-kalshi": {
            "command": "uvx",
            "args": [
                "mcp-server-kalshi"
            ],
            "env": {
                "KALSHI_ENV": "<KALSHI_ENV>",
                "KALSHI_API_KEY": "<KALSHI_API_KEY>",
                "KALSHI_PRIVATE_KEY_PATH": "<KALSHI_PRIVATE_KEY_PATH>",
                "BASE_URL": "<BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-server-kalshi <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-server-kalshi": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mcp-server-kalshi"
            ],
            "env": {
                "KALSHI_ENV": "<KALSHI_ENV>",
                "KALSHI_API_KEY": "<KALSHI_API_KEY>",
                "KALSHI_PRIVATE_KEY_PATH": "<KALSHI_PRIVATE_KEY_PATH>",
                "BASE_URL": "<BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-server-kalshi <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e KALSHI_ENV=<KALSHI_ENV> -e KALSHI_API_KEY=<KALSHI_API_KEY> -e KALSHI_PRIVATE_KEY_PATH=<KALSHI_PRIVATE_KEY_PATH> -e BASE_URL=<BASE_URL> mcp-server-kalshi uvx mcp-server-kalshi
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-server-kalshi <command>

## When to use it
- find a Kalshi market through filters when there is no text search
- read the exact settlement rules before committing to a trade
- download and extract the contract-terms PDF
- check the orderbook and recent trades for a market
- place an order with a preview instead of firing it off blind

## Example prompts
- List open Kalshi markets matching my filters and pick the most liquid ones
- Pull the settlement rules for this market and fetch the contract PDF
- Place a buy YES order at 40 cents, but show me the preview first

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
