Setup Guide
Prerequisites
- Node.js v20+ (LTS)
- Interactive Brokers TWS or IB Gateway (latest stable)
- npm (comes with Node)
- pm2 for process management (
npm i -g pm2)
1. Clone and install
git clone https://github.com/dotcal604/market-data-bridge.git
cd market-data-bridge
npm install
cd frontend && npm install && cd ..
In TWS, go to Edit → Global Configuration → API → Settings:
Enable API
Check Enable ActiveX and Socket Clients
Set port
- Paper trading: Port
7497
- Live trading: Port
7496
Allow connections
Ensure Allow connections from localhost only is checked (or add your IP)
Disable read-only
Uncheck Read-Only API if you want to place orders
3. Start the bridge
Paper trading (recommended for testing)
Live trading
With pm2 (production)
pm2 start npm --name "bridge" -- run start:paper
pm2 save
The bridge starts on port 3001 with:
- REST API at
http://localhost:3001/api
- WebSocket at
ws://localhost:3001/ws
4. Start the frontend
Open http://localhost:3000 — the dashboard connects to the bridge automatically.
Add to your Claude Code MCP settings (.claude/settings.json or similar):
{
"mcpServers": {
"ibkr": {
"command": "node",
"args": ["dist/mcp/index.js", "--mode", "mcp"],
"cwd": "/path/to/market-data-bridge"
}
}
}
Paper vs Live
| Setting | Paper | Live |
|---|
| TWS port | 7497 | 7496 |
| Gateway port | 4002 | 4001 |
| npm script | start:paper | start:live |
| Risk gate | Bypassed | Active |
| Account | DUA482209 (CAD) | Your live account |
| Auto-flatten | Disabled | Configurable |
Always test on paper first. The risk gate is bypassed on paper ports so you can test freely without position limits blocking you.
Verify connection
Once running, check the connection:
- Frontend: Navigate to
/status — should show green “Connected” with your account ID
- MCP: Run the
get_status tool — should return ibkr.connected: true
- Bridge logs: Check pm2 logs for
IBKR connected message
Import historical data
TraderSync trades
Export your trades from TraderSync as CSV, then use the tradersync_import MCP tool or REST endpoint.
Holly AI trades
Export from Trade Ideas, then use holly_trade_import_file with the CSV path.