This connects Claude to Kalshi prediction markets through DFlow on Solana, letting you trade yes/no outcomes programmatically. You get the full stack: wallet generation and management, market search and discovery, quote fetching and order execution, position tracking and redemption for settled markets. It includes Jupiter integration for SOL/USDC swaps and handles the tokenization ceremony if a market isn't on-chain yet. The whole thing is self-hosted on your infrastructure with PostgreSQL for encrypted wallet storage. Note that Quantish is shutting down, so you're on your own for maintenance, but the server itself works independently since it talks directly to DFlow and Kalshi APIs.
⚠️ 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.
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.
git clone https://github.com/joinQuantish/kalshi-mcp
cd kalshi-mcp
npm install
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
ENCRYPTION_KEY | Yes | 64-character hex string for wallet encryption |
DFLOW_API_KEY | No | DFlow API key (optional, for authenticated endpoints) |
JUPITER_API_KEY | No | Jupiter API key from portal.jup.ag for swap tools |
SOLANA_RPC_URL | No | Solana RPC endpoint (defaults to mainnet) |
ADMIN_API_KEY | No | Admin API key for administrative endpoints |
PORT | No | Server port (defaults to 3002) |
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.
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Any PostgreSQL database works. Options:
| Provider | Notes |
|---|---|
| Railway | Add PostgreSQL service, copy DATABASE_URL from variables |
| Supabase | Free tier at supabase.com, copy connection string from Settings > Database |
| Neon | Serverless Postgres at neon.tech, free tier available |
| Local Docker | docker run -e POSTGRES_PASSWORD=pass -p 5432:5432 postgres |
Set your DATABASE_URL then run:
# Generate Prisma client
npm run db:generate
# Create tables
npm run db:push
kalshi_signup - Create account with Solana walletkalshi_request_api_key - Request API key with access codekalshi_get_wallet_info - Get wallet address and typekalshi_get_wallet_status - Full wallet status including balanceskalshi_get_balances - Get SOL and USDC balanceskalshi_get_deposit_address - Get address for depositskalshi_export_private_key - Export wallet private keykalshi_import_private_key - Import existing Solana walletkalshi_search_markets - Search Kalshi markets by keywordkalshi_get_market - Get market details by tickerkalshi_get_event - Get event with all nested marketskalshi_get_events - Browse events with filterskalshi_get_live_data - Get live pricing datakalshi_get_quote - Get quote for prediction market tradekalshi_buy_yes - Buy YES outcome tokenskalshi_buy_no - Buy NO outcome tokenskalshi_sell_position - Sell outcome tokens back to USDCkalshi_get_positions - View current positionskalshi_get_orders - View order historykalshi_get_swap_quote - Get Jupiter swap quotekalshi_execute_swap - Execute token swapkalshi_swap_sol_to_usdc - Swap SOL to USDCkalshi_swap_usdc_to_sol - Swap USDC to SOLkalshi_send_sol - Send SOL to another walletkalshi_send_usdc - Send USDC to another walletkalshi_send_token - Send any SPL tokenkalshi_check_market_initialization - Check if market is tokenized on-chainkalshi_initialize_market - Initialize market on-chain (pays SOL fee)kalshi_check_redemption_status - Check if market is settledkalshi_get_market_by_mint - Look up market by token mintkalshi_get_redeemable_positions - Find positions ready to claimkalshi_redeem_winnings - Redeem specific winning positionkalshi_redeem_all_positions - Redeem all winning positions at oncekalshi_list_api_keys - List your API keyskalshi_create_additional_api_key - Create new API keykalshi_revoke_api_key - Revoke an API keyThe server exposes a JSON-RPC 2.0 endpoint at /mcp:
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
}'
Configure the CLI to use your server:
export KALSHI_MCP_URL=https://your-server.com/mcp
export KALSHI_API_KEY=your-api-key
quantish
Or add to ~/.quantish/config.json:
{
"kalshiMcpUrl": "https://your-server.com/mcp",
"kalshiApiKey": "your-api-key"
}
# Install dependencies
npm install
# Generate Prisma client
npm run db:generate
# Run migrations
npm run db:push
# Start development server
npm run dev
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 hello@quantish.live for commercial licensing.
Built by Quantish Inc.
io.github.shelvick/shopify-subscription-reconciliation
zleventer/google-ads-mcp
csoai-org/meok-stripe-acp-checkout-mcp
io.github.mharnett/google-ads
csoai-org/stripe-billing-mcp
co.pipeboard/google-ads-mcp