Skip to main content
Glama
Interactive Brokers MCP Server

Interactive Brokers MCP Server

ibkr-mcp

MCP server for Interactive Brokers Gateway — 7 tools for market data and account access via Claude.

Tools

Tool

Description

get_ibkr_market_data

Historical OHLCV bars for any contract

get_ibkr_positions

Current portfolio positions and P&L

get_ibkr_account

Account summary (balances, margin, NAV)

get_ibkr_contract

Contract lookup and details

get_ibkr_option_prices

Option chain pricing

get_ibkr_snapshot

Real-time quote snapshot

get_ibkr_status

IBKR Gateway connection diagnostics

Related MCP server: IBKR TWS MCP Server

Install

pip install interactive-brokers-mcp

Prerequisites

  • IB Gateway or TWS running

  • API access enabled in Gateway/TWS settings

  • Host/port/client ID matching your environment variables

Environment Variables

Variable

Default

Description

IBKR_GATEWAY_HOST

127.0.0.1

Gateway hostname

IBKR_GATEWAY_PORT

7496

Gateway port

IBKR_CLIENT_ID

1

API client ID

IBKR_TIMEOUT

10

Connection timeout (seconds)

IBKR_READONLY

false

Read-only mode

IBKR_AUTHORIZED_ACCOUNTS

Comma-separated account whitelist

IBKR_CACHE_DIR

Optional cache directory override

The package auto-loads .env from the package directory and parent.

Usage

Claude Code

claude mcp add ibkr-mcp -- ibkr-mcp

Or in ~/.claude.json:

{
  "mcpServers": {
    "ibkr-mcp": {
      "type": "stdio",
      "command": "ibkr-mcp"
    }
  }
}

Standalone

ibkr-mcp          # via installed entry point
python -m ibkr.server   # via module

License

PolyForm Noncommercial 1.0.0

Available Tools

6 tools
get_ibkr_accountC

Fetch IBKR account summary metrics.

Inputs: account_id. Returns: object

get_ibkr_contractC

Fetch contract details or option chain metadata from IBKR.

Inputs: symbol (required), sec_type, info_type, exchange, +1 more. Returns: object

get_ibkr_market_dataC

Fetch historical price series from IBKR Gateway.

Inputs: symbols (required), instrument_type (required), start_date, end_date, +2 more. Returns: object

get_ibkr_option_pricesC

Snapshot bid/ask/greeks for multiple option strikes.

Inputs: symbol (required), expiry (required), strikes (required), right. Returns: object

get_ibkr_positionsB

Fetch current IBKR positions and optionally account-level PnL.

Inputs: include_pnl, account_id. Returns: object

get_ibkr_snapshotC

Snapshot latest price for any security.

Inputs: symbol (required), sec_type, exchange, currency. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 6 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting different IBKR data types (account, contract, market data, options, positions, snapshot), but 'get_ibkr_market_data' and 'get_ibkr_snapshot' could cause confusion as both fetch price data with unclear boundaries between historical series and latest snapshots.

    Naming Consistency5/5

    All tools follow a perfect 'get_ibkr_' prefix pattern with descriptive snake_case suffixes, creating a highly predictable and readable naming convention throughout the set.

    Tool Count5/5

    Six tools is well-scoped for an Interactive Brokers data server, providing focused coverage of key financial data categories without being overwhelming or insufficient for the domain.

    Completeness3/5

    The toolset covers read operations well but lacks obvious trading or order management capabilities (create/update/delete orders) that would be expected for a full IBKR trading interface, creating notable gaps despite good data retrieval coverage.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to interact with Interactive Brokers trading accounts to retrieve market data, check positions, and place trades. Includes pre-configured IB Gateway and handles OAuth authentication automatically.
      14
      161 npm
      228
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLM clients to interact with Interactive Brokers Trader Workstation for automated trading workflows. Supports market data retrieval, portfolio management, and order execution through the TWS API.
      5
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Interactive Brokers via the TWS API or IB Gateway to manage accounts, retrieve market data, and execute trades. It supports features like real-time market data, historical data queries, and order management for stocks and options.
      4
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables read-only access to Interactive Brokers data including contracts, market data, news, fundamentals, and portfolio/account information for LLM workflows and autonomous agents.
      19
      BSD 3-Clause