ibkr-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ibkr-mcp what's the current quote and my position for AAPL?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ibkr-mcp
A Model Context Protocol (MCP) server for Interactive Brokers. Connect any MCP-compatible AI agent to TWS or IB Gateway and get access to 80+ tools — market data, order management, account monitoring, risk analytics, news, and scanning — all through natural language.
Features
80+ MCP tools across 8 categories (contracts, market data, orders, accounts, risk, news, scanners, admin)
Pre-trade guardrails — max qty, max notional, daily loss limit, symbol allow/deny lists, read-only mode
Streaming support — real-time market data, order status, account updates via MCP notifications
Structured envelope responses — every response wrapped in
{ success, data, error, meta }with request IDs, timestamps, and latencyReconnection with backoff — exponential backoff + jitter, automatic subscription resumption
Rate limiting — token-bucket pacing at 45 req/sec (respects IB's 50 msg/sec limit)
Full TypeScript strict mode —
noUncheckedIndexedAccess,noUnusedLocals,noPropertyAccessFromIndexSignature, and all strict flags enabledESLint with typescript-eslint strict + stylistic presets
esbuild bundler — single-file 780KB bundle, tree-shaken, with optional minification
Docker support — multi-stage build + compose with IB Gateway
Related MCP server: IBKR TWS MCP Server
Architecture
┌─────────────┐ stdio ┌──────────────────────────────────────────────┐
│ MCP Client │◄────────────►│ ibkr-mcp │
│ (AI Agent) │ │ │
└─────────────┘ │ app.ts ─► tools/ ─► services/ ─► ib_conn │
│ │ │ │
│ schemas/ middleware/ │
│ (zod validation) (guardrails, │
│ rate limit, │
│ error mapping) │
└──────────────────────────────────────────────┘
│
TCP 4001/4002
│
┌─────────▼─────────┐
│ TWS / IB Gateway │
└───────────────────┘Prerequisites
Before setting up the IBKR MCP server, ensure you have the following:
Required
Node.js ≥ 20 — download
Interactive Brokers Account — a funded or paper trading account
TWS (Trader Workstation) or IB Gateway — download
API connections must be enabled: TWS → Edit → Global Configuration → API → Settings
Enable "Enable ActiveX and Socket Clients"
Note the Socket port (default:
7497for TWS paper,4002for Gateway paper)Optionally add
127.0.0.1to Trusted IPs to skip connection prompts
Optional
Docker & Docker Compose — for containerized deployment
Claude Desktop, Cursor, or any MCP-compatible client — to connect to the server
IB Gateway vs TWS
IB Gateway | TWS | |
Best for | Headless / server use | Interactive trading + API |
Paper port |
|
|
Live port |
|
|
GUI | Minimal | Full trading UI |
Stability | Recommended for always-on | May require interaction |
Quick Start
Install & Build
git clone https://github.com/guramrit-dhillon/ibkr-mcp.git
cd ibkr-mcp
npm install
cp .env.example .env # edit with your settings
npm run buildSetup
1. Configure IB Gateway / TWS
Launch IB Gateway or TWS and log in (use paper trading to start)
Enable the API:
TWS: Edit → Global Configuration → API → Settings
IB Gateway: Configure → Settings → API → Settings
Check "Enable ActiveX and Socket Clients"
Note the Socket port (default
4002for Gateway paper,7497for TWS paper)Optionally add
127.0.0.1to Trusted IPs to avoid connection confirmation dialogs
2. Configure the MCP Server
Copy the example environment file and edit it:
cp .env.example .envKey settings in .env:
# Connection — match your IB Gateway/TWS settings
IB_HOST=127.0.0.1
IB_PORT=4002 # 4002=Gateway paper, 7497=TWS paper, 4001=Gateway live, 7496=TWS live
IB_CLIENT_ID=1
IB_MODE=paper # paper | live
# Safety — start with read-only mode
IB_READ_ONLY=true # blocks all order mutations; set to false when ready to trade
# Risk guardrails
RISK_MAX_ORDER_QTY=1000 # max shares/contracts per order
RISK_MAX_ORDER_NOTIONAL=100000 # max order value in USD
RISK_DAILY_LOSS_LIMIT=10000 # daily loss circuit breaker in USD3. Connect from an MCP Client
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ibkr": {
"command": "npx",
"args": ["ibkr-mcp"],
"env": {
"IB_HOST": "127.0.0.1",
"IB_PORT": "4002",
"IB_READ_ONLY": "true"
}
}
}
}Cursor
Add to .cursor/mcp.json in your project or global config:
{
"mcpServers": {
"ibkr": {
"command": "npx",
"args": ["ibkr-mcp"]
}
}
}Any stdio-compatible MCP client
# The server communicates over stdin/stdout using the MCP protocol
npx ibkr-mcp4. Verify the Connection
After connecting, try these prompts to confirm everything works:
"What's the connection status?" — should show
connected: true"List my accounts" — should show your paper/live account(s)
"What's the current price of AAPL?" — should return a market data snapshot
Example Prompts
Once connected, you can ask your AI assistant questions like:
Market Data & Research
"What's the current price of AAPL?"
"Show me historical daily bars for TSLA over the last 6 months"
"Get me a quote snapshot for SPY, QQQ, and IWM"
"What are the fundamentals for MSFT — P/E ratio, market cap, earnings?"
"Show me the order book depth for AMZN"
Contracts & Options
"Search for all contracts matching 'META'"
"What are the available option expirations and strikes for AAPL?"
"Build me an option chain for SPY expiring next month with strikes near the money"
"What are the trading rules for ES futures — tick size, trading hours, order types?"
Portfolio & Account
"What's my account summary — net liquidation, buying power, margin?"
"Show me all my current positions"
"What's my portfolio PnL today?"
"What are my cash balances by currency?"
"Show me margin requirements for 100 shares of GOOG"
Orders & Trading
"Place a limit order to buy 50 shares of AAPL at $180"
"Preview the margin impact of buying 200 shares of MSFT"
"Show me all my open orders"
"Place a bracket order: buy 100 TSLA at market with a take profit at $300 and stop loss at $250"
"What are my recent executions today?"
Risk & Analytics
"Calculate the implied volatility for the AAPL 200 call expiring in March"
"What are the greeks for my portfolio?"
"Run a stress test: what happens if SPY drops 10%?"
"Show me my exposure breakdown by sector"
"What's my portfolio Value at Risk at 95% confidence?"
"Simulate the impact of adding 500 shares of NVDA to my portfolio"
Scanners & News
"Run a scanner for the top gainers in US stocks today"
"Show me the most active options by volume"
"Get me the latest news headlines for TSLA"
Admin
"What's the connection status to IB Gateway?"
"Show me the recent error log"
"List all active streaming subscriptions"
Tools Reference
Contracts (8 tools)
Tool | Description |
| Search contracts by symbol/name with optional filters |
| Get full contract details (by conId or symbol) |
| Qualify a contract — fully resolve and validate |
| Get trading rules (min tick, order types, trading hours) |
| Get option chain parameters (expirations, strikes) |
| Build a filtered option chain with greeks |
| Get instrument metadata (industry, category, long name) |
| Resolve a symbol to qualified conId(s) |
Market Data (15 tools)
Tool | Description |
| Get a snapshot of current market data (bid, ask, last, etc.) |
| Bulk snapshots for multiple contracts |
| Get historical OHLCV bars |
| Get historical tick data |
| Get fundamental data (financials, ratios, etc.) |
| Get current order book depth snapshot |
| Subscribe to streaming market data |
| Unsubscribe from streaming market data |
| Subscribe to tick-by-tick data |
| Unsubscribe from tick-by-tick data |
| Subscribe to streaming order book |
| Unsubscribe from streaming order book |
| Subscribe to real-time 5-second bars |
| Unsubscribe from real-time bars |
| List all active market data subscriptions |
Orders (14 tools)
Tool | Description |
| Place a new order (LMT, MKT, STP, TRAIL, etc.) |
| Modify an existing order |
| Cancel a specific order |
| Cancel all open orders |
| List all open orders |
| List completed orders |
| List recent executions |
| Preview order impact (margin, commission) |
| Exercise or lapse options |
| Place a bracket order (entry + take profit + stop loss) |
| Place a one-cancels-other order group |
| Subscribe to order status updates |
| Unsubscribe from order status updates |
Account (17 tools)
Tool | Description |
| List all managed accounts |
| Get account summary (NLV, buying power, etc.) |
| Get all account values (key-value pairs) |
| List all positions |
| List portfolio with PnL |
| Get account-level PnL |
| Get position-level PnL |
| Subscribe to real-time account updates |
| Unsubscribe from account updates |
| Get available buying power |
| Get cash balances by currency |
| Get leverage/margin metrics |
| Get margin requirements for a contract |
| List Financial Advisor groups |
| List Financial Advisor profiles |
| List Financial Advisor aliases |
| Replace Financial Advisor configuration |
Risk Analytics (14 tools)
Tool | Description |
| Calculate theoretical option price |
| Calculate implied volatility |
| Calculate option greeks |
| Get aggregate portfolio greeks |
| Run portfolio stress test with custom scenarios |
| Get notional exposure by symbol |
| Get exposure breakdown by sector |
| Calculate portfolio Value at Risk |
| Calculate portfolio beta exposure |
| Generate correlation matrix for portfolio |
| Simulate impact of a hypothetical trade |
| Get dividend/split history |
| Get upcoming corporate actions |
News (6 tools)
Tool | Description |
| List available news providers |
| Subscribe to IB bulletins |
| Unsubscribe from IB bulletins |
| Get news headlines for a contract |
| Get full news article by ID |
| Get historical news for a contract |
Scanner (5 tools)
Tool | Description |
| Get available scanner parameters XML |
| Run a market scanner with custom criteria |
| Cancel a running scanner subscription |
| List scanner presets |
| Run a scanner from a preset name |
Admin (7 tools)
Tool | Description |
| Get connection state, uptime, error log |
| Force reconnection to TWS/IB Gateway |
| View current server configuration |
| Get recent IB error log |
| List all active subscriptions |
| Get server time |
| Health check / ping |
Configuration
All configuration via environment variables (see .env.example):
Variable | Default | Description |
|
| TWS/Gateway host |
|
| API port |
|
| Client ID |
|
|
|
|
| Block all order mutations |
| (auto) | Account ID override |
|
| Max shares/contracts per order |
|
| Max order notional ($) |
|
| Daily loss limit ($) |
|
| Allowed order types |
| (none) | Only allow these symbols |
| (none) | Block these symbols |
|
| Allow outside-hours orders |
|
|
|
Docker
With Docker Compose (recommended)
# Set credentials
cp .env.example .env
# Edit .env: TWS_USERID, TWS_PASSWORD, TRADING_MODE
# Start IB Gateway + MCP server
docker compose up -d
# Check logs
docker compose logs -f mcpStandalone
docker build -t ibkr-mcp .
docker run --rm -i \
-e IB_HOST=host.docker.internal \
-e IB_PORT=4002 \
ibkr-mcpDevelopment
# Run in development mode
npm run dev
# Type-check only
npm run typecheck
# Lint
npm run lint
npm run lint:fix
# Full check (typecheck + lint)
npm run check
# Run tests
npm test
npm run test:watch
npm run test:coverage
# Build (typecheck + bundle)
npm run build
# Bundle only (skip typecheck)
npm run build:bundle
npm run build:bundle:min # minifiedProject Structure
src/
├── app.ts # MCP server bootstrap
├── config.ts # Environment-driven configuration
├── connection/
│ ├── ib_connection.ts # IB API connection manager
│ └── event_bus.ts # Typed event pub/sub
├── middleware/
│ ├── logging.ts # JSON structured logger
│ ├── error_mapping.ts # Error normalization + response envelope
│ ├── rate_limit.ts # Token-bucket rate limiter
│ └── guardrails.ts # Pre-trade safety checks
├── schemas/
│ ├── common.ts # Shared types (contract, error, response)
│ ├── contract_schemas.ts # Contract tool schemas
│ ├── market_data_schemas.ts
│ ├── order_schemas.ts
│ ├── account_schemas.ts
│ ├── news_schemas.ts
│ └── scanner_schemas.ts
├── services/
│ ├── contract_service.ts # Contract operations
│ ├── market_data_service.ts
│ ├── orders_service.ts
│ ├── account_service.ts
│ ├── risk_service.ts
│ ├── news_service.ts
│ └── scanner_service.ts
├── tools/
│ ├── index.ts # Tool aggregation + O(1) dispatch
│ ├── contract_tools.ts # Tool definitions + handlers
│ ├── market_data_tools.ts
│ ├── order_tools.ts
│ ├── account_tools.ts
│ ├── risk_tools.ts
│ ├── news_tools.ts
│ ├── scanner_tools.ts
│ └── admin_tools.ts
└── resources/
├── index.ts # MCP resource definitions
└── server_instructions.md
tests/
├── config.test.ts
├── error_mapping.test.ts
├── guardrails.test.ts
├── rate_limit.test.ts
├── schemas.test.ts
└── event_bus.test.tsResponse Format
Every tool returns a standardized envelope:
{
"success": true,
"data": { ... },
"error": null,
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2025-01-15T12:34:56.789Z",
"latency_ms": 42
}
}On error:
{
"success": false,
"data": null,
"error": {
"code": "IB_CONTRACT_NOT_FOUND",
"message": "No matching contract found",
"details": {},
"ib_error_code": 200,
"retriable": false
},
"meta": { ... }
}Safety
Read-only by default —
IB_READ_ONLY=trueblocks all order mutationsPre-trade guardrails — quantity limits, notional limits, daily loss limits
Symbol filtering — allowlist/denylist enforcement
Order type restrictions — only configured order types allowed
Outside-RTH protection — disabled by default
Disclaimer
This project is not affiliated with, endorsed by, or sponsored by Interactive Brokers Group, Inc. "Interactive Brokers", "IBKR", "TWS", and "IB Gateway" are registered trademarks of Interactive Brokers Group, Inc. Use of the Interactive Brokers API is subject to their API License Agreement. This software is provided as-is with no warranty — use at your own risk, especially when placing live orders.
License
MIT
Available Tools
84 toolsaccounts_listB
List all managed accounts associated with the connection.
Inputs: no named parameters.
account_summaryA
Get account summary: net liquidation, equity, cash, margin, buying power, etc. Supports filtering by tags.
Inputs: tags, group, account.
account_updates_subscribeC
Subscribe to live account updates (values and portfolio changes).
Inputs: account.
account_updates_unsubscribeC
Unsubscribe from live account updates.
Inputs: subscription_id (required).
account_valuesB
Get all key-value pairs from account: all balances, margin values, etc.
Inputs: account.
beta_exposureC
Calculate portfolio beta exposure relative to a benchmark (e.g., SPY).
Inputs: account, lookbackDays, benchmarkSymbol.
bracket_orderC
Place a bracket order: parent + take-profit + stop-loss. All three orders are linked and submitted together.
Inputs: side (required), quantity (required), stopLossPrice (required), entryOrderType (required), +11 more.
buying_powerC
Get buying power details for an account.
Inputs: account.
cash_balancesC
Get cash balance breakdown by currency.
Inputs: account.
connection_reconnectA
Force a reconnect to IB Gateway/TWS. Disconnects and reconnects the session.
Inputs: no named parameters.
connection_statusA
Check the IB Gateway/TWS connection status: connected, server version, managed accounts, error buffer, active subscriptions count.
Inputs: no named parameters.
contract_detailsA
Get full contract details including trading hours, min tick, valid exchanges, etc. Provide conId or contract specification.
Inputs: conId, symbol, secType, currency, +1 more.
contract_qualifyA
Qualify a partial contract specification to get the full conId and resolved exchange. MUST be called before using contracts in market data or order tools.
Inputs: symbol (required), secType (required), right, strike, +4 more.
contract_rulesB
Get trading rules for a contract: min tick, size increment, valid exchanges, order types.
Inputs: conId (required), exchange.
contract_searchB
Search for contracts/instruments by query string. Returns matching candidates with conId, symbol, secType, exchange.
Inputs: query (required), secType, currency, exchange.
corporate_actions_calendarA
Get upcoming corporate actions (dividends, splits, earnings) for contracts. NOTE: Requires Thomson Reuters subscription.
Inputs: conIds (required).
correlation_matrixC
Compute pairwise correlation matrix for a set of symbols based on historical returns.
Inputs: symbols (required), barSize, lookbackDays.
dividends_and_splits_historyC
Get historical dividends and stock splits for a symbol.
Inputs: conId (required), symbol.
error_logB
Get the recent error log ring buffer. Returns the last N errors from the IB connection.
Inputs: count.
executions_listB
List execution reports (fills) with optional filter by symbol, side, time, etc.
Inputs: side, time, symbol, secType, +3 more.
exercise_optionsC
Exercise or lapse an option contract.
Inputs: conId (required), account (required), exerciseAction (required), exerciseQuantity (required), +1 more.
exposure_by_sectorC
Get portfolio exposure breakdown by sector/industry.
Inputs: account.
exposure_by_symbolB
Get portfolio exposure breakdown by symbol: market value, weight, delta exposure.
Inputs: account.
fa_aliases_listB
List Financial Advisor account aliases (FA accounts only).
Inputs: no named parameters.
fa_groups_listA
List Financial Advisor account groups (FA accounts only).
Inputs: no named parameters.
fa_profiles_listA
List Financial Advisor allocation profiles (FA accounts only).
Inputs: no named parameters.
fa_replaceB
Replace Financial Advisor configuration XML (groups, profiles, or aliases).
Inputs: xml (required), faDataType (required).
fundamental_dataC
Get fundamental data for a stock: financial summary, ratios, earnings, etc.
Inputs: reportType (required), conId, symbol, secType, +2 more.
greeks_calculateC
Calculate option Greeks (delta, gamma, theta, vega) for one or more contracts.
Inputs: conId (required), symbol, secType, currency, +1 more.
historical_dataC
Get OHLCV historical bars. Supports durations like "1 D", "1 W", "1 M", "1 Y". Bar sizes: "1 min", "5 mins", "1 hour", "1 day", etc.
Inputs: durationStr (required), barSizeSetting (required), conId, symbol, +6 more.
historical_newsC
Get historical news headlines for a contract.
Inputs: conId (required), providerCodes (required), endDateTime, totalResults, +1 more.
historical_ticksC
Get individual tick data (time & sales). Returns up to 1000 ticks for a given time range.
Inputs: conId, symbol, useRTH, secType, +6 more.
implied_volatility_calculateC
Calculate implied volatility from option price using IB API.
Inputs: conId (required), underPrice (required), optionPrice (required), symbol, +3 more.
instrument_metadataB
Get metadata for an instrument: symbol, primary exchange, industry, category, subcategory.
Inputs: conId (required).
leverage_metricsB
Get leverage and margin utilization metrics: gross/net leverage, margin used vs available, cushion.
Inputs: account.
list_market_data_subscriptionsA
List all active market data streaming subscriptions.
Inputs: no named parameters.
margin_requirementsA
Get margin requirements for a hypothetical trade (uses order what-if).
Inputs: side (required), contract (required), quantity (required).
market_data_bulk_snapshotB
Get snapshots for multiple contracts simultaneously. Uses frozen snapshot (type 3). Returns array of results.
Inputs: contracts (required), fields.
market_data_snapshotB
Get a point-in-time snapshot of market data for one contract: bid/ask/last/volume/OHLC etc. Resolves when data arrives or times out.
Inputs: conId, fields, symbol, secType, +3 more.
market_data_stream_subscribeC
Subscribe to a live streaming market data feed (ticks) for a contract. Events are delivered via MCP resources.
Inputs: conId, symbol, secType, currency, +2 more.
market_data_stream_unsubscribeC
Unsubscribe from a market data stream by subscription_id.
Inputs: subscription_id (required).
market_depth_snapshotC
Get an order book snapshot (Level 2 data). Returns the current market depth rows.
Inputs: conId, symbol, numRows, secType, +2 more.
market_depth_stream_subscribeC
Subscribe to streaming market depth (Level 2) updates.
Inputs: conId, symbol, numRows, secType, +2 more.
market_depth_stream_unsubscribeC
Unsubscribe from market depth stream.
Inputs: subscription_id (required).
news_articleA
Get the full text of a news article by providerCode and articleId.
Inputs: articleId (required), providerCode (required).
news_bulletins_subscribeC
Subscribe to IB system news bulletins (exchange messages, system status, etc.).
Inputs: allMsgs.
news_bulletins_unsubscribeB
Unsubscribe from IB news bulletins.
Inputs: no named parameters.
news_headlinesC
Get recent news headlines, optionally filtered by provider codes and contract ID.
Inputs: conId, endDateTime, totalResults, providerCodes, +1 more.
news_providers_listA
List available news providers with their codes.
Inputs: no named parameters.
oco_orderC
Place a One-Cancels-Other (OCO) order group. When one order fills, the other is cancelled.
Inputs: side (required), ocaGroup (required), quantity (required), order1Type (required), +10 more.
option_chainB
Get the full option chain for an underlying: expirations, strikes, rights (C/P), multipliers.
Inputs: currency, exchange, underlyingConId, underlyingSymbol.
option_price_calculateC
Calculate theoretical option price using Black-Scholes model via IB API.
Inputs: conId (required), underPrice (required), volatility (required), symbol, +3 more.
order_cancelB
Cancel an open order by orderId.
Inputs: orderId (required), manualOrderCancelTime.
order_modifyB
Modify an existing open order. Requires the same fields as order_place plus the orderId to modify.
Inputs: side (required), orderId (required), quantity (required), orderType (required), +10 more.
order_placeB
Place a new order. Requires: side, quantity, order type, and a qualified contract. Enforces all guardrails (read-only check, max qty, max notional, allowed order types, symbol allowlist/denylist).
Inputs: side (required), quantity (required), orderType (required), tif, +19 more.
order_previewB
Preview/what-if an order: see estimated commission, margin impact, equity with loan before actually sending.
Inputs: side (required), quantity (required), orderType (required), tif, +7 more.
orders_cancel_allA
Cancel ALL open orders via global cancel. Use with extreme caution.
Inputs: no named parameters.
orders_completed_listA
List completed (filled, cancelled) orders.
Inputs: no named parameters.
orders_open_listC
List all open/pending orders with their current status.
Inputs: account.
order_status_stream_subscribeA
Subscribe to live order status updates. Events are delivered via MCP notifications.
Inputs: no named parameters.
order_status_stream_unsubscribeB
Unsubscribe from order status updates.
Inputs: subscription_id (required).
pingA
Simple health check — returns "pong" with uptime and connection status.
Inputs: no named parameters.
pnl_accountC
Get real-time account PnL: daily, unrealized, realized PnL.
Inputs: account, modelCode.
pnl_positionB
Get real-time PnL for a specific position by conId.
Inputs: conId (required), account, modelCode.
portfolio_greeksA
Aggregate Greeks for all option positions in the portfolio. Returns portfolio-level delta, gamma, theta, vega.
Inputs: account.
portfolio_listB
Get portfolio positions with market value, unrealized/realized PnL from the account model.
Inputs: account.
positions_listA
List all open positions across all accounts, with conId, size, avgCost, unrealized PnL.
Inputs: account.
realtime_bars_stream_subscribeC
Subscribe to 5-second realtime bars.
Inputs: conId, symbol, useRTH, secType, +3 more.
realtime_bars_stream_unsubscribeC
Unsubscribe from realtime bars stream.
Inputs: subscription_id (required).
scanner_cancelB
Cancel a running scanner subscription by reqId.
Inputs: reqId (required).
scanner_parametersA
Get available scanner parameters: scan types, instruments, location codes, filter types. Returns XML — parse for valid values.
Inputs: no named parameters.
scanner_presets_listB
List all available scanner presets with their configurations.
Inputs: no named parameters.
scanner_runB
Run a market scanner with custom parameters. Returns matching instruments.
Inputs: scanCode (required), instrument (required), locationCode (required), abovePrice, +7 more.
scanner_run_presetC
Run a pre-configured scanner preset by name: top_gainers, top_losers, most_active, high_iv, unusual_volume, breakout_candidates, gap_up, gap_down.
Inputs: presetName (required), numberOfRows.
security_definitions_option_parametersB
Get available option expirations, strikes, and trading classes for an underlying.
Inputs: underlyingConId (required), exchange, underlyingSymbol, underlyingSecType.
server_configA
Get the current server configuration (sanitized — no secrets). Shows mode, risk limits, cache TTL, reconnect settings.
Inputs: no named parameters.
server_timeA
Request current server time from IB Gateway. Useful for health checks and clock sync verification.
Inputs: no named parameters.
simulate_trade_impactC
Simulate the impact of a hypothetical trade on portfolio risk metrics (margin, Greeks, VaR).
Inputs: side (required), conId (required), quantity (required), symbol, +5 more.
stress_test_portfolioB
Stress test the current portfolio under hypothetical market scenarios: price moves, vol changes, time decay.
Inputs: scenarios (required), account.
subscriptions_listB
List all active streaming subscriptions (market data, ticks, depth, bars, order status).
Inputs: no named parameters.
symbol_to_conid_mappingB
Resolve a symbol to its conId. Results are cached.
Inputs: symbol (required), secType, exchange.
tick_by_tick_stream_subscribeC
Subscribe to tick-by-tick data (Last, AllLast, BidAsk, MidPoint) for highest resolution.
Inputs: tickType (required), conId, symbol, secType, +4 more.
tick_by_tick_stream_unsubscribeB
Unsubscribe from tick-by-tick data stream.
Inputs: subscription_id (required).
value_at_riskB
Calculate portfolio Value-at-Risk (VaR) using parametric method. Returns 1-day and N-day VaR at given confidence.
Inputs: account, lookbackDays, confidenceLevel, holdingPeriodDays.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 84 tools
The set contains many overlapping tools: subscriptions_list vs list_market_data_subscriptions, positions_list vs portfolio_list, account_summary/account_values/buying_power/cash_balances, and multiple contract resolution paths (contract_search, contract_details, contract_qualify, symbol_to_conid_mapping). An agent can often choose a plausible but non-canonical tool, especially across market data, news, and account queries.
Mostly snake_case, but verb/noun order and prefixing vary: list_market_data_subscriptions (verb_noun) alongside subscriptions_list (noun_list), contract_search (noun_verb), contract_details (noun), news_article (noun), and fa_groups_list (prefix_entity_list). The subscribe/unsubscribe pairs are consistent, but the overall convention is mixed.
84 tools is far beyond a well-scoped set; many are granular variants such as snapshot vs bulk snapshot, multiple stream subscribe/unsubscribe pairs, and several account summary views. This creates a large surface area with overlapping choices and raises selection cost.
Covers the core IBKR lifecycle broadly: contract discovery, market data, historical data, orders and bracket/OCO, positions/account, risk analytics, scanners, news, and FA admin. Some gaps exist (e.g., alerts, richer order-history filtering, and some specialty data), but major workflows are represented.
Maintenance
Related MCP Connectors
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.
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
OpenFinance gives any AI agent easy trading across every major market through one hosted MCP server. Trade crypto spot and perpetuals on Hyperliquid with market, limit and TWAP orders, leverage and margin control. Trade stocks, indices, commodities, forex and pre-IPO names as Hyperliquid HIP-3 perps. Trade Polymarket prediction markets with odds, order books, positions, PnL and trader leaderboards. Swap and bridge across 40+ EVM chains and Solana with Relay and Jupiter, find memecoins across 200+ chains, launch tokens on Robinhood Chain and Solana, and buy crypto with card, bank or UPI. Write actions are designed to ask for your confirmation first. Connect with OAuth (sign in to OpenFinance and approve) or an API key. Works with Claude, ChatGPT, Cursor, VS Code, Codex and any MCP client. No install. Home: https://openfinance.tech/agents · Docs: https://docs.openfinance.tech · GitHub: https://github.com/openfinance-tech/mcp
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
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
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Interactive Brokers through 48 tools for market data, orders, account management, and more, via the MCP protocol.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to trade on Interactive Brokers: check quotes, balance, positions, and execute buy/sell orders (including fractional shares by dollar amount) via the Client Portal API.2015MIT
- AlicenseAqualityCmaintenanceEnables LLM agents to interact with Interactive Brokers accounts for market data, account info, and order entry with built-in risk controls and a two-step confirmation flow.9MIT