io.github.9crusher/mcp-server-kalshi MCP Server
io.github.9crusher/mcp-server-kalshi
End-to-end trading on Kalshi prediction markets: discover, research, and execute trades through Claude.
What is the io.github.9crusher/mcp-server-kalshi MCP server?
The Kalshi MCP server gives Claude and other AI agents a first-class interface to Kalshi prediction markets. It enables browsing markets, researching them with orderbook and candlestick data, reading exact settlement rules and contract PDFs, and executing trades—all through MCP tools. By default it targets Kalshi's demo (sandbox) environment for safety.
This server provides complete market trading capabilities for Kalshi prediction markets. You can discover and filter markets, pull detailed research data including orderbooks and trade history, read the exact legal settlement rules and contract PDFs, check your portfolio and positions, and place, amend, or cancel orders. Order-placing tools require explicit confirmation to prevent accidental trades, and all market/rules tools work without authentication.
How to install io.github.9crusher/mcp-server-kalshi
Copy-paste configuration for popular MCP clients.
KALSHI_ENVdemo (sandbox) or prod (real money)
KALSHI_API_KEYsecretKalshi API key ID; required only for portfolio/order tools
KALSHI_PRIVATE_KEY_PATHPath to your RSA private key .pem; required for authenticated tools
BASE_URLOptional explicit REST base override (must include /trade-api/v2)
Tools & capabilities
Tools this server exposes to the agent.
list_markets— List and filter Kalshi markets by event, series, or other criteria.get_market— Retrieve detailed information about a specific market.list_events— List Kalshi events.get_event— Retrieve details about a specific event.list_series— List Kalshi series.get_series— Retrieve details about a specific series.get_market_orderbook— Get the current orderbook (bid/ask) for a market.get_market_candlesticks— Retrieve candlestick price data for a market.get_market_trades— Get recent trades for a market.get_market_rules— Consolidate a market's rules, early-close conditions, settlement sources, and series prohibitions.fetch_rules_pdf— Download and extract text from the market's legal contract PDF.get_exchange_status— Check if the Kalshi market is currently open.get_exchange_schedule— Get Kalshi market hours and schedule.get_balance— Retrieve your account balance.get_positions— Get your current positions in markets.get_fills— Retrieve your order fills and execution history.get_settlements— Get your settlement history.create_order— Place a new order (requires confirm=true to execute; returns preview otherwise).cancel_order— Cancel an existing order.amend_order— Modify an existing order (requires confirm=true to execute; returns preview otherwise).
Use cases
- Discover and filter prediction markets on Kalshi, then research them with orderbook, candlestick, and trade data before deciding to trade.
- Read the exact legal settlement rules and contract PDFs for a market to understand how it will be resolved.
- Execute a complete trading workflow: place an order with a preview confirmation, monitor your positions and fills, and amend or cancel orders as needed.
- Analyze market microstructure by pulling orderbooks and recent trades to understand price dynamics and liquidity.
- Manage your Kalshi portfolio: check your balance, positions, and settlement history across multiple markets.
io.github.9crusher/mcp-server-kalshi MCP server FAQ
It's an MCP server that gives Claude and other AI agents full access to Kalshi prediction markets—from discovering and researching markets to executing trades, reading settlement rules, and managing your portfolio.
The server itself is free and open-source. Kalshi trading may have fees; see kalshi.com for details. The server defaults to Kalshi's demo (sandbox) environment, so you can test without real money.
Install via `uvx mcp-server-kalshi` or Docker. Add the configuration to Claude Desktop's `claude_desktop_config.json` with your Kalshi API key and RSA private key path (optional for unauthenticated tools).
No. Market discovery, research, rules, and exchange status tools work without credentials. Only portfolio and order-placement tools require a Kalshi API key and RSA private key.
Order-placing tools (`create_order`, `amend_order`) require `confirm=true` to execute. Without it, they return a human-readable preview and the exact payload—but place nothing. This prevents accidental trades.
The server targets Kalshi's demo (sandbox) environment by default. Set `KALSHI_ENV=prod` only when you're ready to trade with real money.
README (reference)
Source of truth, from the repository.
MCP Server Kalshi
<!-- mcp-name: io.github.9crusher/mcp-server-kalshi -->An MCP server that gives Claude Code and other agent harnesses a first-class interface to Kalshi. It is built for end-to-end trading: browse markets, research them, read the exact settlement rules (including pulling the contract-terms PDFs), and execute trades — all through MCP tools.
Highlights
- Discovery —
list_markets,get_market,list_events,get_event,list_series,get_series. (Kalshi has no free-text search;list_marketsfilters are the search.) - Research —
get_market_orderbook,get_market_candlesticks,get_market_trades. - Deep rules —
get_market_rulesconsolidates a market'srules_primary/rules_secondary, early-close conditions, settlement sources, and series prohibitions;fetch_rules_pdfdownloads and extracts the text of the actual legal contract PDF so the agent can read it. - Exchange —
get_exchange_status,get_exchange_schedule(is the market open, and its hours). - Portfolio —
get_balance,get_positions,get_fills,get_settlements. - Trading —
create_order,cancel_order,amend_order,decrease_order, pluslist_orders/get_order.
Safety by default
- The server targets Kalshi's demo (sandbox) environment unless you explicitly set
KALSHI_ENV=prod. - Order-placing tools (
create_order,amend_order) requireconfirm=true. Without it they return a preview — a human-readable summary and the exact payload — and place nothing. - Credentials are optional: all market/rules tools work unauthenticated. Only portfolio and order tools need an API key + RSA private key.
Intuitive order model
Kalshi's V2 order API quotes everything from the YES leg (bid/ask in fixed-point dollars).
This server exposes the natural model instead — action (buy/sell) + side (yes/no) + a whole
cents limit price — and translates it (including the buy-NO ⇄ sell-YES price inversion).
Configuration
| Variable | Default | Purpose |
|---|---|---|
KALSHI_ENV | demo | demo (sandbox) or prod (real money). Derives the base URL. |
KALSHI_API_KEY | (none) | Kalshi API key ID. Required only for authenticated tools. |
KALSHI_PRIVATE_KEY_PATH | (none) | Path to your RSA private key .pem. Required for authenticated tools. |
BASE_URL | (derived) | Optional explicit REST base override (must include /trade-api/v2). |
See .env-example. Get API credentials at
docs.kalshi.com/getting_started/api_keys
and a demo account via the
demo environment guide.
Claude Desktop (uvx)
"mcpServers": {
"kalshi": {
"command": "uvx",
"args": ["mcp-server-kalshi"],
"env": {
"KALSHI_ENV": "demo",
"KALSHI_API_KEY": "<YOUR KALSHI API KEY>",
"KALSHI_PRIVATE_KEY_PATH": "PATH TO YOUR RSA KEY FILE"
}
}
}
Claude Desktop (Docker)
"mcpServers": {
"kalshi": {
"command": "docker",
"args": ["run", "--rm", "-i",
"--mount", "type=bind,src=/Users/username,dst=/Users/username",
"-e", "KALSHI_ENV", "-e", "KALSHI_API_KEY", "-e", "KALSHI_PRIVATE_KEY_PATH",
"mcp-server-kalshi"],
"env": {
"KALSHI_ENV": "demo",
"KALSHI_API_KEY": "<YOUR KALSHI API KEY>",
"KALSHI_PRIVATE_KEY_PATH": "PATH TO YOUR RSA KEY FILE"
}
}
}
Local Development
- Create a
.envfile (see.env-example). - Install deps:
uv sync(add--extra devfor dev tools). Requires Python 3.10+. - Run:
uv run start. - Test:
uv run pytest.
MCP Inspector
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-server-kalshi run start
Testing & code quality
uv sync --extra dev # install dev tools (ruff, mypy, pytest, ...)
uv run pytest # run the test suite
uv run pytest --cov # tests with a coverage report
uv run ruff check src tests # lint
uv run black src tests # format (add --check to verify only)
uv run mypy # type check
uv run pre-commit install # (once) run ruff + black on every commit
Tests are pure/offline — they exercise the order translation and confirm-gate, the HTTP client
(via an injected httpx.MockTransport), the MCP tool registry, config, and PDF extraction, all
without touching the live Kalshi API. CI (.github/workflows/ci.yml) runs ruff + black + mypy +
pytest across Python 3.10–3.13 on every push/PR, and releases are gated on that same suite.
Authentication
Requests are signed with RSA-PSS (MGF1-SHA256, max salt). Each authenticated request sends
KALSHI-ACCESS-KEY, KALSHI-ACCESS-TIMESTAMP, and KALSHI-ACCESS-SIGNATURE, where the signed
message is timestamp_ms + METHOD + path (path includes /trade-api/v2, excludes the query
string).
Related MCP servers
70+ free calculators & converters as MCP tools; each result links to its source page.

Crypto (BTC/ETH) + ERCOT electricity data & forecasts as MCP tools. Pay-per-call via x402.

Avito Ads MCP
MCP server for the Avito Ads API: campaigns, ad groups, creatives, statistics and balances.

Google Apps Script MCP
MCP server for the Google Apps Script API: projects, code, versions, deployments and executions.

MCP server for Google Business Profile: locations, reviews, local posts and performance metrics.

Google Calendar MCP
MCP server for the Google Calendar API: events, recurrence, invitations, availability, calendars.