← Back to directory
I

Interactive Brokers MCP Server

Community
Connect Interactive Brokers accounts through MCP.
Category
Other #193 of 230
Stars
★ 223 Popular
Transport
stdio (local process)
Runtime
Node.js 18+
Credentials
API key / credential required
License
MIT
Last commit
Tools
9
43FMRS · D

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.

Strongest · Documentation 13/20 Weakest · Security and permissions 3/20

Reliability
7/20
Security and permissions
3/20
Maintenance
8/20
Documentation
13/20
Setup experience
12/20
Why each score
Reliability 7/20
The README describes authentication, Gateway lifecycle, and a tool list, but there is no cached manifest, source code, tests, or CI evidence validating MCP initialization, tool-list handshake, parameter consistency, or error handling. The project explicitly states that it is Alpha, and the Gateway, OAuth, Java, and platform dependencies add unverified startup risk, warranting a below-midrange score.
Security and permissions 3/20
The server accesses balances, positions, market data, and trading, and supports sensitive credentials including a password, Flex token, and TOTP secret. It recommends local use, paper trading, and read-only mode, but the material does not show that credentials are protected from logging or exfiltration, nor does it show explicit pre-trade confirmation or fine-grained permissions. The quick-start path can enable trading without a documented confirmation mechanism. Under the rules, this is an unconfirmed financial-side-effect red line, so the score is in the 0-4 range.
Maintenance 8/20
The repository is not archived, declares an MIT license, and provides GitHub issues as a support channel. However, the supplied material contains no evidence of releases, commit activity, dependency updates, maintainer identity, response history, or a security-response process. Repository existence, stars, and open issues do not establish sustained maintenance.
Documentation 13/20
The README covers installation examples, authentication modes, environment variables, paper trading, Flex Queries, Gateway lifecycle, tool categories, and some troubleshooting, while clearly disclosing its Alpha, unofficial, and financial-risk status. Points are deducted because tool parameters, return schemas, limits, timeout failure semantics, costs or rate limits, and detailed data-flow disclosures are not documented, and there is no reviewable implementation or test evidence.
Setup experience 12/20
It provides an npx configuration for Cursor/Claude and explains Node.js 18+, OAuth, headless mode, paper trading, and bundled Gateway/JRE support, making the mainstream setup path reasonably clear. Points are deducted because authentication, 2FA, Java/Gateway startup, and local-port discovery add operational complexity, and there is no evidence of actual execution, compatibility testing, or complete recovery procedures for common failures.

Static review · not runListed 2026-08-14

Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkChanges third-party account dataControls a browser

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.

Setup

Before you start

Runtime:Node.js 18+

IB_PASSWORD_AUTH optionalsecret Your IB password for headless login; store securely.
IB_FLEX_TOKEN optionalsecret Flex Web Service token, generated in IB Account Management → Settings → Reporting → Flex Web Service; required for Flex Query tools.
IB_TOTP_SECRET optionalsecret TOTP 2FA secret key for fully automated 2FA override; sensitive.
Other optional settings (14)
IB_USERNAME optional Your Interactive Brokers username, used for headless login.
IB_HEADLESS_MODE optional Set to "true" for browser-free credential login, suitable for servers and automation.
IB_PAPER_TRADING optional Set to "true" to use a paper trading account.
IB_AUTH_TIMEOUT optional Authentication timeout in seconds.
IB_AUTH_WAIT_SECONDS optional Seconds headless mode waits for 2FA completion.
IB_AUTH_POLL_SECONDS optional Polling interval in seconds for auth status.
IB_FORCE_STANDALONE_GATEWAY optional Set to "true" to skip external Gateway discovery and force the bundled standalone Gateway.
IB_READ_ONLY_MODE optional Set to "true" to enable read-only mode and disable place_order.
IB_TWO_FA_STRATEGY optional Selects the 2FA handling strategy; see docs/2FA-TOTP-STRATEGY.md.
IB_SELECTOR_USERNAME optional CSS selector override for the login page username field.
IB_SELECTOR_PASSWORD optional CSS selector override for the login page password field.
IB_SELECTOR_LOGIN_SUBMIT optional CSS selector override for the login page submit button.
IB_SELECTOR_TOTP_INPUT optional CSS selector override for the TOTP form input field.
IB_SELECTOR_TOTP_SUBMIT optional CSS selector override for the TOTP form submit button.

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.

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

Shown for Cursor. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "interactive-brokers": {
      "command": "npx",
      "args": [
        "-y",
        "interactive-brokers-mcp"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add interactive-brokers -- npx -y interactive-brokers-mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Tools like get_account_info should appear in your client's tool list; the first call to get_account_info opens a browser for IB OAuth login, and a returned balance proves the connection works.

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.

Things to try

Once connected, you can ask your AI assistant things like:

  • Show my account information and balances
  • Get real-time market data for AAPL
  • Buy 10 shares of MSFT with a limit order
  • List my saved Flex Queries

Tools 9

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

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

Cursor
Claude

Listed from the project's documentation, not tested by this site.

Overview

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.

Similar servers

BioMCP 75 · B

One binary. One grammar. Evidence from the biomedical sources you already trust.

★ 659 · Tools 11 Compare with this →

Source revision 3caecfc5072d Data synced 2026-10-19 Read the FMRS scoring method