npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@newyorkcompute/kalshi-mcp

v0.5.0

Published

MCP server for Kalshi prediction markets — enables AI agents to interact with Kalshi

Readme

@newyorkcompute/kalshi-mcp

npm version license CI node

MCP (Model Context Protocol) server for Kalshi prediction markets — enables AI agents to interact with Kalshi.

Installation

npx @newyorkcompute/kalshi-mcp

Or install globally:

npm install -g @newyorkcompute/kalshi-mcp

Configuration

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | KALSHI_API_KEY | Yes | Your Kalshi API key ID | | KALSHI_PRIVATE_KEY | Yes | RSA private key (PEM format) | | KALSHI_BASE_PATH | No | API base URL (default: production) |

Claude Code

Add the MCP server using the CLI (docs):

claude mcp add --transport stdio kalshi \
  --env KALSHI_API_KEY=your-api-key-id \
  --env KALSHI_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----..." \
  -- npx -y @newyorkcompute/kalshi-mcp

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "kalshi": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@newyorkcompute/kalshi-mcp"],
      "env": {
        "KALSHI_API_KEY": "your-api-key-id",
        "KALSHI_PRIVATE_KEY": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
      }
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "kalshi": {
      "command": "npx",
      "args": ["-y", "@newyorkcompute/kalshi-mcp"],
      "env": {
        "KALSHI_API_KEY": "your-api-key-id",
        "KALSHI_PRIVATE_KEY": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
      }
    }
  }
}

Cursor IDE

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "kalshi": {
      "command": "npx",
      "args": ["-y", "@newyorkcompute/kalshi-mcp"],
      "env": {
        "KALSHI_API_KEY": "your-api-key-id",
        "KALSHI_PRIVATE_KEY": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
      }
    }
  }
}

Tip: Use -y flag with npx to skip confirmation prompts.

Tools

Market Tools

get_markets

List and search Kalshi prediction markets.

Parameters:

  • limit (optional): Maximum markets to return (1-1000)
  • cursor (optional): Pagination cursor
  • event_ticker (optional): Filter by event ticker
  • series_ticker (optional): Filter by series ticker
  • status (optional): Filter by status (open, closed, settled)
  • tickers (optional): Comma-separated list of specific tickers

get_market

Get detailed information about a specific market.

Parameters:

  • ticker (required): Market ticker (e.g., KXBTC-25JAN03-B100500)

get_orderbook

Get the orderbook for a market.

Parameters:

  • ticker (required): Market ticker
  • depth (optional): Number of price levels (1-100)

get_trades

Get recent trades on markets.

Parameters:

  • ticker (optional): Filter by market ticker
  • limit (optional): Number of trades to return (1-1000)
  • cursor (optional): Pagination cursor
  • min_ts (optional): Filter trades after this Unix timestamp
  • max_ts (optional): Filter trades before this Unix timestamp

Event Tools

get_events

List Kalshi events. Events contain one or more markets.

Parameters:

  • limit (optional): Number of events to return (1-200)
  • cursor (optional): Pagination cursor
  • status (optional): Filter by status (open, closed, settled)
  • series_ticker (optional): Filter by series ticker
  • with_nested_markets (optional): Include markets in response

get_event

Get detailed information about a specific event.

Parameters:

  • event_ticker (required): Event ticker (e.g., KXBTC)
  • with_nested_markets (optional): Include markets in response

Portfolio Tools

get_balance

Get your account balance and portfolio value.

Parameters: None

Returns: Balance in dollars and cents, portfolio value.

get_positions

Get your current positions on markets.

Parameters:

  • limit (optional): Number of positions to return (1-100)
  • cursor (optional): Pagination cursor
  • ticker (optional): Filter by market ticker
  • event_ticker (optional): Filter by event ticker
  • count_filter (optional): Filter by position or total_traded

Order Tools

get_orders

Get your orders on Kalshi.

Parameters:

  • ticker (optional): Filter by market ticker
  • event_ticker (optional): Filter by event ticker
  • status (optional): Filter by status (resting, canceled, executed)
  • limit (optional): Number of orders to return (1-200)
  • cursor (optional): Pagination cursor
  • min_ts (optional): Filter after Unix timestamp
  • max_ts (optional): Filter before Unix timestamp

create_order

Place a new order on a market. ⚠️ This executes real trades!

Parameters:

  • ticker (required): Market ticker
  • side (required): yes or no
  • action (required): buy or sell
  • count (required): Number of contracts
  • type (optional): limit or market (default: limit)
  • yes_price (optional): Price in cents (1-99) for yes orders
  • no_price (optional): Price in cents (1-99) for no orders
  • client_order_id (optional): Your order ID for idempotency
  • expiration_ts (optional): Unix timestamp when order expires

cancel_order

Cancel an existing order.

Parameters:

  • order_id (required): The order ID to cancel

Example Conversations

"What prediction markets are available for Bitcoin on Kalshi?"

"Show me the orderbook for the KXBTC-25JAN03-B100500 market"

"What's my current balance and positions?"

"Buy 10 contracts of YES at 45 cents on KXBTC-25JAN03-B100500"

"What are my open orders? Cancel order xyz-123"

Requirements

  • Node.js 18+
  • Kalshi account with API access
  • RSA key pair for API authentication

Getting API Keys

  1. Log into your Kalshi account
  2. Go to Account Settings → API
  3. Generate a new API key (you'll create an RSA key pair)
  4. Save your API Key ID and private key securely

Links

License

MIT © NewYorkCompute