Skip to main content
Glama
spacegpu

Kalshi MCP Server

by spacegpu

Kalshi MCP Server

FastMCP server for Kalshi's Trade API.

Setup

This repo vendors fastmcp/, so run commands from the repository root:

python -m kalshi_mcp.server

By default the server uses Kalshi's demo API host. Configure it with environment variables:

export KALSHI_ENV=demo
export KALSHI_API_KEY_ID="your-key-id"
export KALSHI_PRIVATE_KEY_PATH="/path/to/kalshi-private-key.pem"

You can also provide KALSHI_PRIVATE_KEY directly. Escaped newlines are supported.

Trading tools are disabled unless explicitly enabled:

export KALSHI_ENABLE_TRADING=true

Even then, order_create, order_cancel, rfq_create, and rfq_delete require confirm=true on each call.

Related MCP server: Kalshi MCP Server

Tool Coverage

The server exposes 49 tools covering the core Predictions REST API areas:

  • Exchange status, schedule, announcements, and user-data timestamp

  • Markets, market orderbooks, market trades, candlesticks, and series

  • Events, event metadata, event fee changes, event candlesticks, and multivariate events

  • Portfolio balance, subaccount balances, positions, fills, settlements, deposits, and withdrawals

  • Orders, order lookup, order queue positions, V2 create order, and V2 cancel order

  • Account limits, API usage progress, endpoint costs, and API key listing

  • Historical cutoffs, historical markets, historical candlesticks, historical trades, historical orders, and historical fills

  • Communications ID, RFQs, quotes, create RFQ, and delete RFQ

Tool names are prefix-grouped for IDEs and MCP clients that display tools as a flat list:

  • exchange_*

  • market_*

  • series_*

  • event_*

  • portfolio_*

  • order_*

  • account_*

  • historical_*

  • communications_*, rfq_*, and quote_*

Local MCP Config

Many IDEs and MCP clients can run this server from an mcp.json config. Use this shape and adjust paths/secrets for your machine:

{
  "mcpServers": {
    "kalshi": {
      "command": "python",
      "args": ["-m", "kalshi_mcp.server"],
      "cwd": "",
      "env": {
        "KALSHI_API_KEY_ID": "your-key-id",
        "KALSHI_PRIVATE_KEY_PATH": "/path/to/kalshi-private-key.pem"
      }
    }
  }
}

For public market-data tools, the env block can be omitted. Authenticated portfolio/order tools require KALSHI_API_KEY_ID and either KALSHI_PRIVATE_KEY_PATH or KALSHI_PRIVATE_KEY.

cwd is included because this is a source checkout that vendors fastmcp/ locally. If you install this package into the Python environment used by your MCP client, cwd is not needed.

Optional environment variables:

  • KALSHI_ENV=production switches from demo to production. The default is demo.

  • KALSHI_ENABLE_TRADING=true enables write tools such as order placement and RFQ creation. Those tools still require confirm=true on each call.

Notes

Kalshi authenticated requests are signed with RSA-PSS over the concatenated timestamp, HTTP method, and request path without query parameters.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables users to search, analyze, and trade on Kalshi prediction markets directly through MCP-compatible clients. It supports portfolio management, market data retrieval, and limit order execution with production-grade authentication and rate limiting.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Self-hosted MCP server for trading on Kalshi prediction markets via DFlow on Solana, enabling account management, market discovery, trading, swaps, transfers, and redemption.
    11 npm
    1
    PolyForm Noncommercial 1.0.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    FastMCP server exposing brokerage and market tools (Angel One, Coinbase, News) via the Model Context Protocol, enabling portfolio queries and trade execution through natural language.
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server for the Kalshi prediction market trading platform. It provides automated access to market data, order management, and portfolio operations through Kalshi's REST API.
    MIT