Skip to main content
Glama
karimQuant

ibapi-mcp-server

by karimQuant

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.

Related MCP server: ibkr-mcp-server

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

  1. Clone this repository:

git clone https://github.com/karimQuant/ibapi-mcp-server.git
cd ibapi-mcp-server
  1. Install dependencies:

pip install -e .

Usage

  1. Start your IB Gateway and log in

  2. Run the server:

    a. Using stdio transport (default):

    python server.py

    b. Using SSE transport:

    python server.py sse

    c. Using SSE transport with custom port:

    python server.py sse port=9000

    d. Using the FastMCP CLI:

    fastmcp run server.py

    e. For development with an interactive testing environment:

    fastmcp dev server.py
  3. 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.

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    An MCP server that enables interaction with Interactive Brokers TWS/Gateway via natural language for portfolio management and market data retrieval. It provides tools for account summaries, historical data, and a secure two-step confirmation process for placing and canceling orders.
    Last updated
    6
    MIT
  • F
    license
    -
    quality
    F
    maintenance
    This MCP server interacts with the Interactive Brokers API to fetch portfolio details, enabling portfolio management through natural language.
    Last updated
    64
  • A
    license
    B
    quality
    C
    maintenance
    MCP server for Interactive Brokers API, enabling account management, trading, market data, options, scanners, and news via natural language.
    Last updated
    33
    3
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    MCP server for Interactive Brokers TWS API that enables AI assistants to retrieve portfolio, account information, and real-time market prices.
    Last updated
    22
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • MCP server for Gainium — manage trading bots, deals, and balances via AI assistants

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/karimQuant/ibapi-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server