ib_account_summaryLABSCO SUMMARY
It gives the model the research vocabulary, not just the API.
Most IBKR servers expose lookups and leave the model guessing scan codes from training data; a typed, tagged catalog with inverse pairs and instrument applicability is what makes "find value screens for US stocks" a real query. Read-only is enforced at the gateway rather than by convention, which is the right place for it. Historical news entitlement is the usual paper-account limitation, and the tools say so rather than returning empty.
What it is
A remote MCP server for Interactive Brokers built around the research workflow rather than single lookups. It ships a typed catalog of IBKR's screeners so a model can pick strategies and run scans, alongside account, price and news tools. It runs as a Docker compose stack with ib-gateway beside it.
What you get
- Screening —
ib_scan_catalogfilters 468 IBKR scan codes across 16 categories, tagged with 28 strategy intent tags such as value, growth, quality, income and momentum, with inverse pairs precomputed and per-scan instrument applicability;ib_filter_catalogfor the numeric filters;ib_screener_codesfor a raw substring search;ib_screenerto run a scan - Account and orders —
ib_account_summary,ib_positions,ib_open_orders,ib_tradesover adays_backwindow that IBKR caps at about 7 days - Prices and contracts —
ib_price_snapshot,ib_price_historyfor OHLCV bars at any duration and bar size,ib_search_contracts,ib_contract_detailsfor industry, category and trading hours - News —
ib_news_providers,ib_news_for_symbolfor headlines across subscribed providers,ib_news_articlefor one body, which may carry a per-article fee - Order placement is deliberately absent: ib-gateway runs in
READ_ONLY_API=yesmode, so a misrouted tool call cannot place an order
Requirements
Docker, and an IBKR account — the compose stack runs ib-gateway as a sibling service, paper account in read-only API mode by default, and takes about 60 to 90 seconds to finish login on first start. Copy .env.example, set the gateway credentials plus LOGIN_PASSWORD, STATIC_BEARER_TOKEN and PUBLIC_BASE_URL, then docker compose up -d; the server is Streamable HTTP at /mcp. AUTH_MODE selects the mechanism: oauth for Claude.ai custom connectors, bearer for CLI clients and scripts, both by default. Claude.ai needs an HTTPS URL on the public internet, so put Cloudflare Tunnel or Caddy in front and make PUBLIC_BASE_URL match exactly. Sessions and tokens are in-memory only today and reset on container restart. MIT.
Setup effort
Build from source — git clone https://github.com/adwiteeymauriya/ibkr-portfolio-builder-mcp
USE CASES
Finding the right screen without guessing codes
Ask which scans exist for a strategy and instrument, and get the inverse codes alongside them.
Composing a candidate list from two screens
Run both scans with price and volume filters, then intersect the results.
Checking the news before shortlisting
Pull recent headlines for each survivor and read the article that looks material.
Reading your own position before acting on it
Pull the account summary and open positions with unrealised PnL alongside a current quote.
15 tools
Listed in project docs. Your client may show a different list.
ib_positionsib_open_ordersib_tradesib_price_snapshotib_price_historyib_search_contractsib_contract_detailsib_scan_catalogib_filter_catalogib_screener_codesib_screenerib_news_providersib_news_for_symbolib_news_articleBEFORE YOU INSTALL
What to know first
Tools you get
15 tools named in the project's documentation.
Requires
- TWS_PASSWORD in your environment
- TWS_USERID in your environment
INSTALLATION
Connect your client
Server setup
git clone https://github.com/adwiteeymauriya/ibkr-portfolio-builder-mcp
cd ibkr-portfolio-builder-mcp
cp .env.example .env
# edit .env: set TWS_USERID / TWS_PASSWORD (paper account), LOGIN_PASSWORD, STATIC_BEARER_TOKEN, PUBLIC_BASE_URL
docker compose up -dMCP Clients
Claude.ai
Settings → Connectors → Add custom connector → URL: <YOUR_SERVER_URL>/mcp → leave OAuth client id/secret blank (Claude.ai uses DCR). When Claude.ai opens the OAuth flow, you'll be prompted for LOGIN_PASSWORD.