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

Claud 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

mcp_server_kalshi-0.1.3.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

mcp_server_kalshi-0.1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_kalshi-0.1.3.tar.gz.

File metadata

  • Download URL: mcp_server_kalshi-0.1.3.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_server_kalshi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 94b48a5d00f33475caff1ff2c0f106adc59da68e968c6ae9169e88a887453121
MD5 4729c69ef290ff95684356a7fc155de3
BLAKE2b-256 e7a9913095db4c5c9924ade7839180f400c3d6fb1e922f333393a07b15adc277

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_kalshi-0.1.3.tar.gz:

Publisher: deploy.yml on 9crusher/mcp-server-kalshi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_server_kalshi-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_kalshi-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e4ac940d45249ff31214d668a3c37e7806c2fd88920a88fa3ca3b6fdd9e192c7
MD5 230a11f80d3ca2b81dde8c2131b10948
BLAKE2b-256 11c19824ab24a9f11f06eb2315c32f8e18ad634b63cd57bd0ba06d95c4aba1a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_kalshi-0.1.3-py3-none-any.whl:

Publisher: deploy.yml on 9crusher/mcp-server-kalshi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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