Interactive Brokers
Interactive Brokers MCP Server
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
Maintainer
Works with
Installation
NPM
npx -y interactive-brokers-mcpManual Installation
npx -y interactive-brokers-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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.
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-mcpConfigure 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.
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"
}
}
}
}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.
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.
Interactive Brokers Alternatives — Similar Finance & Fintech Servers
Looking for alternatives to Interactive Brokers? Here are other popular finance & fintech servers you can use with Claude, Cursor, and VS Code.
ValueCell
★ 10.7kValueCell is a community-driven, multi-agent platform for financial applications.
Vibe Trading
★ 8.1k'Vibe-Trading: Your Personal Trading Agent'
Quantdinger
★ 6.2kAI quantitative trading platform for crypto, stocks, and forex with backtesting, live trading, market data, and multi-agent research.vibe-trading ,trading-agents,ai-trader,ai-trading
TradingView
★ 2.8kReal-time crypto & stock screening, advanced technical indicators, Bollinger Bands intelligence, candlestick patterns + native Claude Desktop integration. Multi-exchange (Binance, KuCoin, Bybit+). Open-source AI trading infrastructure.
Financial Datasets
★ 2.1kProvides access to comprehensive financial data including income statements, balance sheets, cash flow statements, stock prices, company news, SEC filings, and cryptocurrency information with built-in financial ratio analysis.
Stripe
★ 1.6kThe Stripe Model Context Protocol server allows you to integrate with Stripe APIs through function calling. This protocol supports various tools to interact with different Stripe services.
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.
Set Up Interactive Brokers in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.