Provides real-time IBKR data, options analysis, risk monitoring, and playbook actions via an MCP server for AI assistants.
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.
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.
pip install ibkr-mcpConfiguration 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.
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.
Retrieve account summary for specific or all accounts
Get portfolio positions with P&L
Get normalized positions across accounts
Calculate portfolio Greeks (delta, gamma, theta, vega)
Fetch option chain snapshots
Scan for options strategy trade signals
Evaluate risk against configured limits
Generate adjustment suggestions
Retrieve historical news for symbols