Skip to main content

Interactive Brokers MCP Server for AI-powered trading

Project description

ibkr-mcp

Interactive Brokers MCP Server for AI-powered trading assistance.

A Model Context Protocol (MCP) server that connects AI assistants to Interactive Brokers, enabling intelligent portfolio management, options analysis, and risk monitoring.

Features

  • Account Management: Real-time account summary, portfolio positions, and P&L tracking
  • Options Analysis: Option chain fetching, Greeks calculation, and strategy scanning
  • Risk Monitoring: Portfolio risk evaluation with configurable limits and alerts
  • Trading Strategies: Built-in support for covered calls, iron condors, PMCC, vertical spreads
  • News Integration: Historical news retrieval for market research
  • Playbook Actions: Automated adjustment suggestions based on risk rules

Installation

pip install ibkr-mcp

Prerequisites

  • Python 3.12+
  • Interactive Brokers TWS or IB Gateway running
  • Valid IBKR account credentials

Configuration

Set environment variables or create a .env file:

# IBKR Connection
IBKR_HOST=127.0.0.1
IBKR_PORT=4001          # TWS: 7497, IB Gateway: 4001
IBKR_CLIENT_ID=0
IBKR_ACCOUNT=U1234567   # MUST: specific account ID

# Optional: Data directories
IBKR_MCP_MARKET_DATA_TYPE=LIVE  # LIVE, FROZEN

Usage

As MCP Server

Add to your Claude Desktop or other MCP-compatible client configuration:

{
  "mcpServers": {
    "ibkr-mcp": {
      "command": "uvx",
      "args": [
        "ibkr-mcp"
      ],
      "env": {
        "IBKR_ACCOUNT": "U1234567"
      }
    }
  }
}

Available Tools

Resources Description
account_summary Retrieve account summary for specific account
Tool Description
get_portfolio Get portfolio positions with P&L

Support

For issues and feature requests, please contact the maintainers.

License

Proprietary - All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibkr_mcp-0.2.4-cp313-cp313-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

Details for the file ibkr_mcp-0.2.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ibkr_mcp-0.2.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44b22f54ae3d06bab7f0af7815d43868d28d2ce5c035f7344151be241054ab27
MD5 44cf466ad708b9322bf6fae2ba175333
BLAKE2b-256 52d8dc16d3c7cc074c117583d4b6495848b7ca897aa1db95126ac36f7e869b4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page