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

@iflow-mcp/interactive-brokers-mcp

v1.0.0

Published

MCP server for Interactive Brokers API integration

Readme

Interactive Brokers MCP Server

DISCLAIMER: This is an unofficial, community-developed MCP server and is NOT affiliated with or endorsed by Interactive Brokers. This software is in Alpha state and may not work perfectly.

A Model Context Protocol (MCP) server that provides integration with Interactive Brokers' trading platform. This server allows AI assistants to interact with your IB account to retrieve market data, check positions, and place trades.

Security Notice

IMPORTANT WARNINGS:

  • Financial Risk: Trading involves substantial risk of loss. Always test with paper trading first.
  • Security: This software handles sensitive financial data. Only run locally, never on public servers.
  • No Warranty: This unofficial software comes with no warranties. Use at your own risk.
  • Not Financial Advice: This tool is for automation only, not financial advice.

Features

  • Interactive Brokers API Integration: Full trading capabilities including account management, position tracking, real-time market data, and order management (market, limit, and stop orders)
  • Flexible Authentication: Choose between browser-based OAuth authentication or headless mode with credentials for automated environments
  • Simple Setup: Run directly with npx - no Docker or additional installations required. Includes pre-configured IB Gateway and Java runtime for all platforms

Prerequisites

No additional installations required! This package includes:

  • Pre-configured IB Gateway for all platforms (Linux, macOS, Windows)
  • Java Runtime Environment (JRE) for IB Gateway
  • All necessary dependencies

You only need:

  • Interactive Brokers account (paper or live trading)
  • Node.js 18+ (for running the MCP server)

Quick Start

Add this MCP server to your Cursor/Claude configuration:

{
  "mcpServers": {
    "interactive-brokers": {
      "command": "npx",
      "args": ["-y", "interactive-brokers-mcp"]
    }
  }
}

When you first use the server, a web browser window will automatically open for the Interactive Brokers OAuth authentication flow. Log in with your IB credentials to authorize the connection.

Headless Mode Configuration

For automated environments or when you prefer not to use a browser for authentication, you can enable headless mode by configuring it in your MCP server configuration:

{
  "mcpServers": {
    "interactive-brokers": {
      "command": "npx",
      "args": ["-y", "interactive-brokers-mcp"],
      "env": {
        "IB_HEADLESS_MODE": "true",
        "IB_USERNAME": "your_ib_username",
        "IB_PASSWORD_AUTH": "your_ib_password"
      }
    }
  }
}

In headless mode, the server will automatically authenticate using your credentials without opening a browser window. This is useful for:

  • Automated trading systems
  • Server environments without a display
  • CI/CD pipelines
  • Situations where browser interaction is not desired

Important: Even in headless mode, Interactive Brokers may still require two-factor authentication (2FA). When 2FA is triggered, the headless authentication will wait for you to complete the 2FA process through your configured method (mobile app, SMS, etc.) before proceeding.

To enable paper trading, add "IB_PAPER_TRADING": "true" to your environment variables:

{
  "mcpServers": {
    "interactive-brokers": {
      "command": "npx",
      "args": ["-y", "interactive-brokers-mcp"],
      "env": {
        "IB_HEADLESS_MODE": "true",
        "IB_USERNAME": "your_ib_username",
        "IB_PASSWORD_AUTH": "your_ib_password",
        "IB_PAPER_TRADING": "true"
      }
    }
  }
}

Security Note: Store credentials securely and never commit them to version control. Consider using environment variable files or secure credential management systems.

Configuration Variables

| Feature | Environment Variable | Command Line Argument | |---------|---------------------|----------------------| | Username | IB_USERNAME | --ib-username | | Password | IB_PASSWORD_AUTH | --ib-password-auth | | Headless Mode | IB_HEADLESS_MODE | --ib-headless-mode | | Paper Trading | IB_PAPER_TRADING | --ib-paper-trading | | Auth Timeout | IB_AUTH_TIMEOUT | --ib-auth-timeout |

Available MCP Tools

| Tool | Description | | ------------------ | ----------------------------------------- | | get_account_info | Retrieve account information and balances | | get_positions | Get current positions and P&L | | get_market_data | Real-time market data for symbols | | place_order | Place market, limit, or stop orders | | get_order_status | Check order execution status | | get_live_orders | Get all live/open orders for monitoring |

Troubleshooting

Authentication Problems:

  • Use the web interface that opens automatically
  • Complete any required two-factor authentication
  • Try paper trading mode if live trading fails

Support

  • This Server: Open an issue in this repository.

License

MIT License - see LICENSE file for details.