
Mcp Server Kalshi
io.github.9crusherPublished by GitHub account 9crusherv0.2.2Updated Oct 24, 2026
MCP server for end-to-end trading on Kalshi prediction markets: discover, research, trade.
Overview
Lets an assistant browse Kalshi prediction markets, read settlement rules and contract PDFs, and place or manage trades.
- What you can do
- Provides MCP tools for discovering Kalshi markets, events and series, researching order books, candlesticks and trades, and reading settlement rules including extracted contract-terms PDF text. Portfolio tools read balance, positions, fills and settlements, and trading tools create, amend, decrease, cancel and list orders. Order tools use a buy/sell plus yes/no model with whole-cent limit prices, and order placement requires an explicit confirm flag or returns a preview only.
- When to use it
- Useful when an assistant should research prediction markets and possibly trade them end to end, from market discovery and rule reading through order execution. It fits agent workflows that need Kalshi market data or portfolio state, and it can be used read-only without credentials.
- Requirements
- Runs locally over stdio, typically via uvx or Docker, and requires Python 3.10+ for local development. Market and rules tools need no credentials; portfolio and order tools need KALSHI_API_KEY and KALSHI_PRIVATE_KEY_PATH pointing to an RSA private key .pem. KALSHI_ENV selects demo or prod, and BASE_URL can override the REST base. Network access to Kalshi is required.
Installation
In SourceWeft
- Open Mcp Server Kalshi in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
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
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)
Claude Desktop (Docker)
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
Testing & code quality
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).
Source: README.md at commit 0cadb81
Tools
0Version history
1- v0.2.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts