- Explore MCP Servers
- ibapi-mcp-server
Ibapi Mcp Server
What is Ibapi Mcp Server
ibapi-mcp-server is a middleware server that connects to Interactive Brokers’ API, allowing Large Language Models (LLMs) to interact with your IB account using the Model Context Protocol (MCP).
Use cases
Use cases include retrieving portfolio information, executing trades via LLMs, and developing trading applications that require real-time data from Interactive Brokers.
How to use
To use ibapi-mcp-server, start your Interactive Brokers Gateway, run the server using Python, and connect client applications to the server. You can choose different transport methods such as stdio or SSE.
Key features
Key features include connection to Interactive Brokers Gateway via the official IB API, support for multiple simultaneous client connections, exposure of IB functionality as MCP tools, connection status monitoring, and error handling with logging.
Where to use
ibapi-mcp-server can be used in financial services, trading applications, and any environment where integration with Interactive Brokers is required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Ibapi Mcp Server
ibapi-mcp-server is a middleware server that connects to Interactive Brokers’ API, allowing Large Language Models (LLMs) to interact with your IB account using the Model Context Protocol (MCP).
Use cases
Use cases include retrieving portfolio information, executing trades via LLMs, and developing trading applications that require real-time data from Interactive Brokers.
How to use
To use ibapi-mcp-server, start your Interactive Brokers Gateway, run the server using Python, and connect client applications to the server. You can choose different transport methods such as stdio or SSE.
Key features
Key features include connection to Interactive Brokers Gateway via the official IB API, support for multiple simultaneous client connections, exposure of IB functionality as MCP tools, connection status monitoring, and error handling with logging.
Where to use
ibapi-mcp-server can be used in financial services, trading applications, and any environment where integration with Interactive Brokers is required.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Interactive Brokers API FastMCP Server
A server implementation for Interactive Brokers’ API that allows LLMs to interact with your IB account using the Model Context Protocol (MCP).
Overview
This project creates a middleware server that connects to Interactive Brokers Gateway and exposes its functionality through the FastMCP framework. This allows LLMs like Claude to interact with your IB account, retrieve portfolio information, and potentially execute trades.
Features
- Connect to Interactive Brokers Gateway via the official IB API
- Support multiple simultaneous client connections through FastMCP
- Expose IB functionality as MCP tools and resources
- Connection status monitoring
- Error handling and logging
Prerequisites
- Python 3.11+
- Interactive Brokers Gateway installed and running
- IB account with API access enabled
Installation
- Clone this repository:
git clone https://github.com/karimQuant/ibapi-mcp-server.git cd ibapi-mcp-server
- Install dependencies:
pip install -e .
Usage
-
Start your IB Gateway and log in
-
Run the server:
a. Using stdio transport (default):
python server.pyb. Using SSE transport:
python server.py ssec. Using SSE transport with custom port:
python server.py sse port=9000d. Using the FastMCP CLI:
fastmcp run server.pye. For development with an interactive testing environment:
fastmcp dev server.py -
Connect client applications (like Claude Desktop) to the server
API Documentation
The FastMCP Server provides the following functionality:
Available Tools
- get_portfolio_tool: Retrieve your current portfolio positions and account summary
Resources
- ibgateway://{host}/{port}: Get the current status of the IB Gateway connection
License
MIT
Contribution
Contributions are welcome! Please feel free to submit a Pull Request.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










