MCP Server Kalshi

by 9crusher

21 stars
211 downloads
Not rated
GitHub

About

It is an MCP (Model Context Protocol) server that gives Claude Code and other agent harnesses a first-class interface to Kalshi, the regulated prediction-market exchange. It supports end-to-end trading: browsing markets, researching them, reading settlement rules, pulling…

Details

Author
9crusher
GitHub stars
21
Downloads
211
Categories
Finance, Other, API
Tags
#trading

- Discover markets, events, and series with filtering (no free‑text search).
- Research markets via orderbook, candlesticks, and trade history.
- Read full settlement rules and download contract‑terms PDFs.
- Manage portfolio: balance, positions, fills, settlements.
- Place, cancel, amend, and decrease orders with a natural buy/sell model.
- Safety defaults: demo environment, preview‑only orders, optional credentials for read tools.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Server Kalshi
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure via environment variables (KALSHI_ENV, KALSHI_API_KEY, KALSHI_PRIVATE_KEY_PATH). Run with uvx mcp-server-kalshi or via Docker. The server targets the Kalshi demo sandbox by default; set KALSHI_ENV=prod for real money. Order-placing tools require confirm=true to execute; without it they only return a preview.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp server kalshi": {
            "mcp-server-kalshi": {
                "command": "npx",
                "args": [
                    "@modelcontextprotocol/inspector",
                    "uv",
                    "--directory",
                    "/path/to/mcp-server-kalshi",
                    "run",
                    "start"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-kalshi": {
        "command": "npx",
        "args": [
            "@modelcontextprotocol/inspector",
            "uv",
            "--directory",
            "/path/to/mcp-server-kalshi",
            "run",
            "start"
        ]
    }
}

- Discoverylist_markets,get_market,list_events,get_event,list_series,get_series. (Kalshi has no free-text search;list_marketsfilters are the search.)
- Researchget_market_orderbook,get_market_candlesticks,get_market_trades.
- Deep rulesget_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.
- Exchangeget_exchange_status,get_exchange_schedule(is the market open, and its hours).
- Portfolioget_balance,get_positions,get_fills,get_settlements.
- Tradingcreate_order,cancel_order,amend_order,decrease_order, pluslist_orders/get_order.

- The server targets Kalshi'sdemo (sandbox)environment unless you explicitly setKALSHI_ENV=prod.
- Order-placing tools (create_order,amend_order) requireconfirm=true. Without it they return apreview— a human-readable summary and the exact payload — and place nothing.
- Credentials areoptional: all market/rules tools work unauthenticated. Only portfolio and order tools need an API key + RSA private key.

Kalshi's V2 order API quotes everything from the YES leg (bid/askin fixed-point dollars). This server exposes the natural model instead —action(buy/sell) +side(yes/no) + a wholecentslimit price — and translates it (including the buy-NO ⇄ sell-YES price inversion).

See.env-example. Get API credentials atdocs.kalshi.com/getting_started/api_keysand a demo account via thedemo environment guide.

"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" } } }
"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" } } }

- 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.

npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-server-kalshi run start
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 injectedhttpx.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.

Requests are signed with RSA-PSS (MGF1-SHA256, max salt). Each authenticated request sendsKALSHI-ACCESS-KEY,KALSHI-ACCESS-TIMESTAMP, andKALSHI-ACCESS-SIGNATURE, where the signed message istimestamp_ms + METHOD + path(path includes/trade-api/v2, excludes the query string).

The Capital.com MCP Server lets your AI assistant talk to your trading account directly. Market data, position checks, trade previews – all in plain language, without leaving your AI tool.

The official Unusual Whales API and MCP Server gives you 100+ endpoints for options flow, dark pool, congressional trading, Greek exposure, volatility, and more. Connect via REST, WebSocket, Kafka, or MCP.

Real-time and historical FX/crypto signal API for AI agents. Pay-per-call via x402 protocol on Base. No subscription, no API key. Correlation, regime, momentum, volatility across 10 instruments.

US/HK markets — 110 tools: real-time quotes, options, orders, fundamentals, alerts, DCA & portfolio

WunderTrading MCP connects AI agents to live crypto trading execution on 20+ supported exchanges through a single MCP integration. Use it to turn AI-driven signals, market analysis, sentiment, screenshots, and custom strategy logic into real trades on exchanges including Binance, Bybit, Coinbase, Bitget, OKX, KuCoin, Hyperliquid, and BingX. Supports MCP and REST API workflows for order execution, trade management, and AI-powered automation.

Interact with the Alpaca trading API for stock trading, market data, and account management.

A server for interacting with the Alpaca trading API. Requires API credentials via environment variables.

Interact with Alpaca's Trading API for stock trading, portfolio management, and real-time market data.

Manage stock and crypto portfolios, place trades, and access market data via the Alpaca Trading API.

Provides seamless access to the Binance exchange API. Requires Binance API credentials to be configured.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.