Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

ibkr-mcp-server

MCP.Pizza Chef: seriallazer

The ibkr-mcp-server is a FastAPI-based MCP server that integrates with the Interactive Brokers (IBKR) API to provide real-time portfolio data. It offers structured access to IBKR client portfolio details, enabling LLMs and applications to query and interact with financial data securely and efficiently. Designed for developers building financial AI workflows, it simplifies fetching and exposing brokerage data within the MCP ecosystem.

Use This MCP server To

Fetch real-time portfolio details from Interactive Brokers API Expose IBKR portfolio data to LLMs via MCP protocol Integrate brokerage data into AI-driven financial dashboards Enable automated trading insights using portfolio data Support multi-step financial reasoning with live IBKR data

README

IBKR MCP Server

This project is a FastAPI application that interacts with the Interactive Brokers (IBKR) API to fetch portfolio details.

Project Structure

ibkr-mcp-server
├── app
│   ├── __init__.py
│   ├── main.py
│   ├── api
│   │   ├── __init__.py
│   │   └── endpoints
│   │       ├── __init__.py
│   │       └── portfolio.py
│   ├── core
│   │   ├── __init__.py
│   │   └── config.py
│   ├── models
│   │   ├── __init__.py
│   │   └── portfolio.py
│   └── services
│       ├── __init__.py
│       └── ibkr_service.py
├── requirements.txt
├── .env
└── README.md

Setup Instructions

  1. Clone the repository:

    git clone <repository-url>
    cd ibkr-mcp-server
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up environment variables: Create a .env file in the root directory and add your IBKR API credentials.

  5. Run the application:

    uvicorn app.main:app --reload

Usage

Once the server is running, you can access the API endpoints to fetch portfolio details. The API documentation will be available at http://localhost:8000/docs.

License

This project is licensed under the MIT License.

ibkr-mcp-server FAQ

How do I set up the ibkr-mcp-server?
Clone the repository, create a Python virtual environment, install dependencies from requirements.txt, and configure environment variables in a .env file as per the README instructions.
What environment variables are required?
You need to set IBKR API credentials and connection details in the .env file to authenticate and connect to the Interactive Brokers API.
Can this server handle multiple client requests concurrently?
Yes, built on FastAPI, it supports asynchronous request handling for concurrent portfolio data queries.
Is the ibkr-mcp-server secure for handling sensitive financial data?
It uses environment variables for sensitive credentials and FastAPI's security features to ensure safe data handling.
How does this server integrate with LLMs?
It exposes portfolio data via MCP endpoints, allowing LLM clients to query and use IBKR data in AI workflows.
What programming language and framework is used?
The server is implemented in Python using the FastAPI framework for high-performance API development.
Can I extend the server to support additional IBKR API endpoints?
Yes, the modular structure allows adding new endpoints and services to expand functionality.