Interactive Brokers

v1.21.10Finance & Fintechstable

Interactive Brokers MCP Server

ibkribkr-apiinteractive-brokersmcpmcp-server
Share:
132
Stars
0
Downloads
0
Weekly
0/5

What is Interactive Brokers?

Interactive Brokers is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to interactive brokers mcp server

Interactive Brokers MCP Server

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Interactive Brokers MCP Server

Use Cases

Access Interactive Brokers account data and trading operations.
Execute portfolio management strategies through MCP interface.
code-rabi

Maintainer

LicenseMIT
Languagejavascript
Versionv1.21.10
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y interactive-brokers-mcp

Manual Installation

npx -y interactive-brokers-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Interactive Brokers

The Interactive Brokers MCP server connects AI assistants directly to your Interactive Brokers (IBKR) brokerage account, enabling natural language access to account balances, current positions, real-time market data, and order placement. It authenticates via IBKR's browser-based OAuth or in headless automation mode, exposes tools for executing market, limit, and stop orders, and supports IBKR Flex Queries for retrieving detailed account statements and historical trading data. Portfolio managers and algorithmic traders can use it to monitor holdings, analyze P&L, and execute trades through conversational commands.

Prerequisites

  • An Interactive Brokers account — live or paper trading account (open at interactivebrokers.com)
  • Node.js 18+ installed
  • An MCP-compatible client such as Claude Desktop or Cursor
  • Optional: IB_FLEX_TOKEN for Flex Query access — generate from IBKR Account Management under Reports → Flex Queries
1

Set up your Interactive Brokers account

Log in to your IBKR account at interactivebrokers.com. For safe testing, use a paper trading account (available under Account Management → Paper Trading). Note your username and password.

2

Install the package

Install the interactive-brokers-mcp package using npm, or use npx to run it without a global install.

npm install -g interactive-brokers-mcp
3

Configure the server with environment variables

Set your IBKR credentials as environment variables. Use IB_PAPER_TRADING=true to connect to your paper trading account, and IB_READ_ONLY_MODE=true to prevent accidental order placement during testing.

4

Add the server to your MCP client config

Add the Interactive Brokers MCP server to your Claude Desktop or Cursor config file with your credentials in the env block.

{
  "mcpServers": {
    "interactive-brokers": {
      "command": "npx",
      "args": ["-y", "interactive-brokers-mcp"],
      "env": {
        "IB_USERNAME": "your_ibkr_username",
        "IB_PASSWORD_AUTH": "your_ibkr_password",
        "IB_PAPER_TRADING": "true",
        "IB_HEADLESS_MODE": "true",
        "IB_READ_ONLY_MODE": "true"
      }
    }
  }
}
5

Authenticate and verify the connection

Restart your MCP client. On first launch, if not using headless mode, a browser window will open for IBKR OAuth. Complete the login. For headless mode, authentication happens automatically using the provided credentials.

6

Enable Flex Queries (optional)

To use historical account statement queries, generate a Flex Query token in IBKR Account Management under Reports → Flex Queries → Generate Token, then add it to your config.

Interactive Brokers Examples

Client configuration

Claude Desktop configuration for the Interactive Brokers MCP server in headless paper-trading mode with read-only enabled for safety.

{
  "mcpServers": {
    "interactive-brokers": {
      "command": "npx",
      "args": ["-y", "interactive-brokers-mcp"],
      "env": {
        "IB_USERNAME": "your_ibkr_username",
        "IB_PASSWORD_AUTH": "your_ibkr_password",
        "IB_PAPER_TRADING": "true",
        "IB_HEADLESS_MODE": "true",
        "IB_READ_ONLY_MODE": "true",
        "IB_FLEX_TOKEN": "your_flex_token_optional"
      }
    }
  }
}

Prompts to try

Example prompts for portfolio monitoring and trading through the Interactive Brokers MCP server.

- "What are my current account balances and buying power?"
- "Show me all my open positions with current P&L"
- "What is the current bid/ask for SPY and QQQ?"
- "Place a limit order to buy 10 shares of AAPL at $180"
- "List all my open orders and their statuses"
- "Run a Flex Query to get my trading activity for the past month"

Troubleshooting Interactive Brokers

Authentication times out or the browser OAuth window doesn't close

Adjust IB_AUTH_TIMEOUT and IB_AUTH_WAIT_SECONDS environment variables to give more time for 2FA completion. For automated setups, enable IB_HEADLESS_MODE=true and ensure IB_USERNAME and IB_PASSWORD_AUTH are correctly set.

Order placement fails with permission errors

Ensure IB_READ_ONLY_MODE is not set to 'true' when you intend to trade. Also verify your IBKR account has trading permissions enabled for the relevant asset class under Account Management → Trading Permissions.

Flex Query returns 'token not found' or empty results

The IB_FLEX_TOKEN must be generated specifically in IBKR's Account Management portal under Reports → Flex Queries → Create Token. This is separate from your login credentials and must be set as its own environment variable.

Frequently Asked Questions about Interactive Brokers

What is Interactive Brokers?

Interactive Brokers is a Model Context Protocol (MCP) server that interactive brokers mcp server It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Interactive Brokers?

Install via npm with the command: npx -y interactive-brokers-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Interactive Brokers?

Interactive Brokers works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Interactive Brokers free to use?

Yes, Interactive Brokers is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

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

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Interactive Brokers?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides