Kalshi MCP Server

io.github.joinQuantish由 GitHub 帳號 joinQuantish 發布v0.3.0更新於 Oct 24, 2026

Self-hosted MCP server for Kalshi prediction market trading via DFlow on Solana

發布方自己的服務:Kalshi MCP

已驗證STDIO僅桌面金融開發者工具

概覽

AI 產生的概覽

自架式 MCP 伺服器,讓助理透過 Solana 上的 DFlow 交易 Kalshi 預測市場,並提供錢包、兌換與轉帳工具。

可以做什麼
建立與管理帳戶及 Solana 錢包,查詢餘額、入金地址,匯入或匯出私鑰,並管理伺服器本身的 API 金鑰。搜尋與瀏覽 Kalshi 市場、事件及即時價格資料。取得報價,買入 YES 或 NO 結果代幣,賣出持倉,並檢視持倉與訂單紀錄。取得 Jupiter 兌換報價,在 SOL 與 USDC 之間兌換。傳送 SOL、USDC 或其他 SPL 代幣到其他錢包。在鏈上初始化市場、查詢結算狀態,並逐一或一次領取獲勝持倉。
適用情境
適合想讓 AI 助理在自己自架的執行個體上研究與交易 Kalshi 預測市場,且能執行 Node.js 與 PostgreSQL、在 Solana 錢包中持有資金的人。不適合想要託管且持續維護服務的人:此專案已不再維護。
執行需求
本機 Node.js 執行環境並從原始碼安裝此套件,透過 DATABASE_URL 提供 PostgreSQL 資料庫,以及用於錢包加密的 64 字元十六進位 ENCRYPTION_KEY。選用 DFLOW_API_KEY、JUPITER_API_KEY(兌換功能需要)、SOLANA_RPC_URL、ADMIN_API_KEY 與 PORT。需以提供的 Prisma 指令建立資料表。需要連線至 Solana 與交易服務的網路。
安裝前請注意
此伺服器持有 Solana 錢包並可動用真實資金:會買賣持倉、兌換代幣、傳送 SOL、USDC 與 SPL 代幣,並為初始化市場支付 SOL 費用。私鑰可透過工具匯出與匯入,錢包機密僅由 ENCRYPTION_KEY 保護,務必妥善保管該值與資料庫。交易與轉帳無法撤銷且涉及財務風險。專案已停止維護且公開伺服器已下線,須自行執行並保護執行個體。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Kalshi MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@quantish/kalshi-server

⚠️ Notice: Quantish is winding down. The Quantish platform (quantish.live) is shutting down. This MCP server is self-hosted and will continue to work independently, but the Quantish team will no longer be maintaining or updating this project. If you're building in the prediction market space and need real-time data infrastructure, check out polynode.dev.

Self-hosted Kalshi MCP server for trading on Kalshi markets via DFlow on Solana.

Overview

This package provides an MCP (Model Context Protocol) server that enables AI agents to trade on Kalshi prediction markets through the DFlow protocol on Solana.

Features

  • Full Kalshi Trading - Buy/sell on any Kalshi market
  • Solana Wallet Management - Generate and manage Solana wallets
  • DFlow Integration - Trade via DFlow's Solana infrastructure
  • Jupiter Swaps - Swap SOL/USDC via Jupiter Aggregator
  • MCP Compatible - Works with Claude, Quantish Agent, and any MCP client
  • Self-Hostable - Run on Railway, Fly.io, or any Node.js host

Quick Start

bash
git clone https://github.com/joinQuantish/kalshi-mcpcd kalshi-mcpnpm install

Environment Variables

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string
ENCRYPTION_KEYYes64-character hex string for wallet encryption
DFLOW_API_KEYNoDFlow API key (optional, for authenticated endpoints)
JUPITER_API_KEYNoJupiter API key from portal.jup.ag for swap tools
SOLANA_RPC_URLNoSolana RPC endpoint (defaults to mainnet)
ADMIN_API_KEYNoAdmin API key for administrative endpoints
PORTNoServer port (defaults to 3002)

Obtaining API Keys

DFlow API Key:

DFlow access may require approval. Contact the DFlow team at dflow.net for API access.

Jupiter API Key:

Get a free API key from portal.jup.ag (Basic tier, 1 RPS). Required for swap functionality.

Using Quantish's public servers? Quantish's public servers are no longer available as the platform is winding down. You must self-host this MCP server to use it. Follow the setup instructions above to run your own instance.

Generate Encryption Key

bash
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Database Setup

Any PostgreSQL database works. Options:

ProviderNotes
RailwayAdd PostgreSQL service, copy DATABASE_URL from variables
SupabaseFree tier at supabase.com, copy connection string from Settings > Database
NeonServerless Postgres at neon.tech, free tier available
Local Dockerdocker run -e POSTGRES_PASSWORD=pass -p 5432:5432 postgres

Set your DATABASE_URL then run:

bash
# Generate Prisma clientnpm run db:generate
# Create tablesnpm run db:push

Available Tools

Account Management

  • kalshi_signup - Create account with Solana wallet
  • kalshi_request_api_key - Request API key with access code
  • kalshi_get_wallet_info - Get wallet address and type
  • kalshi_get_wallet_status - Full wallet status including balances
  • kalshi_get_balances - Get SOL and USDC balances
  • kalshi_get_deposit_address - Get address for deposits
  • kalshi_export_private_key - Export wallet private key
  • kalshi_import_private_key - Import existing Solana wallet

Market Discovery

  • kalshi_search_markets - Search Kalshi markets by keyword
  • kalshi_get_market - Get market details by ticker
  • kalshi_get_event - Get event with all nested markets
  • kalshi_get_events - Browse events with filters
  • kalshi_get_live_data - Get live pricing data

Trading

  • kalshi_get_quote - Get quote for prediction market trade
  • kalshi_buy_yes - Buy YES outcome tokens
  • kalshi_buy_no - Buy NO outcome tokens
  • kalshi_sell_position - Sell outcome tokens back to USDC
  • kalshi_get_positions - View current positions
  • kalshi_get_orders - View order history

Swaps (SOL/USDC)

  • kalshi_get_swap_quote - Get Jupiter swap quote
  • kalshi_execute_swap - Execute token swap
  • kalshi_swap_sol_to_usdc - Swap SOL to USDC
  • kalshi_swap_usdc_to_sol - Swap USDC to SOL

Transfers

  • kalshi_send_sol - Send SOL to another wallet
  • kalshi_send_usdc - Send USDC to another wallet
  • kalshi_send_token - Send any SPL token

Market Operations

  • kalshi_check_market_initialization - Check if market is tokenized on-chain
  • kalshi_initialize_market - Initialize market on-chain (pays SOL fee)
  • kalshi_check_redemption_status - Check if market is settled
  • kalshi_get_market_by_mint - Look up market by token mint

Redemption

  • kalshi_get_redeemable_positions - Find positions ready to claim
  • kalshi_redeem_winnings - Redeem specific winning position
  • kalshi_redeem_all_positions - Redeem all winning positions at once

API Key Management

  • kalshi_list_api_keys - List your API keys
  • kalshi_create_additional_api_key - Create new API key
  • kalshi_revoke_api_key - Revoke an API key

API Format

The server exposes a JSON-RPC 2.0 endpoint at /mcp:

bash
curl -X POST https://your-server.com/mcp \  -H "Content-Type: application/json" \  -H "x-api-key: YOUR_API_KEY" \  -d '{    "jsonrpc": "2.0",    "method": "tools/call",    "params": {      "name": "kalshi_get_positions",      "arguments": {}    },    "id": 1  }'

Connecting to Quantish Agent

Configure the CLI to use your server:

bash
export KALSHI_MCP_URL=https://your-server.com/mcpexport KALSHI_API_KEY=your-api-keyquantish

Or add to ~/.quantish/config.json:

json
{  "kalshiMcpUrl": "https://your-server.com/mcp",  "kalshiApiKey": "your-api-key"}

Development

bash
# Install dependenciesnpm install
# Generate Prisma clientnpm run db:generate
# Run migrationsnpm run db:push
# Start development servernpm run dev

Resources

License

This project is licensed under the PolyForm Noncommercial License 1.0.0.

Free for personal use, research, and non-commercial purposes. Commercial use requires explicit permission from Quantish Inc. Contact [email protected] for commercial licensing.


Built by Quantish Inc.

來源:README.md,提交 661eaa6

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.0最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Kalshi-Mcp 整合