Labsco
MCP SERVER

IBKR Portfolio Builder

by adwiteeymauriya

Interactive Brokers screeners, news and account data shaped for top-down research — read-only by construction.

Equity & Fund Market Data
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_catalog` filters 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_catalog` for the numeric filters; `ib_screener_codes` for a raw substring search; `ib_screener` to run a scan
  • Account and orders — `ib_account_summary`, `ib_positions`, `ib_open_orders`, `ib_trades` over a `days_back` window that IBKR caps at about 7 days
  • Prices and contracts — `ib_price_snapshot`, `ib_price_history` for OHLCV bars at any duration and bar size, `ib_search_contracts`, `ib_contract_details` for industry, category and trading hours
  • News — `ib_news_providers`, `ib_news_for_symbol` for headlines across subscribed providers, `ib_news_article` for one body, which may carry a per-article fee
  • Order placement is deliberately absent: ib-gateway runs in `READ_ONLY_API=yes` mode, 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.