Interactive Brokers MCP Server

Interactive Brokers MCP Server

Connects AI assistants to Interactive Brokers for intelligent portfolio management, options analysis, risk monitoring, and automated trading strategy suggestions. Enables real-time account tracking, Greeks calculations, option chain analysis, and playbook-based risk adjustments through natural language.

Category
Visit Server

README

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=           # Optional: specific account ID

# Optional: Data directories
IBKR_MCP_OPTION_DATA_DIR=optiondata
IBKR_MCP_OPTION_HISTORY_DIR=historydata
IBKR_MCP_MARKET_DATA_TYPE=LIVE  # LIVE, FROZEN, DELAYED, DELAYED_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

Tool Description
get_account_summary Retrieve account summary for specific or all accounts
get_portfolio Get portfolio positions with P&L
get_positions Get normalized positions across accounts
get_greeks_summary Calculate portfolio Greeks (delta, gamma, theta, vega)
get_option_chains Fetch option chain snapshots
scan_option_signals Scan for options strategy trade signals
evaluate_portfolio_risk Evaluate risk against configured limits
generate_playbook_actions Generate adjustment suggestions
get_historical_news Retrieve historical news for symbols

Example Queries

Once connected through an AI assistant, you can ask:

  • "What's my current account balance and buying power?"
  • "Show me all my positions with Greeks"
  • "What's the option chain for AAPL expiring next month?"
  • "Evaluate my portfolio risk and suggest adjustments"
  • "Find covered call opportunities in my portfolio"

Risk Configuration

Create a risk.yaml file to define risk limits:

limits:
  max_delta: 100
  max_theta: -500
  max_concentration: 0.25

roll_rules:
  min_dte: 7
  target_delta: 0.30

Support

For issues and feature requests, please contact the maintainers.

License

Proprietary - All rights reserved.

Disclaimer

This software is for informational purposes only. It does not constitute financial advice. Trading involves substantial risk of loss. Use at your own risk.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured