Skip to main content
Glama
henrysouchien

Interactive Brokers MCP Server

ibkr-mcp

MCP server for Interactive Brokers Gateway — 7 tools for market data and account access via Claude.

Tools

Tool

Description

get_ibkr_market_data

Historical OHLCV bars for any contract

get_ibkr_positions

Current portfolio positions and P&L

get_ibkr_account

Account summary (balances, margin, NAV)

get_ibkr_contract

Contract lookup and details

get_ibkr_option_prices

Option chain pricing

get_ibkr_snapshot

Real-time quote snapshot

get_ibkr_status

IBKR Gateway connection diagnostics

Related MCP server: IBKR TWS MCP Server

Install

pip install interactive-brokers-mcp

Prerequisites

  • IB Gateway or TWS running

  • API access enabled in Gateway/TWS settings

  • Host/port/client ID matching your environment variables

Environment Variables

Variable

Default

Description

IBKR_GATEWAY_HOST

127.0.0.1

Gateway hostname

IBKR_GATEWAY_PORT

7496

Gateway port

IBKR_CLIENT_ID

1

API client ID

IBKR_TIMEOUT

10

Connection timeout (seconds)

IBKR_READONLY

false

Read-only mode

IBKR_AUTHORIZED_ACCOUNTS

Comma-separated account whitelist

IBKR_CACHE_DIR

Optional cache directory override

The package auto-loads .env from the package directory and parent.

Usage

Claude Code

claude mcp add ibkr-mcp -- ibkr-mcp

Or in ~/.claude.json:

{
  "mcpServers": {
    "ibkr-mcp": {
      "type": "stdio",
      "command": "ibkr-mcp"
    }
  }
}

Standalone

ibkr-mcp          # via installed entry point
python -m ibkr.server   # via module

License

PolyForm Noncommercial 1.0.0

Available Tools

6 tools
get_ibkr_accountC

Fetch IBKR account summary metrics.

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Fetch' which implies a read operation, but doesn't specify authentication needs, rate limits, error handling, or what 'summary metrics' includes. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose. This is an excellent example of conciseness, though it may be too brief for completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which reduces the need to describe return values), but no annotations and 0% schema coverage, the description is minimally adequate. It states what the tool does but lacks parameter details and behavioral context. For a simple read tool, it meets the baseline but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description doesn't mention the 'account_id' parameter at all, failing to explain its purpose, format, or that it's optional with a default of null. With 1 parameter and 0% coverage, the description adds no value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Fetch') and resource ('IBKR account summary metrics'), making the tool's purpose understandable. It doesn't explicitly differentiate from siblings like get_ibkr_positions, but the focus on 'summary metrics' provides some distinction. This is clear but lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like get_ibkr_positions or get_ibkr_snapshot. It doesn't mention prerequisites, context, or exclusions. The agent must infer usage from the name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ibkr_contractC

Fetch contract details or option chain metadata from IBKR.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYes
sec_typeNoSTK
info_typeNodetails
exchangeNoSMART
currencyNoUSD

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'fetch' which implies a read operation, but doesn't cover aspects like authentication needs, rate limits, error handling, or what the output contains. This is a significant gap for a tool with multiple parameters and no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and uses clear language, making it easy to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters, 0% schema description coverage, no annotations, but an output schema exists, the description is incomplete. It doesn't compensate for the lack of parameter documentation or behavioral context, though the output schema might help with return values. This is a minimal viable level for a read operation with some structural support.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning none of the 5 parameters are documented in the schema. The description only hints at 'contract details or option chain metadata', which loosely relates to 'info_type' but doesn't explain any parameters like 'symbol', 'sec_type', 'exchange', or 'currency'. It adds minimal value beyond the schema's structure.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'fetch' and the resource 'contract details or option chain metadata from IBKR', making the purpose understandable. However, it doesn't distinguish this tool from its siblings like 'get_ibkr_market_data' or 'get_ibkr_option_prices', which might have overlapping functionality, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_ibkr_market_data' and 'get_ibkr_option_prices', there's no indication of context, prerequisites, or exclusions, leaving the agent to guess based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ibkr_market_dataC

Fetch historical price series from IBKR Gateway.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolsYes
instrument_typeYes
start_dateNo
end_dateNo
what_to_showNo
contract_identityNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions fetching historical data but omits critical details like rate limits, authentication requirements, data format, pagination, or error handling. This is inadequate for a tool with multiple parameters and potential complexity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that is front-loaded with the core purpose. There is no wasted verbiage, making it highly concise and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, 2 required) and the presence of an output schema, the description is minimally adequate but incomplete. It covers the basic purpose but lacks details on usage, parameters, and behavior, which are crucial for effective tool invocation despite the output schema handling return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate by explaining parameters. It only vaguely implies 'historical price series' without detailing what 'symbols', 'instrument_type', 'what_to_show', or other parameters mean. This fails to add meaningful semantics beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Fetch') and resource ('historical price series from IBKR Gateway'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'get_ibkr_snapshot' or 'get_ibkr_option_prices', which might also retrieve market data, so it doesn't fully distinguish itself from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus siblings such as 'get_ibkr_snapshot' or 'get_ibkr_option_prices'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ibkr_option_pricesC

Snapshot bid/ask/greeks for multiple option strikes.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYes
expiryYes
strikesYes
rightNoP

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'snapshot' which implies a read-only operation, but doesn't clarify permissions, rate limits, data freshness, or whether this is a real-time or delayed feed. The description lacks critical behavioral context for a financial data tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 7 words, front-loading the core functionality. Every word earns its place by specifying what data is retrieved and for what instrument type, with no wasted verbiage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, financial data retrieval) and the presence of an output schema, the description is minimally adequate. However, with no annotations and poor parameter documentation, it leaves significant gaps in understanding the tool's behavior and proper usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for all 4 parameters, the description provides minimal parameter information. It mentions 'multiple option strikes' which relates to the 'strikes' array parameter, but doesn't explain the meaning of 'symbol', 'expiry', or 'right' parameters, nor their expected formats or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: retrieving snapshot data (bid/ask/greeks) for multiple option strikes. It specifies the verb 'snapshot' and resource 'option prices', though it doesn't explicitly differentiate from sibling tools like 'get_ibkr_snapshot' or 'get_ibkr_market_data' which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_ibkr_snapshot' or 'get_ibkr_market_data', nor does it specify prerequisites, exclusions, or appropriate contexts for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ibkr_positionsB

Fetch current IBKR positions and optionally account-level PnL.

ParametersJSON Schema
NameRequiredDescriptionDefault
include_pnlNo
account_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what data is fetched but lacks critical details: it doesn't specify if this is a read-only operation, whether it requires authentication, rate limits, or how data is returned (e.g., real-time vs. cached). The mention of 'optionally account-level PnL' hints at behavior but is insufficient for a mutation-free tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Fetch current IBKR positions') and adds optional functionality without waste. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no annotations, but with an output schema), the description is minimally adequate. The output schema likely covers return values, reducing the need for description details, but gaps remain in behavioral transparency and parameter guidance, making it incomplete for optimal agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal semantics: it implies 'include_pnl' controls PnL inclusion but doesn't explain its effect or default. It doesn't mention 'account_id' at all. With 0% schema description coverage and 2 parameters, the description partially compensates for one parameter but leaves the other undocumented, meeting the baseline for moderate schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Fetch') and resources ('current IBKR positions', 'account-level PnL'). It distinguishes the optional PnL feature but doesn't explicitly differentiate from sibling tools like 'get_ibkr_account', which might also provide account-related data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions the optional inclusion of PnL, implying usage when PnL data is needed, but provides no guidance on when to use this tool versus siblings (e.g., 'get_ibkr_account' for account details or 'get_ibkr_snapshot' for broader data). No exclusions or alternatives are specified.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_ibkr_snapshotC

Snapshot latest price for any security.

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYes
sec_typeNoSTK
exchangeNoSMART
currencyNoUSD

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Snapshot' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, provides real-time vs delayed data, or what happens with invalid symbols. The description lacks essential behavioral context for a financial data tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 5 words, with no wasted language. It's front-loaded with the core functionality and uses efficient phrasing. Every word earns its place in this minimal description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the existence of an output schema (which presumably documents return values), the description doesn't need to explain return format. However, for a financial data tool with 4 parameters and no annotations, the description is too minimal. It doesn't address authentication needs, data freshness, error conditions, or parameter semantics that would help an agent use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 4 parameters (1 required, 3 with defaults), the description provides no information about any parameters. It doesn't explain what 'symbol' represents, what 'sec_type' options exist beyond the default 'STK', or how 'exchange' and 'currency' affect the snapshot. The description fails to compensate for the complete lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Snapshot') and resource ('latest price for any security'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate this from sibling tools like 'get_ibkr_market_data' or 'get_ibkr_option_prices', which likely provide similar financial data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools related to market data and pricing, there's no indication of when this specific snapshot tool is appropriate versus other data retrieval tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedget_ibkr_account
    • First observedget_ibkr_contract
    • First observedget_ibkr_market_data
    • First observedget_ibkr_option_prices
    • First observedget_ibkr_positions
    • First observedget_ibkr_snapshot

TDQS

B3.3/5.0

Scored across 6 tools

Disambiguation4/5

Most tools have distinct purposes targeting different IBKR data types (account, contract, market data, options, positions, snapshot), but 'get_ibkr_market_data' and 'get_ibkr_snapshot' could cause confusion as both fetch price data with unclear boundaries between historical series and latest snapshots.

Naming Consistency5/5

All tools follow a perfect 'get_ibkr_' prefix pattern with descriptive snake_case suffixes, creating a highly predictable and readable naming convention throughout the set.

Tool Count5/5

Six tools is well-scoped for an Interactive Brokers data server, providing focused coverage of key financial data categories without being overwhelming or insufficient for the domain.

Completeness3/5

The toolset covers read operations well but lacks obvious trading or order management capabilities (create/update/delete orders) that would be expected for a full IBKR trading interface, creating notable gaps despite good data retrieval coverage.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    B
    maintenance
    Enables 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.
    14
    1,188 npm
    216
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables read-only access to Interactive Brokers data including contracts, market data, news, fundamentals, and portfolio/account information for LLM workflows and autonomous agents.
    17
    BSD 3-Clause