{
  "markdown": "# @quantish/kalshi-server\n\n> **⚠️ 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](https://polynode.dev).\n\nSelf-hosted Kalshi MCP server for trading on Kalshi markets via DFlow on Solana.\n\n## Overview\n\nThis package provides an MCP (Model Context Protocol) server that enables AI agents to trade on Kalshi prediction markets through the DFlow protocol on Solana.\n\n## Features\n\n- **Full Kalshi Trading** - Buy/sell on any Kalshi market\n- **Solana Wallet Management** - Generate and manage Solana wallets\n- **DFlow Integration** - Trade via DFlow's Solana infrastructure\n- **Jupiter Swaps** - Swap SOL/USDC via Jupiter Aggregator\n- **MCP Compatible** - Works with Claude, Quantish Agent, and any MCP client\n- **Self-Hostable** - Run on Railway, Fly.io, or any Node.js host\n\n## Quick Start\n\n```bash\ngit clone https://github.com/joinQuantish/kalshi-mcp\ncd kalshi-mcp\nnpm install\n```\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `DATABASE_URL` | Yes | PostgreSQL connection string |\n| `ENCRYPTION_KEY` | Yes | 64-character hex string for wallet encryption |\n| `DFLOW_API_KEY` | No | DFlow API key (optional, for authenticated endpoints) |\n| `JUPITER_API_KEY` | No | Jupiter API key from [portal.jup.ag](https://portal.jup.ag) for swap tools |\n| `SOLANA_RPC_URL` | No | Solana RPC endpoint (defaults to mainnet) |\n| `ADMIN_API_KEY` | No | Admin API key for administrative endpoints |\n| `PORT` | No | Server port (defaults to 3002) |\n\n### Obtaining API Keys\n\n**DFlow API Key:**\n> DFlow access may require approval. Contact the DFlow team at [dflow.net](https://dflow.net) for API access.\n\n**Jupiter API Key:**\n> Get a free API key from [portal.jup.ag](https://portal.jup.ag) (Basic tier, 1 RPS). Required for swap functionality.\n\n**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.\n\n### Generate Encryption Key\n\n```bash\nnode -e \"console.log(require('crypto').randomBytes(32).toString('hex'))\"\n```\n\n## Database Setup\n\nAny PostgreSQL database works. Options:\n\n| Provider | Notes |\n|----------|-------|\n| **Railway** | Add PostgreSQL service, copy `DATABASE_URL` from variables |\n| **Supabase** | Free tier at [supabase.com](https://supabase.com), copy connection string from Settings > Database |\n| **Neon** | Serverless Postgres at [neon.tech](https://neon.tech), free tier available |\n| **Local Docker** | `docker run -e POSTGRES_PASSWORD=pass -p 5432:5432 postgres` |\n\nSet your `DATABASE_URL` then run:\n\n```bash\n# Generate Prisma client\nnpm run db:generate\n\n# Create tables\nnpm run db:push\n```\n\n## Available Tools\n\n### Account Management\n- `kalshi_signup` - Create account with Solana wallet\n- `kalshi_request_api_key` - Request API key with access code\n- `kalshi_get_wallet_info` - Get wallet address and type\n- `kalshi_get_wallet_status` - Full wallet status including balances\n- `kalshi_get_balances` - Get SOL and USDC balances\n- `kalshi_get_deposit_address` - Get address for deposits\n- `kalshi_export_private_key` - Export wallet private key\n- `kalshi_import_private_key` - Import existing Solana wallet\n\n### Market Discovery\n- `kalshi_search_markets` - Search Kalshi markets by keyword\n- `kalshi_get_market` - Get market details by ticker\n- `kalshi_get_event` - Get event with all nested markets\n- `kalshi_get_events` - Browse events with filters\n- `kalshi_get_live_data` - Get live pricing data\n\n### Trading\n- `kalshi_get_quote` - Get quote for prediction market trade\n- `kalshi_buy_yes` - Buy YES outcome tokens\n- `kalshi_buy_no` - Buy NO outcome tokens\n- `kalshi_sell_position` - Sell outcome tokens back to USDC\n- `kalshi_get_positions` - View current positions\n- `kalshi_get_orders` - View order history\n\n### Swaps (SOL/USDC)\n- `kalshi_get_swap_quote` - Get Jupiter swap quote\n- `kalshi_execute_swap` - Execute token swap\n- `kalshi_swap_sol_to_usdc` - Swap SOL to USDC\n- `kalshi_swap_usdc_to_sol` - Swap USDC to SOL\n\n### Transfers\n- `kalshi_send_sol` - Send SOL to another wallet\n- `kalshi_send_usdc` - Send USDC to another wallet\n- `kalshi_send_token` - Send any SPL token\n\n### Market Operations\n- `kalshi_check_market_initialization` - Check if market is tokenized on-chain\n- `kalshi_initialize_market` - Initialize market on-chain (pays SOL fee)\n- `kalshi_check_redemption_status` - Check if market is settled\n- `kalshi_get_market_by_mint` - Look up market by token mint\n\n### Redemption\n- `kalshi_get_redeemable_positions` - Find positions ready to claim\n- `kalshi_redeem_winnings` - Redeem specific winning position\n- `kalshi_redeem_all_positions` - Redeem all winning positions at once\n\n### API Key Management\n- `kalshi_list_api_keys` - List your API keys\n- `kalshi_create_additional_api_key` - Create new API key\n- `kalshi_revoke_api_key` - Revoke an API key\n\n## API Format\n\nThe server exposes a JSON-RPC 2.0 endpoint at `/mcp`:\n\n```bash\ncurl -X POST https://your-server.com/mcp \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-api-key: YOUR_API_KEY\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"kalshi_get_positions\",\n      \"arguments\": {}\n    },\n    \"id\": 1\n  }'\n```\n\n## Connecting to Quantish Agent\n\nConfigure the CLI to use your server:\n\n```bash\nexport KALSHI_MCP_URL=https://your-server.com/mcp\nexport KALSHI_API_KEY=your-api-key\nquantish\n```\n\nOr add to `~/.quantish/config.json`:\n\n```json\n{\n  \"kalshiMcpUrl\": \"https://your-server.com/mcp\",\n  \"kalshiApiKey\": \"your-api-key\"\n}\n```\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Generate Prisma client\nnpm run db:generate\n\n# Run migrations\nnpm run db:push\n\n# Start development server\nnpm run dev\n```\n\n## Resources\n\n- **NPM**: [@quantish/kalshi-server](https://www.npmjs.com/package/@quantish/kalshi-server)\n- **GitHub**: [joinQuantish/kalshi-mcp](https://github.com/joinQuantish/kalshi-mcp)\n- **Quantish Agent**: [@quantish/agent](https://www.npmjs.com/package/@quantish/agent)\n- **DFlow Docs**: [pond.dflow.net](https://pond.dflow.net)\n- **Jupiter Portal**: [portal.jup.ag](https://portal.jup.ag)\n\n## License\n\nThis project is licensed under the [PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/).\n\n**Free for personal use, research, and non-commercial purposes.** Commercial use requires explicit permission from Quantish Inc. Contact hello@quantish.live for commercial licensing.\n\n---\n\nBuilt by [Quantish Inc.](https://quantish.live)\n",
  "bytes": 6854,
  "sha": "e0504f865c4e5b1cd364a41a8d6824d64661769f8f19b7df6d1882b87839d153",
  "repo_slug": "joinquantish/kalshi-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_joinquantish_kalshi_6be17f32/readme"
}