MCP Hub
Back to servers

Interactive Brokers MCP Server

Provides tools for interacting with Interactive Brokers Gateway to access market data, account summaries, and portfolio positions. It enables users to perform contract lookups, retrieve historical OHLCV bars, and view real-time quotes through natural language interfaces.

Updated
Feb 24, 2026

ibkr-mcp

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

Tools

ToolDescription
get_ibkr_market_dataHistorical OHLCV bars for any contract
get_ibkr_positionsCurrent portfolio positions and P&L
get_ibkr_accountAccount summary (balances, margin, NAV)
get_ibkr_contractContract lookup and details
get_ibkr_option_pricesOption chain pricing
get_ibkr_snapshotReal-time quote snapshot

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

VariableDefaultDescription
IBKR_GATEWAY_HOST127.0.0.1Gateway hostname
IBKR_GATEWAY_PORT7496Gateway port
IBKR_CLIENT_ID1API client ID
IBKR_TIMEOUT10Connection timeout (seconds)
IBKR_READONLYfalseRead-only mode
IBKR_AUTHORIZED_ACCOUNTSComma-separated account whitelist
IBKR_CACHE_DIROptional 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

MIT

Reviews

No reviews yet

Sign in to write a review