Kalshi 이벤트 계약 및 퍼페추얼 마켓을 위한 안전 중심 인터페이스를 제공하며, 페이퍼 트레이딩과 실거래 주문 실행을 모두 지원합니다.
다른 이름 copyleftdev/kalshi-kernel, kalshi-kernel
- 스타
- 0
- Tools
- 12
- 다운로드, 30일
- —
- 최신 버전
- 0.1.1
- 마지막 커밋
- 2026년 11월 14일
- 라이선스
- Apache-2.0
Kalshi Kernel MCP란?
Kalshi Kernel은(는) MCP server입니다. Kalshi 이벤트 계약 및 퍼페추얼 마켓을 위한 안전 중심 인터페이스를 제공하며, 페이퍼 트레이딩과 실거래 주문 실행을 모두 지원합니다. 12개 도구를 제공합니다. 예: kernel_status, search_markets, get_market.
프로젝트 README에서 생성된 요약
Kalshi Kernel MCP server 정보
Kalshi Kernel은 에이전트 인터페이스를 통해 Kalshi 이벤트 계약과 퍼페추얼 마켓을 거래할 수 있게 해줍니다. 이 MCP server는 Hermes나 Claude Code와 같은 AI 에이전트에게 광범위한 트레이딩 API 대신 엄격한 스키마 기반 도구를 제공하여 특화되고 좁은 경계를 설정합니다. 예측 가능한 에러 처리와 시뮬레이션 및 실거래 실행 간의 명확한 분리가 필요한 자율 에이전트 하네스를 구축하는 개발자를 위해 설계되었습니다.
사용자는 stdio 전송 방식을 통해 서버를 로컬에서 실행할 수 있습니다. 기본적으로 인메모리 원장과 $100.00의 시작 잔액을 사용하는 페이퍼 트레이딩 모드로 설정되어 있어, 리스크 없이 전략을 테스트하기에 이상적입니다. 실거래를 위해서는 API 키와 private key 경로를 포함한 특정 환경 변수가 필요합니다. 실수로 인한 거래를 방지하기 위해, 실거래 모드는 수동 승인 후 보조 프로세스 로컬 명령을 통해 명시적으로 활성화(armed)해야 합니다. 서버에는 실거래 세션 중 노출을 제어하기 위해 주문당 및 일일 명목 한도와 같은 안전 기능이 포함되어 있습니다.
활용 사례
- 1트레이딩 전략 시뮬레이션실제 자본을 위험에 빠뜨리지 않고 즉각적인 체결을 시뮬레이션하는 인메모리 원장을 사용하여 시장 가설을 테스트합니다.
- 2시장 데이터 모니터링이벤트 계약 및 퍼페추얼에 대한 실시간 시장 상세 정보, 오더북 스냅샷, 과거 캔들 데이터를 가져옵니다.
- 3실거래 이벤트 계약 주문 실행세션이 안전하게 활성화되면 Kalshi 프로덕션 API에 실제 주문을 생성, 수정 또는 취소합니다.
- 4한도를 통한 리스크 관리최대 일일 주문 횟수 및 명목 달러 금액을 설정하여 엄격한 재무적 경계를 강제합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
Kalshi Kernel MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 Kalshi Kernel MCP 설치
$ claude mcp add --env 'KALSHI_API_KEY_ID=<YOUR_KALSHI_API_KEY_ID>' kalshi-kernel -- docker run -i --rm ghcr.io/copyleftdev/kalshi-kernel:0.1.1Cursor에 Kalshi Kernel MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"kalshi-kernel": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/copyleftdev/kalshi-kernel:0.1.1"
],
"env": {
"KALSHI_API_KEY_ID": "<YOUR_KALSHI_API_KEY_ID>"
}
}
}
}VS Code에 Kalshi Kernel MCP 설치
.vscode/mcp.json
{
"servers": {
"kalshi-kernel": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/copyleftdev/kalshi-kernel:0.1.1"
],
"env": {
"KALSHI_API_KEY_ID": "<YOUR_KALSHI_API_KEY_ID>"
}
}
}
}VS Code CLI에 Kalshi Kernel MCP 설치
$ code --add-mcp '{"name":"kalshi-kernel","type":"stdio","command":"docker","args":["run","-i","--rm","ghcr.io/copyleftdev/kalshi-kernel:0.1.1"],"env":{"KALSHI_API_KEY_ID":"<YOUR_KALSHI_API_KEY_ID>"}}'Claude Desktop에 Kalshi Kernel MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"kalshi-kernel": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/copyleftdev/kalshi-kernel:0.1.1"
],
"env": {
"KALSHI_API_KEY_ID": "<YOUR_KALSHI_API_KEY_ID>"
}
}
}
}Codex에 Kalshi Kernel MCP 설치
$ codex mcp add kalshi-kernel --env 'KALSHI_API_KEY_ID=<YOUR_KALSHI_API_KEY_ID>' -- docker run -i --rm ghcr.io/copyleftdev/kalshi-kernel:0.1.1Codex config.toml에 Kalshi Kernel MCP 설치
~/.codex/config.toml
[mcp_servers.kalshi-kernel] command = "docker" args = ["run", "-i", "--rm", "ghcr.io/copyleftdev/kalshi-kernel:0.1.1"] [mcp_servers.kalshi-kernel.env] KALSHI_API_KEY_ID = "<YOUR_KALSHI_API_KEY_ID>"
Gemini CLI에 Kalshi Kernel MCP 설치
$ gemini mcp add -s user -e 'KALSHI_API_KEY_ID=<YOUR_KALSHI_API_KEY_ID>' kalshi-kernel docker -- run -i --rm ghcr.io/copyleftdev/kalshi-kernel:0.1.1Gemini settings.json에 Kalshi Kernel MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"kalshi-kernel": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/copyleftdev/kalshi-kernel:0.1.1"
],
"env": {
"KALSHI_API_KEY_ID": "<YOUR_KALSHI_API_KEY_ID>"
}
}
}
}Kalshi Kernel MCP 도구 12
README에서 감지됨kernel_statussearch_marketsget_marketget_orderbookget_candlesget_tradesget_lastarm_live_tradingget_portfolioplace_orderamend_ordercancel_order
| kernel_status | — | |
| search_markets | — | |
| get_market | — | |
| get_orderbook | — | |
| get_candles | — | |
| get_trades | — | |
| get_last | — | |
| arm_live_trading | — | |
| get_portfolio | — | |
| place_order | — | |
| amend_order | — | |
| cancel_order | — |
구성
KALSHI_API_KEY_ID비밀Kalshi API key identifier; used only in live mode
KALSHI_KERNEL_MODEImmutable execution mode; paper is the safe default
KALSHI_LIVE_TRADING_ACKExplicit live-risk acknowledgement documented by this project
KALSHI_MAX_DAILY_NOTIONAL_DOLLARSKALSHI_MAX_DAILY_ORDERSKALSHI_MAX_ORDER_NOTIONAL_DOLLARSKALSHI_PRIVATE_KEY_PATHPath to a mounted Kalshi private key; used only in live mode
| 이름 | 설명 | 유형 |
|---|---|---|
| KALSHI_API_KEY_ID | Kalshi API key identifier; used only in live mode | 비밀 |
| KALSHI_KERNEL_MODE | Immutable execution mode; paper is the safe default | |
| KALSHI_LIVE_TRADING_ACK | Explicit live-risk acknowledgement documented by this project | |
| KALSHI_MAX_DAILY_NOTIONAL_DOLLARS | — | |
| KALSHI_MAX_DAILY_ORDERS | — | |
| KALSHI_MAX_ORDER_NOTIONAL_DOLLARS | — | |
| KALSHI_PRIVATE_KEY_PATH | Path to a mounted Kalshi private key; used only in live mode |
자동 검사
2026년 11월 13일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨통과
- 모델에 대한 숨겨진 지침 없음통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
README
GitHub에서 보기Kalshi Kernel
An unofficial, safety-focused Model Context Protocol (MCP) server for Kalshi event contracts and perpetual markets. This is a pre-release project that is not ready for trading. The server is designed for agent harnesses such as Hermes and exposes a deliberately small tool surface generated from Kalshi's published API contracts.
Canonical publisher: CopyleftDev. Planned
source and container releases use github.com/copyleftdev/kalshi-kernel and
ghcr.io/copyleftdev/kalshi-kernel respectively.
[!CAUTION] Pre-release software that can submit real orders. Published tags are conformance-tested scaffolds; the current
mainbranch adds market-data, paper-trading, and live event-contract adapters. Configured live mode can place, amend, and cancel real orders. Review the exact commit, configuration, tests, and limits before running it with credentials; do not infer readiness from the version string.
[!IMPORTANT] This community project is not an official Kalshi product and is not affiliated with, endorsed by, sponsored by, or supported by KalshiEX LLC or its affiliates. “Kalshi” is used only to identify interoperability with Kalshi's published APIs.
The independent Kernel mark follows a conservative interpretation of Kalshi's published color, contrast, clear-space, and misuse guidance. It does not use or modify Kalshi's logo. See the visual identity usage rules.
Why this project exists
Trading APIs are broad and optimized for application developers. Agents need a narrower boundary with explicit intent, strict schemas, predictable errors, and strong separation between simulation and real-money execution. Kalshi Kernel provides that boundary while continuously testing its generated clients against the latest upstream contracts.
The design priorities are:
- paper mode by default;
- immutable execution mode for the lifetime of a process;
- explicit acknowledgement and credentials before live mode can arm;
- fixed-point strings for prices and quantities;
- strict, generated tool schemas with safety annotations;
- fail-closed behavior when a capability is unavailable;
- traceable alignment with exact OpenAPI operations and AsyncAPI channels; and
- repeatable MCP protocol, race, fuzz, and upstream-drift testing.
Current status
The table describes the current main branch, not the published v0.1.1 tag.
The additions are unreleased and the version metadata has not yet advanced.
| Area | Current behavior and limits |
|---|---|
| MCP stdio transport and generated schemas | Working |
| Public market data | Event contracts and perpetuals: search, market details, REST order-book snapshots, candles, and last quote. Public trade tape is event-contract only |
| Paper trading | In-memory balance, positions, fill journal, exact fixed-point fees, and immediate all-or-nothing fills at the current displayed touch |
| Live portfolio | Authenticated event-contract balance, positions, orders, and fills. Perpetual accounts and non-primary subaccounts are not supported |
| Live event-contract orders | Place, amend, and cancel are connected to the production API. Place/amend require process-local arming and kernel-side limits; cancel performs a resting-state check and timeout reconciliation |
| Live perpetual orders | Not implemented |
| Streaming order-book reconciliation | Not implemented; get_orderbook currently returns one public REST snapshot |
kernel_status |
Callable, but some readiness and arming fields still describe the old scaffold and must not be treated as authoritative |
| Automatic upstream specification freshness gate | Working |
| Production remote HTTPS/OAuth service | Not implemented |
| Public registry listings | Prepared, not submitted |
Treat the current branch as development software, not as a published or audited
trading integration. Some design and publication documents still describe the
v0.1.1 scaffold; compare them with the implementation before relying on a
claim. See ARCHITECTURE.md,
THREAT_MODEL.md, and the release gates in
PUBLICATION.md.
Agent-facing tools
| Tool | Class | Current behavior |
|---|---|---|
kernel_status |
Read-only | Returns mode and a readiness envelope; newly added backend and arm state are not yet reflected accurately |
search_markets |
Read-only | Searches event-contract or perpetual markets through public REST |
get_market |
Read-only | Returns authoritative metadata for one event-contract or perpetual market |
get_orderbook |
Read-only | Returns a public REST snapshot of yes/no bid levels for either product |
get_candles |
Read-only | Returns 1-, 60-, or 1440-minute event-contract or perpetual OHLC buckets |
get_trades |
Read-only | Returns one cursor-paginated page of the public event-contract trade tape |
get_last |
Read-only | Returns a compact event-contract or perpetual quote and status snapshot |
arm_live_trading |
Destructive/control | Arms or disarms live place/amend calls for this process after an exact second acknowledgement |
get_portfolio |
Read-only | Returns the local paper ledger in paper mode or the authenticated event-contract portfolio in live mode |
place_order |
Destructive/write | Simulates an immediate fill in paper mode; submits an armed, capped event-contract order in live mode |
amend_order |
Destructive/write | Paper mode has no resting orders; live mode amends an armed, resting event-contract order |
cancel_order |
Destructive/write | Paper mode has no resting orders; live mode state-checks and cancels a resting event-contract order |
Connected MCP clients also receive server-level instructions telling them to
call kernel_status first, distinguish paper from live mode, and never report
an action as successful unless its structured response contains ok: true.
Until its readiness reporting is updated, confirm live arm state from the
arm_live_trading response rather than from kernel_status.
Build and run locally
Prerequisites:
- Go 1.25.13 or newer;
- Node.js 22 only for the official MCP conformance runner; and
- a supported MCP client.
make test
make build
KALSHI_KERNEL_MODE=paper ./bin/kalshi-kernel
Paper mode is the default when KALSHI_KERNEL_MODE is unset. It intentionally
discards live credential configuration.
Hermes
Add a local stdio server to ~/.hermes/config.yaml:
mcp_servers:
kalshi-kernel:
command: "/absolute/path/to/kalshi-kernel/bin/kalshi-kernel"
env:
KALSHI_KERNEL_MODE: "paper"
Restart Hermes and call kernel_status before any other tool.
Claude Code
After building the binary:
claude mcp add --scope user --transport stdio kalshi-kernel \
--env KALSHI_KERNEL_MODE=paper -- /absolute/path/to/bin/kalshi-kernel
Then run claude mcp get kalshi-kernel or open /mcp to confirm the
connection. This local setup is separate from Anthropic's public Connectors
Directory, which requires a deployed remote server.
Other stdio clients
Use the standard MCP configuration shape:
{
"mcpServers": {
"kalshi-kernel": {
"command": "/absolute/path/to/bin/kalshi-kernel",
"env": {
"KALSHI_KERNEL_MODE": "paper"
}
}
}
}
Execution modes
Paper mode
KALSHI_KERNEL_MODE=paper ./bin/kalshi-kernel
Paper mode uses an in-memory simulated ledger and never submits an order to
Kalshi. It starts with $100.00 by default; set
KALSHI_PAPER_CASH_DOLLARS before startup to choose another balance. The
ledger, positions, idempotency records, and fill journal reset when the process
exits.
place_order fetches a fresh public order-book snapshot and supports only
immediate, all-or-nothing marketable fills. The requested price must exactly
equal the current touch and the displayed size must cover the full quantity.
The simulator uses fixed-point arithmetic, applies the published fee formula,
records a hash of the book used, and treats client_order_id as an idempotency
key. Because paper orders never rest, amend_order and cancel_order return
typed failures.
Every paper response is labeled simulated: true. Simulated fills do not
predict or guarantee live fills, liquidity, latency, slippage, fees, or
profitability.
Live mode
Live mode is deliberately difficult to enable:
KALSHI_KERNEL_MODE=live
KALSHI_API_KEY_ID=...
KALSHI_PRIVATE_KEY_PATH=/absolute/path/to/private-key.pem
KALSHI_LIVE_TRADING_ACK=I_UNDERSTAND_THIS_TRADES_REAL_MONEY
# Optional startup-only overrides; these are the defaults.
KALSHI_MAX_ORDER_NOTIONAL_DOLLARS=25.00
KALSHI_MAX_DAILY_NOTIONAL_DOLLARS=100.00
KALSHI_MAX_DAILY_ORDERS=200
Startup configuration selects immutable live mode and enables authenticated event-contract portfolio reads and cancellation. It does not authorize place/amend calls. Those calls require a second, process-local MCP action:
{
"acknowledgement": "I_UNDERSTAND_THIS_TRADES_REAL_MONEY",
"arm": true
}
Pass that object to arm_live_trading; pass the same object with arm: false
to disarm. Arming is never persisted. place_order also requires a stable,
caller-provided client_order_id. Place/amend requests are rejected before
submission when they exceed the startup-only per-order, UTC-day notional, or
UTC-day order-count limits. These counters are process-local and reset when the
process restarts.
[!WARNING]
cancel_orderis available in configured live mode without the separatearm_live_tradingstep. It verifies that the order is resting before sending the cancellation. Place/amend validate price syntax and notional limits, but the current implementation does not independently compare the requested limit price with a fresh quote. Use exchange-side limits, least-privilege credentials, human review, monitoring, and an independent emergency stop.
Live account reads and writes currently support event contracts only.
Perpetual-account operations and non-primary subaccounts are unavailable; omit
subaccount or pass 0. Network failures after a write produce reconciled or
explicitly indeterminate outcomes rather than blind retries.
Never commit credentials, private keys, or .env files. Use short-lived
credentials where available, a secrets manager in production, and an account
with only the privileges and capital required.
Specification-driven generation
The curated agent interface lives in specs/mcp-tools.yaml. It maps each MCP
tool to exact OpenAPI operation IDs and AsyncAPI channels. Administrative and
account-management endpoints are not automatically exposed merely because they
exist upstream.
Four authoritative contracts are fetched from https://docs.kalshi.com:
openapi.yaml— event-contract REST API;asyncapi.yaml— event-contract WebSocket API;perps_openapi.yaml— perpetuals REST API; andperps_asyncapi.yaml— perpetuals WebSocket API.
The fetcher pins HTTPS and the source hostname, limits response sizes, validates the expected dialect and non-empty surface, and records hashes and HTTP provenance. The upstream contract bodies are ignored by Git and fetched into a local cache as needed. Upstream-derived REST clients are also generated locally and excluded from source releases. Only the provenance lock, curated MCP overlay, and generated MCP tool boundary are versioned. Regeneration and testing happen in a temporary repository copy before a tested lock and MCP boundary can be promoted.
make upstream-test # test latest contracts without requiring snapshot parity
make upstream-check # require parity and run MCP conformance
make upstream-promote # promote only the exact artifacts that passed
Every CI run performs the strict upstream check; CI also runs daily so drift is detected even when the repository is idle.
[!WARNING] The downloaded Kalshi contract files identify at least part of the upstream material as proprietary. They are not covered by this project's Apache-2.0 license and must not be committed or redistributed. Review THIRD_PARTY_NOTICES.md before publishing generated artifacts.
Verification
make test # unit, integration, and contract alignment tests
make test-alignment # OpenAPI, AsyncAPI, and MCP overlay alignment
make check-generated # deterministic generated-code check
make test-race # concurrent calls under Go's race detector
make test-fuzz # execution-mode parser safety fuzzing
make conformance # pinned official MCP protocol scenarios
make release-test # complete local release gate
make public-check # vulnerability, metadata, and public-readiness gate
make upstream-check # latest Kalshi contracts plus conformance
The suite checks transport security, authentication contracts, mutation security, operation-ID uniqueness, fixed-point types, curated surface area, required-field parity, strict JSON Schemas, tool titles and safety hints, fail-closed behavior, concurrency, and Streamable HTTP negotiation.
Distribution and registries
The repository contains publication metadata for the official MCP Registry and submission dossiers for the OpenAI Plugins Directory and Anthropic directories. Metadata is preparation—not evidence of approval, endorsement, or publication.
Anthropic's current connector review criteria do not accept connectors that transfer money or other financial assets. Any Claude Connectors Directory build of this project must therefore be a distinct read-only and/or paper-only artifact with live order tools omitted, subject to Anthropic's review.
See PUBLICATION.md for the exact channel matrix, current blockers, release steps, listing copy, and review test cases. No external registry submission is performed automatically.
Contributing and security
Read CONTRIBUTING.md before opening a pull request. Report vulnerabilities privately according to SECURITY.md; do not open a public issue for a suspected credential leak or trading-safety vulnerability. General usage help belongs in SUPPORT.md.
Legal and risk notice
This software is provided for development and research. It does not provide investment, financial, legal, tax, compliance, or trading advice. Event contracts and leveraged products can result in rapid and substantial loss, including loss of the entire amount committed. You are responsible for account eligibility, jurisdictional restrictions, exchange rules, regulatory requirements, taxes, strategy, orders, and losses.
AI systems and software can misunderstand intent, produce incorrect parameters, repeat requests, or behave unexpectedly. Human review, exchange-side risk limits, least-privilege credentials, monitoring, and an independent emergency stop are required before any live deployment.
Read the full DISCLAIMER.md, PRIVACY.md, and SECURITY.md. The project is licensed under Apache License 2.0; third-party material is excluded as described in THIRD_PARTY_NOTICES.md.
Kalshi Kernel MCP 질문
Kalshi Kernel MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add --env 'KALSHI_API_KEY_ID=<YOUR_KALSHI_API_KEY_ID>' kalshi-kernel -- docker run -i --rm ghcr.io/copyleftdev/kalshi-kernel:0.1.1를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
Kalshi Kernel MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
Kalshi Kernel MCP는 어떤 도구를 제공하나요?
12개 도구를 제공합니다. 예: kernel_status, search_markets, get_market, get_orderbook, get_candles.
이 서버로 실거래가 가능한가요?
아니요, 이 프로젝트는 프리릴리스 단계로 아직 트레이딩에 적합하지 않습니다. 현재 main 브랜치에 실거래 어댑터가 추가되었으나, 사용자는 이를 개발용 소프트웨어로 취급해야 합니다.
페이퍼 모드는 어떻게 작동하나요?
페이퍼 모드는 인메모리 시뮬레이션 원장을 사용하며, 기본적으로 $100.00의 잔액으로 시작하고 프로세스가 종료되면 초기화됩니다.
실거래 모드에서 퍼페추얼 마켓을 거래할 수 있나요?
아니요, 현재 실거래 계정의 읽기 및 쓰기는 이벤트 계약만 지원하며, 퍼페추얼 계정 작업은 사용할 수 없습니다.