← Back to directory
I

Interactive Brokers MCP Server

Community
Connect Interactive Brokers accounts through MCP.
GitHub source repository ↗
★ 212 Stars Category · Other Popular Source revision 3caecfc5072d
43FMRS · D
Reliability
7/20
Security and permissions
3/20
Maintenance
8/20
Documentation
13/20
Setup experience
12/20

An unofficial Alpha-stage Interactive Brokers MCP server covering account queries, market data, order management, and Flex Queries. Its trading automation capabilities are substantial, but it handles real-money access, sensitive credentials, and a local Gateway; users should start with paper trading and apply strict permission controls.

Read the FMRS scoring method →

Interactive Brokers MCP Server is an unofficial, community-developed MCP server in Alpha state. It integrates with the Interactive Brokers trading platform to retrieve account information, positions, real-time market data, and order information, and to place orders. It also supports Flex Queries for account statements, trade confirmations, and historical data.

Tools

get_account_info
Retrieve account information and balances.
get_positions
Get current positions and profit or loss.
get_market_data
Retrieve real-time market data for symbols.
place_order
Place market, limit, or stop orders; available only when read-only mode is disabled.
get_order_status
Check order execution status.
get_live_orders
Get all live or open orders for monitoring.
get_flex_query
Execute a Flex Query and retrieve statements; queries are automatically saved for reuse.
list_flex_queries
List previously used Flex Queries.
forget_flex_query
Remove a saved Flex Query.

Setup

Add the provided stdio configuration to a supported Cursor or Claude MCP configuration, and ensure Node.js 18 or later is available. On first use, a browser opens for Interactive Brokers OAuth authentication; automated environments can instead configure headless mode and credentials. Flex Query features additionally require IB_FLEX_TOKEN.

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

Fit and risk

Best for

  • Users who need AI-assisted access to an Interactive Brokers account
  • Automated trading or headless environments
  • Users who need account statements or historical data through Flex Queries

Not for

  • Users requiring an official Interactive Brokers integration
  • Users seeking financial advice
  • Users unwilling to handle sensitive financial data or trading risk locally

Required permissions

  • An Interactive Brokers account is required; paper and live trading accounts are supported by the documentation.
  • Browser mode requires authorization through Interactive Brokers OAuth.
  • Headless mode requires IB_USERNAME and IB_PASSWORD_AUTH.
  • Placing orders requires read-only mode to be disabled; paper trading can be enabled with IB_PAPER_TRADING.
  • Flex Query features require IB_FLEX_TOKEN.

Risks and side effects

  • The server is unofficial and is not affiliated with or endorsed by Interactive Brokers.
  • The project is in Alpha state and may not work perfectly.
  • Trading involves substantial risk of loss; the documentation recommends testing with paper trading first.
  • The software handles sensitive financial data and is intended to run locally rather than on public servers.
  • Credentials and TOTP secrets must be stored securely and never committed to version control.
  • The tool is for automation only and is not financial advice.

Troubleshooting

  1. For authentication problems, use the automatically opened web interface and complete required two-factor authentication.
  2. When headless authentication triggers 2FA, complete verification within the stated 60-second wait and then check account information again.
  3. For Gateway discovery or startup issues, inspect local Gateway connectivity and the logs and session files under ib-gateway/.runtime/.
  4. Set IB_FORCE_STANDALONE_GATEWAY=true when an unrelated local IB Gateway should not be reused.
  5. Before removing a stale startup lock, confirm that no MCP process is currently starting the Gateway.

Use cases

Query account balances, positions, and profit or loss
Retrieve real-time market data
Monitor live orders and execution status
Place market, limit, or stop orders
Run and reuse Flex Queries for statements and historical data

Supported clients

CursorFull support
ClaudeFull support