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.2.tar.gz (6.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.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_server_kalshi-0.1.2.tar.gz
  • Upload date:
  • Size: 6.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.2.tar.gz
Algorithm Hash digest
SHA256 5738dd8f21f3232ceebb13f6c11d75a05800a28c074c92e0d284bbc67babc0f4
MD5 4a92aabafdd9715db10c9a93bb6dff34
BLAKE2b-256 25eb054c73805f711b6183f0127f72d4b96674079471f59587661f892218a9f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_kalshi-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_kalshi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a738b8852ff1194f50d82ff059b6f49038483fd1461401af338a5c7274e863d5
MD5 4c0c0ef9630a84262d2dde42ff4151b6
BLAKE2b-256 e1283372924965eff3754c19bf901d1edeeb157f1c2d782ba15935697f6e36cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_server_kalshi-0.1.2-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