Interactive Brokers MCP
@dickhfchan
This interative brokers MCP allows adding and deleting orders, getting the latest quotes...
Overview
What is Interactive Brokers MCP?
Interactive Brokers MCP is a Model Context Protocol server that wraps the Interactive Brokers Web API, enabling AI agents to interact with IBKR trading systems. It is built with FastMCP (FastAPI + MCP) and runs inside Docker, targeting developers who want to automate trading via MCP-compatible clients.
How to use Interactive Brokers MCP?
Clone the repository, then run docker-compose up to bring up the container. After it starts, use docker exec -it ibkr bash to get a command-line prompt. The MCP server runs on port 3100 and requires setting the IBKR_ACCOUNT_ID environment variable in the docker-compose.yml file.
Key features of Interactive Brokers MCP
- Docker-based deployment with Docker Desktop
- FastMCP server (FastAPI + MCP) on port 3100
- Requires IBKR account ID in configuration
- Co‑exists with the original Flask app for testing
- Video walkthrough available on YouTube
Use cases of Interactive Brokers MCP
- Automate trade execution through MCP-compatible AI assistants
- Integrate IBKR account management into agent workflows
- Test and compare Flask vs. FastAPI/MCP implementations live
FAQ from Interactive Brokers MCP
What are the requirements to run Interactive Brokers MCP?
Docker Desktop must be installed. The source code is cloned from GitHub, then the container is started with docker-compose up.
How do I configure my Interactive Brokers account?
Update the IBKR_ACCOUNT_ID variable in the docker-compose.yml file with your account ID.
How do I access the command line inside the container?
Run docker exec -it ibkr bash after the container is up.
Which MCP server file should I use?
The MCP server is in app2.py, which was created by converting the original Flask app to FastAPI and then adding FastMCP.
Where does the MCP server listen?
It listens on port 3100, as defined in the docker-compose.yml.