ib-mcp

v0.4.1
ib-mcp Checked 4 days ago Published 11 days ago

Model Context Protocol (MCP) server exposing Interactive Brokers data via ib_async + FastMCP

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

lookup_contract Lookup Contract

Look up contract details by ticker symbol and optional exchange/currency

ParameterTypeDescription
symbol *stringStock symbol (e.g., AAPL, GOOGL, etc.)
currencystringCurrency (e.g., USD, EUR, etc.)
exchangestringExchange (e.g., SMART, NYSE, NASDAQ, etc.)
sec_typestringSecurity type (e.g., STK, OPT, FUT, etc.)

ticker_to_conid Ticker To Conid

Convert ticker symbol to contract ID (conid)

ParameterTypeDescription
symbol *string
currencystring
exchangestring
sec_typestring

get_historical_data Get Historical Data

Retrieve historical market data

ParameterTypeDescription
symbol *stringStock symbol or conid
bar_sizestringBar size (e.g., '1 day', '1 hour', '5 mins')
currencystring
data_typestringData type (TRADES, MIDPOINT, BID, ASK, FEE_RATE, OPTION_IMPLIED_VOLATILITY)
durationstringDuration (e.g., '1 M', '1 Y', '5 D')
exchangestring
max_barsintegerMaximum number of bars to retrieve

search_contracts Search Contracts

Search for contracts by partial symbol or company name

ParameterTypeDescription
pattern *stringSearch pattern (symbol or company name)

get_historical_news Get Historical News

Retrieve historical news articles

ParameterTypeDescription
end_date *stringEnd date (YYYY-MM-DD)
start_date *stringStart date (YYYY-MM-DD)
symbol *stringStock symbol or conid
currencystringCurrency (e.g., USD, EUR, etc.)
exchangestringExchange (e.g., SMART, NYSE, NASDAQ, etc.)
max_countintegerMaximum number of articles to retrieve

get_article Get Article

Retrieve a full news article by ID and provider code

ParameterTypeDescription
articleId *stringArticle ID returned from historical news
providerCode *stringProvider code returned from historical news
as_markdownbooleanAttempt to convert XML content to markdown if the article is XML
truncateintegerOptional max length of returned text (0 for no truncation)

get_fundamental_data Get Fundamental Data

Retrieve fundamental data for a contract

ParameterTypeDescription
symbol *stringStock symbol or conid
currencystring
exchangestring
report_typestringReport type (ReportsFinSummary, ReportsOwnership, ReportsFinStatements, RESC, CalendarReport)

get_account_summary Get Account Summary

Retrieve account summary information

ParameterTypeDescription
accountstringAccount name (empty for all accounts)

get_positions Get Positions

Retrieve current positions

ParameterTypeDescription
accountstringAccount name (empty for all accounts)

get_contract_details Get Contract Details

Get detailed contract information including dividends and corporate actions

ParameterTypeDescription
symbol *stringStock symbol or conid
currencystring
exchangestring
sec_typestring

get_option_chain Get Option Chain

List option-chain parameters (expirations and strikes) for an underlying via reqSecDefOptParams. Strikes are sorted ascending, filtered to [min_strike, max_strike] (0 = unbounded), then paginated (max_strikes per page, default 20; strike_offset moves the window); the output says how to fetch the next page. When several trading classes are returned (e.g. SPX and SPXW), pass trading_class to page one chain. Read-only; no market-data subscription required.

ParameterTypeDescription
symbol *stringUnderlying symbol (e.g., XSP, SPX, AAPL)
currencystringCurrency (e.g., USD)
exchangestringUnderlying exchange (CBOE for indices, SMART for stocks)
max_strikenumberHighest strike (0 = no bound)
max_strikesintegerMax strikes per page
min_strikenumberLowest strike (0 = no bound)
sec_typestringUnderlying security type (IND, STK, ...)
strike_offsetintegerStrike pagination offset
trading_classstringFilter to a single option trading class (optional)

get_option_quotes Get Option Quotes

Fetch a batch of option quotes (bid/ask/last/close + model IV/delta) for a list of strikes on one expiry/right, via a brief streaming market-data subscription (delayed option data is not available as one-shot snapshots). Duplicate strikes are ignored; capped at 20 strikes per call to respect IB pacing. Defaults to delayed-frozen data (no OPRA subscription needed); set use_delayed=false for live data. Read-only.

ParameterTypeDescription
expiry *stringExpiration date, format YYYYMMDD
right *stringOption right: P (put) or C (call)
strikes *arrayStrike prices (max 20 per call)
symbol *stringUnderlying symbol (e.g., XSP)
currencystringCurrency (e.g., USD)
exchangestringOption exchange (e.g., SMART)
trading_classstringOption trading class (defaults to the symbol)
use_delayedbooleanUse delayed-frozen data (no OPRA needed)

get_index_quote Get Index Quote

Get the spot quote (last/close/bid/ask) for an index via a brief streaming market-data subscription, delayed by default (no market-data subscription needed), handy for strike-from-spot math. Read-only.

ParameterTypeDescription
symbol *stringIndex symbol or conid (e.g., XSP, SPX)
currencystringCurrency (e.g., USD)
exchangestringIndex exchange (e.g., CBOE)
use_delayedbooleanUse delayed-frozen data (no OPRA needed)