Interactive Brokers MCP
This project provides an Interactive Brokers (IB) API interface using the Model Context Protocol (MCP).
What is Interactive Brokers MCP?
Interactive Brokers MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to this project provides an interactive brokers (ib) api interface using the model context protocol (mcp).
This project provides an Interactive Brokers (IB) API interface using the Model Context Protocol (MCP).
This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- This project provides an Interactive Brokers (IB) API interf
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx ib-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Interactive Brokers MCP
IB MCP provides a Model Context Protocol interface to the Interactive Brokers Web API, exposing account management, portfolio monitoring, live market data, and order management to AI assistants through a locally-running FastMCP Python server. It runs the official IBKR Client Portal Gateway in Docker and bridges it to any MCP-compatible client, making it possible to query positions, place orders, and analyze portfolio data through natural language without writing code. Traders and developers who already have an Interactive Brokers account can use it to bring AI-assisted analysis directly into their brokerage workflow.
Prerequisites
- An active Interactive Brokers account with Web API access enabled
- Docker and Docker Compose installed on the host machine
- Python 3.10 or later (for local development; Docker handles production)
- An MCP-compatible client such as Claude Desktop or VS Code with Copilot Chat
- Network access to localhost on port 5055 (IBKR gateway) and 5002 (MCP server)
Clone the repository and configure environment
Clone the IB_MCP repository and copy the example environment file. Edit .env to set your gateway and MCP server parameters before starting any services.
git clone https://github.com/rcontesti/IB_MCP.git
cd IB_MCP
cp .env.example .envStart the services with Docker Compose
Build and start the IBKR Client Portal Gateway and the MCP server containers in detached mode.
docker compose up --build -dAuthenticate with Interactive Brokers
Open your browser and navigate to the gateway login page. Enter your Interactive Brokers credentials. This step is required every session as IBKR sessions expire periodically.
# Default gateway URL (open in browser)
https://localhost:5055/Configure your MCP client
Add the running MCP server to your client. For VS Code with GitHub Copilot Chat, create or edit .vscode/mcp.json in your workspace with the HTTP transport URL.
Verify the connection
The MCP server calls the /tickle endpoint automatically every 60 seconds to keep the IBKR session alive. Confirm the MCP server is reachable on port 5002.
curl http://localhost:5002/mcp/Interactive Brokers MCP Examples
Client configuration
VS Code Copilot Chat configuration using the HTTP transport. Place this in .vscode/mcp.json or in VS Code settings.json.
{
"servers": {
"ib-mcp-server": {
"type": "http",
"url": "http://localhost:5002/mcp/"
}
}
}Prompts to try
These prompts work after the gateway session is authenticated and the MCP server is connected to your client.
- "Show me my current portfolio positions and their P&L."
- "What is the current market price for AAPL?"
- "List all open orders on my account."
- "What is my account's buying power and available cash?"
- "Show me the recent activity in my account."Troubleshooting Interactive Brokers MCP
Browser shows SSL certificate warning when opening the gateway
The IBKR Client Portal Gateway uses a self-signed certificate. Click 'Advanced' and proceed — this is expected behavior for the local gateway and does not affect security.
MCP server returns authentication errors after working initially
The IBKR session expires. Return to https://localhost:5055/ and re-authenticate with your IB credentials. The /tickle keepalive only extends an active session; it cannot re-authenticate after timeout.
Docker Compose fails to start the gateway container
Ensure no other service is using ports 5055 or 5002. Check GATEWAY_PORT and MCP_SERVER_PORT in your .env file and adjust if needed, then re-run 'docker compose up --build -d'.
Frequently Asked Questions about Interactive Brokers MCP
What is Interactive Brokers MCP?
Interactive Brokers MCP is a Model Context Protocol (MCP) server that this project provides an interactive brokers (ib) api interface using the model context protocol (mcp). It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Interactive Brokers MCP?
Follow the installation instructions on the Interactive Brokers MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Interactive Brokers MCP?
Interactive Brokers MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Interactive Brokers MCP free to use?
Yes, Interactive Brokers MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Interactive Brokers MCP Alternatives — Similar Finance & Fintech Servers
Looking for alternatives to Interactive Brokers MCP? 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 MCP 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 MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.