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.0.tar.gz (5.6 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.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_server_kalshi-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 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.0.tar.gz
Algorithm Hash digest
SHA256 b45361c5256118649dbc868f14af95b39c630e756b2fc961bebfdcdd027b9327
MD5 533a660f42c7ff4e0a025f3927d5e571
BLAKE2b-256 55726455e42f933c0e15315eff60a976d98d98f2a6a5596f188eb514310a2926

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mcp_server_kalshi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 611e87702b0d8cb01cff7738893b5abc0c2daa941192769c32412e06d0d17b5e
MD5 6887240a5fa54500da98326697ca5338
BLAKE2b-256 01e2e21021c824c2ac173d5b936b477594a4812ee4d2a9ce555038e31118f4ec

See more details on using hashes here.

Provenance

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