IBKR Portfolio Builder — Claude Code MCP server: setup and overview
Connects Interactive Brokers screeners and portfolio metrics to an agent for top-down equity research. Helps screen stocks and ETFs based on strategy tags.
Open on GitHubWhat IBKR Portfolio Builder does
The server connects clients to a sibling ib-gateway service via streaming HTTP at /mcp. It packages a structured catalog of 468 IBKR scan codes across 16 categories, labeled with 28 strategy tags such as dividends or value. Instead of guessing raw scanner codes, the agent queries mapped filters, applicable instruments, and inverse pairs.
The toolset includes nine read-only tools for portfolio metrics and OHLCV history, alongside five tools for news feeds and market scans. Order placement is blocked by design. The underlying ib-gateway runs with READ_ONLY_API=yes to prevent unattended trades.
Authentication supports both OAuth 2.1 with PKCE and a static bearer token. Client registrations and active sessions live in memory, meaning container restarts reset authorization state.
What it helps with
- screen US equities and ETFs using typed IBKR market scans
- review headlines and upcoming events across subscribed news providers
- inspect portfolio cash balances, open orders, and unrealized profit
- pull OHLCV historical price bars across various timeframes
Example prompts for the agent
- Run a scan for US large-cap value stocks with low debt and high dividend yield
- Check recent news headlines for candidate symbols using ib_news_for_symbol
- Show open positions and total cash value on my Interactive Brokers account
How to install IBKR Portfolio Builder
1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
claude mcp add --transport http ibkr-portfolio-builder-mcp https://{ibkr_mcp_host}/mcp1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
codex mcp add ibkr-portfolio-builder --url https://{ibkr_mcp_host}/mcp1Template address
The server address is a template: replace {…} or […] with your own values
2Config file
{
"mcpServers": {
"ibkr-portfolio-builder": {
"url": "https://{ibkr_mcp_host}/mcp"
}
}
}1Template address
The server address is a template: replace {…} or […] with your own values
2Config file
{
"servers": {
"ibkr-portfolio-builder": {
"type": "http",
"url": "https://{ibkr_mcp_host}/mcp"
}
}
}1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
gemini mcp add -t http ibkr-portfolio-builder https://{ibkr_mcp_host}/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about IBKR Portfolio Builder
How to install IBKR Portfolio Builder in Claude Code?
Run claude mcp add --transport http ibkr-portfolio-builder-mcp https://{ibkr_mcp_host}/mcp in your terminal, replacing the host placeholder with your deployment address.
What does IBKR Portfolio Builder do?
It exposes 468 Interactive Brokers screeners, news feeds, and read-only portfolio metrics to LLM clients for top-down equity research.
Can IBKR Portfolio Builder execute trades?
No, trading is disabled because ib-gateway operates in READ_ONLY_API=yes mode to prevent automated order execution.