Get the FREE Ultimate OpenClaw Setup Guide →

mcp -kalshi

A MCP server to interact with Kalshi prediction markets

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio 9crusher-mcp-server-kalshi uvx mcp-server-kalshi \
  --env BASE_URL="https://api.elections.kalshi.com" \
  --env KALSHI_API_KEY="<YOUR KALSHI API KEY>" \
  --env KALSHI_PRIVATE_KEY_PATH="PATH TO YOUR RSA KEY FILE"

How to use

This MCP server integrates with the Kalshi REST API. It exposes Kalshi endpoints through the MCP framework, enabling clients to fetch data and interact with Kalshi using the standardized MCP tooling. You can run the server using UVX in a development environment or via Claude Desktop. The configuration expects credentials (private key path and API key) and a base URL for the Kalshi API. To inspect and interact with the server locally, you can leverage the MCP inspector or Kalshi's live/demo endpoints depending on your BASE_URL.

Key capabilities include: authenticating with Kalshi using a private RSA key, signing requests with your Kalshi API key, and routing requests to the Kalshi API as defined by the server. The UVX-based workflow allows you to run the server in a directory with run start, while the inspector provides a debugging interface for exploring the MCP endpoints. If you are targeting a test environment, you can switch BASE_URL to the Kalshi demo endpoint and provide credentials accordingly.

How to install

Prerequisites:\n- Python and pip installed on your system.\n- uv (the MPC runtime) available (install via pip: 'pip install uv'.)\n- Access to a Kalshi private key file and a Kalshi API key.\n- Optional: Docker if you prefer containerized deployment.\n\nStep-by-step installation:\n1) Clone or download the MCP server repository to your local machine.\n2) Create and activate a Python virtual environment (recommended):\n - python -m venv venv\n - source venv/bin/activate (unix/macOS) or venv\Scripts\activate (Windows)\n3) Install the development dependencies (and the MCP runtime):\n - uv pip install -e . [or the equivalent project install command if different in your repo]\n - uv pip install -e .[dev] (for development dependencies)\n4) Prepare environment configuration: create a .env file in the project root containing:\n - BASE_URL, KALSHI_API_KEY, KALSHI_PRIVATE_KEY_PATH\n5) Run the server locally:\n - uv run start\n6) If using Docker: build and run the container as described in the README:\n - docker build -t mcp-server-kalshi .\n - docker run --rm -i --mount type=bind,src=/path/to/keys,dst=/path/to/keys -e KALSHI_PRIVATE_KEY_PATH -e KALSHI_API_KEY -e BASE_URL mcp-server-kalshi\n\nNotes:\n- Update BASE_URL to point to the correct Kalshi API (production or demo).\n- Ensure your RSA private key file is accessible at the path specified by KALSHI_PRIVATE_KEY_PATH.\n- If you are using UVX in MCP inspector or Claude Desktop, follow the respective configuration examples from the README to point to the local repository and run the server.\n

Additional notes

Tips and common issues:\n- Ensure the KALSHI_PRIVATE_KEY_PATH points to a valid RSA private key file. If the key is missing or unreadable, authentication will fail.\n- The BASE_URL must be correct for production or demo environments; a wrong URL will lead to HTTP errors when contacting Kalshi.\n- When using Docker, ensure that the RSA key file path is accessible inside the container if you mount the host path into the container.\n- If you encounter protocol errors in inspector mode, verify that the directory path provided to UVX matches the actual repository location and that the server has started without compilation errors.\n- For development, you can run with the MCP inspector to quickly test endpoints and view responses.\n

Related MCP Servers

Sponsor this space

Reach thousands of developers