This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.2 instead.
Reason given by maintainers: Superceded (RSA implementation bug).
Kalshi MCP Server
An open-source Model Context Protocol (MCP) server for Kalshi’s Trade API v2. It gives MCP clients a practical interface for researching markets, reading an account, and managing orders with Kalshi’s RSA-PSS authentication.
Important: This server can place and cancel real orders. It defaults to Kalshi’s production environment; set
KALSHI_ENV=demoexplicitly for demo trading. Review the code, configure conservative limits, and test with demo credentials before using production credentials.
What it provides
Market research
- Exchange status
- Markets and events
- Individual market data
- Order books
- Public trades
Account and trading
- Balance, positions, and orders
- Current V2 order placement
- Batched order placement
- Individual and bulk cancellation
- Order amendment and quantity reduction
- Order-group creation, limits, reset, trigger, listing, and deletion
- Legacy order helpers retained for compatibility
The kalshi_endpoint tool also exposes the validated operations from the bundled Kalshi OpenAPI catalog. It checks the HTTP method, endpoint template, query parameters, request body, and authentication requirements before making a request.
Requirements
- Python 3.11 or newer
- A Kalshi API key and RSA private key
- An MCP-compatible client
Installation
From a released package or a source checkout:
python -m venv .venv
. .venv/bin/activate
python -m pip install -e .
For environments where cryptography must use prebuilt wheels:
python -m pip install --only-binary=:all: httpx cryptography mcp
Configuration
Copy the example configuration and provide credentials through your secret manager or process environment:
cp .env.example .env
Required for authenticated tools:
KALSHI_API_KEY_ID=your-api-key-id
KALSHI_PRIVATE_KEY_BASE64=base64-encoded-PEM-private-key
Environment selection is explicit. Production is the default:
# Default: production
KALSHI_ENV=production
# Explicit demo selection
KALSHI_ENV=demo
Optional settings:
KALSHI_BASE_URL— override the selected API base URL.KALSHI_PRIVATE_KEY_BASE64— base64-encoded PEM RSA private key; this avoids requiring the MCP host to provide filesystem access.KALSHI_MAX_ORDER_CONTRACTS— maximum contracts per order.KALSHI_MAX_ORDER_CENTS— maximum per-order notional in cents.KALSHI_DAILY_CONTRACT_LIMIT— intended daily contract ceiling.KALSHI_MIN_CASH_CENTS— intended minimum cash reserve.
Never commit .env, private keys, API credentials, or request signatures.
Running the server
Run the stdio server directly:
KALSHI_ENV=production kalshi-degen-mcp
Example configuration for an MCP client that supports local stdio servers:
{
"mcpServers": {
"kalshi": {
"command": "/absolute/path/to/.venv/bin/kalshi-degen-mcp",
"env": {
"KALSHI_ENV": "production",
"KALSHI_API_KEY_ID": "your-api-key-id",
"KALSHI_PRIVATE_KEY_BASE64": "base64-encoded-PEM-private-key"
}
}
}
}
For Hermes, use the same executable under its local MCP server configuration.
Safety and operational guidance
- Production is the default; select demo explicitly with
KALSHI_ENV=demo. - Production writes are not silently redirected to demo.
- Order tools reject invalid sides, prices, counts, and unsupported fixed-point formats.
- Per-order contract and notional caps are configurable.
- Start with demo credentials and small limits.
- Confirm the selected environment and account before placing or cancelling orders.
- Treat AI-generated trade decisions as untrusted until reviewed.
This project does not provide investment advice and does not guarantee profitable or error-free trading. You are responsible for credentials, orders, losses, and compliance with Kalshi’s terms.
Development
. .venv/bin/activate
pytest -q
python -m py_compile kalshi_mcp/*.py
The test suite covers endpoint resolution, request validation, order safety checks, batch validation, order-group validation, and strict fixed-point input rejection.
License
See the repository for licensing information.
Release files for kalshi-degen-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kalshi_degen_mcp-0.1.0.tar.gz | 59.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kalshi_degen_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 120.3 kB
Release files / kalshi_degen_mcp-0.1.0.tar.gz
| Download URL | kalshi_degen_mcp-0.1.0.tar.gz |
|---|---|
| Size | 59.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3721cc6d83b446123165fd7a79d2506f7f77dbe463caa7ac3a36d8926cc0be83
|
|
BLAKE2b-256 checksum How to use checksums |
bdff7d14b898cfc393af59c477cd8aad4998e2237e0c39a58777b64c2e8aac20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / kalshi_degen_mcp-0.1.0-py3-none-any.whl
| Download URL | kalshi_degen_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 60.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee44f4014fd920fd819cb136a45bd1d8b54cfde4a8006963fed9ad4c406a9e7a
|
|
BLAKE2b-256 checksum How to use checksums |
129c570418828889e62f1af7d97762d23973fae7db40ab5d86b9c3b0a15d4d9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log