IBKR MCP TWS setup
Updated: 2026-10-05 22:11 CEST
canary mcp is a local IBKR MCP bridge for TWS. Claude Desktop, Claude Code, Cursor, Zed, Continue or another stdio MCP host talks to canary mcp, and canary reads account and market data from the Trader Workstation (TWS) API socket on the same machine.
Next to the bridge, the binary carries a daily brief, an advisory 19-rule rulebook and protection proposals, the desk functions an individual trader tends to want. Risk policy and statement reconciliation run in the terminal. Market data follows your IBKR subscriptions and is real-time where they cover it.
The same binary also works with IB Gateway. Choose TWS when Trader Workstation is already open for charting, manual supervision or daily trading context.
How Canary differs from simple Python IBKR bridges
Many IBKR MCP search results are small wrappers around a few TWS API calls. canary covers more ground.
- One Go binary with a local daemon, CLI, stdio MCP server, Claude Desktop MCPB, Claude Code plugin and Go TWS protocol library.
- A persistent local connection, so there is no reconnect for every assistant request.
- Read-only tools for status, account, positions, option strategies, technical evidence, broker reporting, FX and lending reports, borrowing and short-interest research, the retrospective Edge review, the daily brief, rulebook, a policy check, proposals, opportunities, settings, readiness and order-lifecycle reads.
- A read-only boundary in the published MCP server, with no tools for placing, modifying or cancelling orders.
- JSON-friendly CLI output for agent SDKs outside MCP and for shell automation.
TWS connection model
Claude / Cursor / Zed / other MCP host
-> canary mcp
-> local canary daemon
-> Trader Workstation API socket
-> Interactive Brokers account and market data
canary finds the standard local API ports on its own, TWS paper and live ports included. If auto-discovery does not suit your workstation, pin the host, port, client ID, account and TLS settings in local config.
Install
Claude Desktop users can install the MCP Bundle:
open https://github.com/osauer/canary/releases/latest/download/canary.mcpb
Shell, Cursor, Continue, Zed and generic MCP hosts can install the binary:
curl -fsSL https://raw.githubusercontent.com/osauer/canary/main/install.sh | sh
canary status
canary setup claude-desktop
Generic MCP config:
{
"mcpServers": {
"canary": {
"command": "/ABSOLUTE/PATH/TO/canary",
"args": ["mcp"]
}
}
}
The command must be an absolute path because MCP hosts usually do not expand ~ or read your interactive shell's PATH.
TWS prerequisites
In Trader Workstation, enable API socket access:
- Enable ActiveX and Socket Clients.
- Use the configured TWS API port, commonly
7497for paper and7496for live. - Keep TWS running on the same machine as
canary.
The published canary mcp server needs no TWS order-entry permissions, because it has no order-entry tools.
What to ask through MCP
- "What's in my IBKR account?"
- "Show my SPY exposure, including option deltas."
- "What does the technical picture for NVDA look like?"
- "Read today's brief and summarise what needs attention."
- "Which rulebook findings are failing or unknown right now?"
- "Are there open protection proposals for my positions?"
TWS or IB Gateway?
Use TWS when the desktop platform is already part of your workflow, and IB Gateway when you want a lighter, headless API process. The canary mcp tools are the same in both cases. Only the local IBKR process behind the API socket changes.
Related pages
- IBKR MCP server for the main MCP setup page.
- Interactive Brokers MCP server for the broader comparison and setup guide.
- IB Gateway MCP server for the headless Gateway path.
- MCP tools reference for exact tool names, parameters and descriptions.