9M

9crusher/mcp-server-kalshi

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

32 stars 14 forks Качество 80 Тренд 8MIT

Сервер MCP для взаимодействия с рынками предсказаний Kalshi

Обзор

Сервер MCP, который предоставляет код Клода и другого агента, использует первоклассный интерфейс для Kalshi. Он построен для сквозной торговли: просматривать рынки, исследовать их, читать точные правила расчетов (включая вытягивание контрактных PDF-файлов) и выполнять сделки - все через инструменты MCP. List markets, get market, list events, get event, list series, get series. (У Kalshi нет свободного текстового поиска; фильтры list markets — это поиск.) - get market orderbook, get market candlesticks, get market trades. get market rules объединяет правила рынка primary/rules secondary, условия досрочного закрытия, источники расчетов и запреты серий; fetch rules pdf загружает и извлекает текст фактического юридического контракта PDF, чтобы агент мог его прочитать. - get exchange status, get exchange schedule (открывается рынок и его часы). - get balance, get positions, get fills, get settlements. Создать order, отменить order, изменить order, уменьшить order, плюс list orders / get order.

Обзор (машинный перевод)

Сервер MCP, который предоставляет код Клода и другого агента, использует первоклассный интерфейс для работы с компьютером. Калши. Он построен для сквозной торговли: просматривать рынки, исследовать их, читать точные расчеты. Правила (включая вытягивание контрактных PDF-файлов) и выполнение сделок — все через инструменты MCP.

Основные моменты

  • list_markets, get_market, list_events, get_event, list_series, [[T]], [[T]], [[T]], [[T]], [[T]], [[T]], [[T]] [[Т5]]. (У Калши нет свободного текстового поиска; list_markets фильтры — это поиск.) [7], [8], [9], [[9]], [[9]]. Глубокие правила — get_market_rules консолидирует рынок rules_primary/rules_secondary, ранние условия закрытия, источники поселений и серийные запреты; [13] Загружает и извлекает текст фактического юридического контракта PDF, чтобы агент мог его прочитать. ** Обмен ** — get_exchange_status, get_exchange_schedule (открыт рынок и его часы). [[Т[16]], [[Т17]], [[Т18]], [[Т19]]. create_order, cancel_order, amend_order, decrease_order [24] [[25]] [[25]].

Безопасность по умолчанию

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP Server Kalshi

An MCP server that gives Claude Code and other agent harnesses a first-class interface to Kalshi. It is built for end-to-end trading: browse markets, research them, read the exact settlement rules (including pulling the contract-terms PDFs), and execute trades — all through MCP tools.

Highlights

  • Discovery — list_markets, get_market, list_events, get_event, list_series, get_series. (Kalshi has no free-text search; list_markets filters are the search.)
  • Research — get_market_orderbook, get_market_candlesticks, get_market_trades.
  • Deep rules — get_market_rules consolidates a market’s rules_primary/rules_secondary, early-close conditions, settlement sources, and series prohibitions; fetch_rules_pdf downloads and extracts the text of the actual legal contract PDF so the agent can read it.
  • Exchange — get_exchange_status, get_exchange_schedule (is the market open, and its hours).
  • Portfolio — get_balance, get_positions, get_fills, get_settlements.
  • Trading — create_order, cancel_order, amend_order, decrease_order, plus list_orders / get_order.

Safety by default

  • The server targets Kalshi’s demo (sandbox) environment unless you explicitly set KALSHI_ENV=prod.
  • Order-placing tools (create_order, amend_order) require confirm=true. Without it they return a preview — a human-readable summary and the exact payload — and place nothing.
  • Credentials are optional: all market/rules tools work unauthenticated. Only portfolio and order tools need an API key + RSA private key.

Intuitive order model

Kalshi’s V2 order API quotes everything from the YES leg (bid/ask in fixed-point dollars). This server exposes the natural model instead — action (buy/sell) + side (yes/no) + a whole cents limit price — and translates it (including the buy-NO ⇄ sell-YES price inversion).

Configuration

Variable Default Purpose
KALSHI_ENV demo demo (sandbox) or prod (real money). Derives the base URL.
KALSHI_API_KEY (none) Kalshi API key ID. Required only for authenticated tools.
KALSHI_PRIVATE_KEY_PATH (none) Path to your RSA private key .pem. Required for authenticated tools.
BASE_URL (derived) Optional explicit REST base override (must include /trade-api/v2).

See .env-example. Get API credentials at docs.kalshi.com/getting_started/api_keys and a demo account via the demo environment guide.

Claude Desktop (uvx)

"mcpServers": {
  "kalshi": {
    "command": "uvx",
    "args": ["mcp-server-kalshi"],
    "env": {
      "KALSHI_ENV": "demo",
      "KALSHI_API_KEY": "",
Открыть полный README на GitHub

Установка

uvx mcp-server-kalshi
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

"mcpServers": { "kalshi": { "command": "uvx", "args": ["mcp-server-kalshi"], "env": { "KALSHI_ENV": "demo", "KALSHI_API_KEY": "<YOUR KALSHI API KEY>", "KALSHI_PRIVATE_KEY_PATH": "PATH TO YOUR RSA KEY FILE" } } }