Interactive Brokers
Connects AI assistants to Interactive Brokers for intelligent portfolio management, options analysis, risk monitoring, and automated trading strategy suggestions. Enables real-time account tracking, Greeks calculations, option chain analysis, and pla
What is Interactive Brokers?
Interactive Brokers is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to connects ai assistants to interactive brokers for intelligent portfolio management, options analysis, risk monitoring, and automated trading strategy suggestions. enables real-time account tracking, g...
Connects AI assistants to Interactive Brokers for intelligent portfolio management, options analysis, risk monitoring, and automated trading strategy suggestions. Enables real-time account tracking, Greeks calculations, option chain analysis, and pla
This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Connects AI assistants to Interactive Brokers for intelligen
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 is an unofficial, community-built integration that connects AI assistants directly to your Interactive Brokers trading account via the IB Client Portal Gateway. It bundles a pre-configured IB Gateway and Java runtime so no separate installation is required — just run it with npx. The server supports browser-based OAuth authentication as well as headless credential-based mode for automated environments, and it enables AI-assisted portfolio monitoring, real-time market data retrieval, options analysis, order placement, and Flex Query execution for historical account data.
Prerequisites
- An Interactive Brokers account (paper trading account recommended for initial testing)
- Node.js 18+ installed
- An MCP client such as Claude Desktop or Cursor
- Optional: IB Flex Web Service Token (from IB Account Management) for Flex Query features
- Important: This is an unofficial, alpha-stage tool — always test with paper trading before using live accounts
Add the MCP server to your client config
The simplest setup uses npx to run the server without any prior installation. On first use, a browser window opens automatically for Interactive Brokers OAuth authentication.
Complete the browser-based OAuth authentication
When the server starts for the first time, it launches your default browser and navigates to the IB OAuth login page. Log in with your Interactive Brokers credentials to authorize the connection.
Configure headless mode for automated environments
For automated or server-side use without a browser, set IB_HEADLESS_MODE=true along with your credentials. If two-factor authentication is triggered, the server waits up to 60 seconds for you to approve it via your mobile app or SMS.
Enable paper trading for safe testing
Set the IB_PAPER_TRADING environment variable to true to route all operations through your IB paper trading account instead of your live account.
Configure Flex Query access for historical data
To use Flex Queries for account statements and historical data, retrieve your Flex Web Service Token from IB Account Management (Settings > Account Settings > Reporting > Flex Web Service) and set it as IB_FLEX_TOKEN.
Interactive Brokers Examples
Client configuration
Minimal configuration using browser OAuth. For headless mode with paper trading, include the env block with credentials.
{
"mcpServers": {
"interactive-brokers": {
"command": "npx",
"args": ["-y", "interactive-brokers-mcp"]
}
}
}
// Headless + paper trading variant:
{
"mcpServers": {
"interactive-brokers": {
"command": "npx",
"args": ["-y", "interactive-brokers-mcp"],
"env": {
"IB_HEADLESS_MODE": "true",
"IB_USERNAME": "your_ib_username",
"IB_PASSWORD_AUTH": "your_ib_password",
"IB_PAPER_TRADING": "true",
"IB_FLEX_TOKEN": "your_flex_token"
}
}
}
}Prompts to try
After connecting and authenticating, use these prompts with your AI assistant to interact with your IB account.
- "Show me my current portfolio positions and their P&L"
- "What is the options chain for AAPL expiring next month? Show me the Greeks"
- "Place a limit buy order for 10 shares of MSFT at $420"
- "Run my monthly account statement Flex Query and summarize the results"
- "What is the current bid/ask spread for SPY?"Troubleshooting Interactive Brokers
Browser does not open for OAuth or authentication times out
Ensure your default browser is configured and accessible. If running in a headless environment, switch to headless mode by setting IB_HEADLESS_MODE=true with IB_USERNAME and IB_PASSWORD_AUTH. For 2FA, you have 60 seconds to approve via the IB mobile app.
Flex Query returns 'token not configured' error
Set the IB_FLEX_TOKEN environment variable with your Flex Web Service Token from IB Account Management. Navigate to Settings > Account Settings > Reporting > Flex Web Service to generate or retrieve the token.
Server fails to start or Gateway connection refused
The bundled IB Gateway starts as a detached process and stores runtime files under ib-gateway/.runtime/. If a stale Gateway process is interfering, kill it manually and restart the MCP server. Check that no other IB Gateway instance is already running on the same port.
Frequently Asked Questions about Interactive Brokers
What is Interactive Brokers?
Interactive Brokers is a Model Context Protocol (MCP) server that connects ai assistants to interactive brokers for intelligent portfolio management, options analysis, risk monitoring, and automated trading strategy suggestions. enables real-time account tracking, greeks calculations, option chain analysis, and pla 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 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.