home / mcp / ibkr mcp server

IBKR MCP Server

Provides real-time IBKR data, options analysis, risk monitoring, and playbook actions via an MCP server for AI assistants.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kelvingao-ibkr-mcp": {
      "url": "https://mcp.example.com/ibkr-mcp",
      "headers": {
        "IBKR_HOST": "127.0.0.1",
        "IBKR_PORT": "4001",
        "IBKR_ACCOUNT": "U1234567",
        "IBKR_CLIENT_ID": "0",
        "IBKR_MCP_OPTION_DATA_DIR": "optiondata",
        "IBKR_MCP_MARKET_DATA_TYPE": "LIVE",
        "IBKR_MCP_OPTION_HISTORY_DIR": "historydata"
      }
    }
  }
}

You can run an MCP server that links Interactive Brokers data and trading capabilities to AI assistants. It provides real-time account summaries, portfolio management, options analysis, risk monitoring, and automated playbook actions to help you make informed trading decisions.

How to use

Set up a local MCP server that your AI assistants can connect to. You will use a local stdio-based server configuration so the AI client starts the ibkr-mcp process directly and communicates through standard input/output.

Once the server is running, configure your MCP client with the provided command and environment. You can query the server for current account summaries, portfolio positions with P&L, Greeks for your option holdings, and historical news data. The server can also evaluate portfolio risk against defined limits and generate playbook actions to adjust positions automatically.

How to install

pip install ibkr-mcp

Additional sections

Configuration and runtime are designed around environment variables you set before starting the server. The following variables control the IBKR connection and data handling.

Create a local environment file or export variables in your shell before launching the server. The recommended pattern is to provide a per-machine or per-user environment so you can reuse the same MCP configuration across different AI assistants.

Configuration

Required environment variables for the IBKR connection include host, port, client ID, and the account to use. Optional data directory paths control where option data and historical data are stored, and the mode for market data (LIVE, FROZEN, DELAYED, or DELAYED_FROZEN). Use these exact names to ensure the MCP server finds the settings.

Available tools

get_account_summary

Retrieve account summary for specific or all accounts

get_portfolio

Get portfolio positions with P&L

get_positions

Get normalized positions across accounts

get_greeks_summary

Calculate portfolio Greeks (delta, gamma, theta, vega)

get_option_chains

Fetch option chain snapshots

scan_option_signals

Scan for options strategy trade signals

evaluate_portfolio_risk

Evaluate risk against configured limits

generate_playbook_actions

Generate adjustment suggestions

get_historical_news

Retrieve historical news for symbols

IBKR MCP Server - kelvingao/ibkr-mcp