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

@fiorelorenzo/ibkr-mcp

v0.1.7

Published

MCP server for Interactive Brokers — account, options chains, analytics (BS/Greeks/IV/PMCC), market context.

Downloads

175

Readme

@fiorelorenzo/ibkr-mcp

MCP server for Interactive Brokers — account, positions, option chains, options analytics (Black-Scholes / Greeks / IV / PMCC / roll), and market context (earnings, dividends, fundamentals, 52w, universe screening). Read-only by default.

Install

npx -y @fiorelorenzo/ibkr-mcp

Or as a dependency in another project: npm install @fiorelorenzo/ibkr-mcp.

Quick start — Claude Code

Add this server to your .mcp.json:

{
  "mcpServers": {
    "ibkr-mcp": {
      "command": "npx",
      "args": ["-y", "@fiorelorenzo/ibkr-mcp"],
      "env": {
        "IBKR_MODE": "socket",
        "IBKR_HOST": "127.0.0.1",
        "IBKR_PORT": "4002",
        "IBKR_CLIENT_ID": "42",
        "IBKR_PAPER_TRADING": "true",
        "IBKR_ALLOW_ORDERS": "false"
      }
    }
  }
}

Make sure TWS or IB Gateway is running and accepting API connections on the configured port.

Configuration (env vars)

| Variable | Default | Description | | --- | --- | --- | | IBKR_MODE | oauth | oauth (not yet implemented — v0.2) or socket | | IBKR_HOST | 127.0.0.1 | TWS / IB Gateway host | | IBKR_PORT | 4002 | 4002 paper / 4001 live (Gateway); 7497 / 7496 (TWS) | | IBKR_CLIENT_ID | 42 | Any unused client id | | IBKR_ACCOUNT_ID | (unset) | Required only for multi-account login | | IBKR_PAPER_TRADING | true | | | IBKR_ALLOW_ORDERS | false | Must be explicitly true to enable place_order / cancel_order | | IBKR_LOG_LEVEL | info | debug / info / warn / error | | IBKR_MCP_CACHE_DIR | ~/.cache/ibkr-mcp | Override the universe constituents cache directory |

Tools

Analytics (9) — pure math, no I/O

bs_price, greeks_from_price, implied_volatility, prob_itm, expected_move, pmcc_evaluator, roll_analyzer, evaluate_multi_leg, classify_positions_by_strategy

Market context (6) — Yahoo Finance

get_earnings_date, get_dividend_calendar, get_dividend_ex_dates_next_n_days, get_fundamentals, get_52w_context, screen_universe

IBKR broker (13) — read-only by default; place_order / cancel_order gated by IBKR_ALLOW_ORDERS=true

get_account_summary, get_positions, get_pnl_per_position, get_market_data (returns broker-computed Greeks + IV for option contracts), get_option_chain, get_historical_bars, get_live_orders, get_order_status, get_flex_query, list_flex_queries, forget_flex_query, place_order, cancel_order

Read-only by default

place_order and cancel_order throw unless IBKR_ALLOW_ORDERS=true. This is intentional: the design is for an agent to propose orders that the user reviews and clicks manually in TWS. Set IBKR_ALLOW_ORDERS=true only if you have your own audit/confirmation step before the agent calls place_order.

Known limitations (v0.1)

  • OAuth headless mode is not implemented. Set IBKR_MODE=socket and run TWS or IB Gateway manually. Will land in v0.2.
  • Universe constituents are limited to the top ~10 holdings of the benchmark ETF (SPY → S&P 500, QQQ → NDX 100, DIA → Dow 30, IWM → Russell). Yahoo's topHoldings.holdings endpoint does not return the full index. v0.2 will backfill via a second source.
  • get_pnl_per_position is derived from get_positions and filters by symbol. No conId lookup yet.

Development

git clone https://github.com/fiorelorenzo/ibkr-mcp.git
cd ibkr-mcp
npm install
npm test         # 65 tests, no broker required
npm run smoke    # spawns the server over stdio and runs initialize/list/call
npm run build

License

MIT — see LICENSE.