Skip to main content

An MCP server implementation for Kalshi prediction market endpoints

Project description

MCP Server Kalshi

This is an MCP server for the Kalshi REST API

Configuration

Claude Desktop

Setting up with UVX
"mcpServers": {
  "kalshi": {
    "command": "uvx",
    "args": ["mcp-server-kalshi"],
    "env": {
        "KALSHI_PRIVATE_KEY_PATH": "PATH TO YOUR RSA KEY FILE",
        "KALSHI_API_KEY": "<YOUR KALSHI API KEY>",
        "BASE_URL": "https://api.elections.kalshi.com"
    }
  }
}
Setting up with Docker
  1. Build the container from root directory docker build -t mcp-server-kalshi .

  2. Configure client to run the container (ensure the bind command gives the container access to your rsa key files)

"mcpServers": {
  "kalshi": {
    "command": "docker",
    "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "-e", "KALSHI_PRIVATE_KEY_PATH", "-e", "KALSHI_API_KEY","-e", "BASE_URL", "mcp-server-kalshi"],
    "env": {
        "KALSHI_PRIVATE_KEY_PATH": "PATH TO YOUR RSA KEY FILE",
        "KALSHI_API_KEY": "<YOUR KALSHI API KEY>",
        "BASE_URL": "https://api.elections.kalshi.com"
    }
  }
}

Local Development

  1. Create a .env file in the root directory with the following variables

    • BASE_URL The kalshi API URL
    • KALSHI_API_KEY The API key for the corresponding environment
    • KALSHI_PRIVATE_KEY_PATH A filepath to a file containing your Kalshi RSA private key
  2. Install deps via uv pip install -e . Dev deps can be installed with uv pip install -e .[dev]

  3. Run with uv run start

Getting Kalshi API Creds

To get Kalshi API creds, follow the instrictions here

Getting a Test Account

You may want to run the server against a kalshi demo account. To get an account, follow the instructions here

Then, set BASE_URL=https://demo-api.kalshi.co for this MCP server and update your KALSHI_API_KEY and KALSHI_PRIVATE_KEY_PATH to point towards credentials generated in the testing environment

UVX

To run in MCP inspector

npx @modelcontextprotocol/inspector uv --directory /path/to/your/mcp-server-kalshi run start

To run in claud desktop, update your MCP config to:

{
    "mcpServers": {
        "kalshi": {
            "command": "uv",
            "args": [ 
            "--directory",
            "/<path to repo root directory>",
            "run",
            "start"
            ],
            "env": {
                "KALSHI_PRIVATE_KEY_PATH": "PATH TO YOUR RSA KEY FILE",
                "KALSHI_API_KEY": "<YOUR KALSHI API KEY>",
                "BASE_URL": "https://api.elections.kalshi.com"
            }
        }
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_9crusher_mcp_server_kalshi-0.1.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_9crusher_mcp_server_kalshi-0.1.4.tar.gz.

File metadata

  • Download URL: iflow_mcp_9crusher_mcp_server_kalshi-0.1.4.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_9crusher_mcp_server_kalshi-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a1518eb40b5f2909c97f0b09d69370b6fc1bd8fdb1609b7475388d91b173dd0a
MD5 2ac49a43afe5706d35d23ea62b530c58
BLAKE2b-256 e91f62565a78d86d1c65fb2aa101bed227b45129a80fb450989db3c42e21ecb3

See more details on using hashes here.

File details

Details for the file iflow_mcp_9crusher_mcp_server_kalshi-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_9crusher_mcp_server_kalshi-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_9crusher_mcp_server_kalshi-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3fd454dc38828ad4c61ec079aa2c70a2999cc8a2dc96d1d0ab049092b7fd7ac6
MD5 407caaea6857ebf19a22dae07c9253a0
BLAKE2b-256 d45e1c19ba63e4b71a87a0063dd2bf35d8b2f9fb439587c19e72cc5efe403e15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page