Interactive Brokers (IBKR) MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Interactive Brokers (IBKR) MCP Server
A lightweight, zero-framework-dependency Model Context Protocol (MCP) server in Python that connects AI agents to Interactive Brokers. Implements MCP JSON-RPC 2.0 over stdio natively.
Auto-Detection Across IBKR Apps
Automatically probes and connects to whichever local IBKR interface is running:
TWS (Paper Trading) — Port
7497IB Gateway (Paper Trading) — Port
4002TWS (Live Trading) — Port
7496IB Gateway (Live Trading) — Port
4001Client Portal Web API Gateway — Port
5000(https://127.0.0.1:5000/v1/api)
Tip: If you use IBKR Desktop as your main screen, run IB Gateway or Client Portal Web API Gateway alongside it so the local API is available.
Related MCP server: IBKR TWS MCP Server
Setup
Install dependencies:
pip install -r requirements.txtIn TWS or IB Gateway, open File → Global Configuration → API → Settings:
Check Enable ActiveX and Socket Clients
Uncheck Read-Only API (only if you want to stage or place orders)
Verify the Socket port (
7497TWS Paper /7496TWS Live /4002Gateway Paper /4001Gateway Live)Ensure
127.0.0.1is allowed under Trusted IPs / "Allow connections from localhost only"
Add the server to your MCP client config:
{ "mcpServers": { "ibkr": { "command": "python3", "args": ["/path/to/ibkr-mcp/server.py"] } } }
Available MCP Tools
Tool | Description |
| Scans local ports ( |
| Net Liquidation, Cash, Buying Power, Available Funds, Margin, and Realized/Unrealized P&L |
| Current portfolio holdings, average cost, market price, market value, and P&L |
| Live or delayed bid/ask/last/high/low/volume quote for stocks, ETFs, forex, options, or futures |
| Historical OHLCV candlestick bars ( |
| Search contracts by ticker or company name ( |
| Fetch option expirations and strikes for an underlying ticker |
| List all currently open or working orders |
| Stage ( |
| Cancel an open order by |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Agentic brokerage access to a US brokerage account: quotes, orders, positions, cash and documents.
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
AI agents backtest, paper trade and live trade via your broker. Free to connect; OAuth.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables AI assistants to interact with Interactive Brokers trading accounts to retrieve market data, check positions, and place trades. Includes pre-configured IB Gateway and handles OAuth authentication automatically.14317 npm227MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLM clients to interact with Interactive Brokers Trader Workstation for automated trading workflows. Supports market data retrieval, portfolio management, and order execution through the TWS API.5-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Interactive Brokers via the TWS API or IB Gateway to manage accounts, retrieve market data, and execute trades. It supports features like real-time market data, historical data queries, and order management for stocks and options.4-
- AlicenseBqualityCmaintenanceProvides tools for interacting with Interactive Brokers Gateway to access market data, account summaries, and portfolio positions. It enables users to perform contract lookups, retrieve historical OHLCV bars, and view real-time quotes through natural language interfaces.649 PyPI3PolyForm Noncommercial 1.0.0