Skip to content

v2.2.1

Choose a tag to compare

@osauer osauer released this 19 Jul 18:16

The data flows out. Orders don't go in.

ibkr is a read-only interface to your Interactive Brokers account, reachable from a Go library, a shell CLI, a stdio MCP server (Claude Desktop, Cursor, Continue, Zed), and a Claude Code plugin. Hand it to an assistant, a cron job, a notebook, or your own service.

What's new in v2.2.1

  • Ghost orders no longer haunt the orders tab. Protective GTC stops that were cancelled or filled while the daemon wasn't listening used to stay "open" in the local order journal forever, showing up as stale "needs reconcile" rows. The daemon now asks the broker for its actual open-order list after each reconnect (and every 30 minutes) and closes journal rows the broker no longer reports as Closed (reconciled). Broker statements remain authoritative for the final fill-vs-cancel outcome.
  • A stop that no longer matches its position now defends itself. Sell part of a protected position outside the platform and the app flags the stop in red, explains that triggering it would open the excess in the opposite direction, sends one push notification, and offers a single guided fix: reduce the stop to the shares still held. Nothing adjusts automatically, and the daemon refuses the fix when position evidence is missing or has moved.
  • Releases no longer wait on a human for the registry step. The MCP Registry entry is published automatically by a GitHub Actions workflow when the release goes out; the release pipeline now verifies that publish happened instead of prompting for a device code. The interactive login remains only as a fallback when the workflow fails.

Claude Desktop MCPB

Download ibkr.mcpb from the Assets section below or from:

https://github.com/osauer/ibkr/releases/latest/download/ibkr.mcpb

Open the .mcpb file with Claude Desktop, drag it into Claude Desktop, or use Settings -> Extensions -> Advanced settings -> Install Extension. The bundle carries the local ibkr binary for macOS and Linux. Windows is not supported outside WSL because the daemon uses Unix-only primitives.

Shell and generic MCP install

curl -fsSL https://raw.githubusercontent.com/osauer/ibkr/main/install.sh | sh
ibkr setup claude-desktop

The first command picks the right binary for your platform, verifies its SHA-256, installs it to ~/.local/bin/ibkr, and adds that directory to your PATH if needed. On macOS it also clears the Gatekeeper quarantine flag. The second command writes the legacy MCP server entry into Claude Desktop's config; fully quit Claude Desktop and reopen.

If you only want the shell tool, stop after the first command and try:

ibkr account
ibkr quote AAPL
ibkr positions --by underlying

Prerequisite: a running IB Gateway 10.37+ or TWS (paper or live) on the same machine. The daemon auto-discovers it across the four standard ports.

See the README for the full feature menu and the troubleshooting matrix. Read-only by construction; the Safety section walks through the four guards.

⚠️ Broker-write capable build (ibkr-trading-* tarballs)

Everything above — the installer, the MCPB bundle, and the plain ibkr-v2.2.1-* tarballs — is read-only by construction: order transmission is not compiled in.

The ibkr-trading-v2.2.1-* tarballs are different: that binary can place, modify, and cancel orders with your broker once you configure the trading gates ([trading] mode plus a pinned gateway endpoint and account, cross-checked against the connected session; every write still needs a submit-eligible preview token). Only download it if you intend to trade through ibkr. Before enabling anything, read SECURITY.md and the trading preview guide, start against a paper account, and verify with ibkr trading status. Each release's order pipeline is exercised by an automated paper-trading round-trip before tagging.


Paranoid? Inspect the installer before running it

curl -fsSL https://raw.githubusercontent.com/osauer/ibkr/main/install.sh -o install.sh
less install.sh
sh install.sh

Doing something custom?

  • go install: go install github.com/osauer/ibkr/v2/cmd/ibkr@v2.2.1 (or @latest).
  • Different install dir: IBKR_INSTALL_DIR=/usr/local/bin sh install.sh. The installer won't touch your shell rc when you override; manage PATH yourself.
  • Manual download: pick a tarball or .mcpb from the Assets section below. Verify against SHA256SUMS.
  • Cursor / Continue / Zed / other local MCP clients: see Pick your path in the README for the JSON snippet (config file path differs per client).
  • Claude Code: /plugin marketplace add osauer/ibkr then /plugin install ibkr@ibkr inside any session.

Windows isn't supported. The daemon uses Unix-only primitives (setsid, flock, AF_UNIX sockets). WSL works.


Added

  • Broker open-order snapshot reconcile: reqAllOpenOrders-based sweep that appends terminal reconciled-absent events for journaled orders absent from a complete snapshot. Fail-safe by construction: no complete snapshot means no action, and only rows in the connected account/mode scope, with a broker PermID, and quiet past a grace window are eligible. The sweep never sends a broker write. The snapshot request is its only wire interaction, and the append-only journal is never rewritten.
  • Protective-stop mismatch alerts and a guided fix. When a close-only stop no longer matches the position (for example after selling part of it in TWS), the daemon classifies the consequence (full or partial opposite-direction entry on trigger) and the app shows a red critical row with plain-language risk copy plus a single allowed action: reduce the stop to exactly the held quantity through the normal preview-and-confirm flow (flat positions keep Cancel as the offered fix). The daemon enforces the same reduce-only constraint server-side against a fresh positions read at both preview and confirm, failing closed when position evidence is unavailable or changed. A critical push notification fires once per occurrence via the existing alert path, debounced across two polling passes so transient zeroed position reads can never page the trader, and redacted like canary pushes (no symbols or quantities on the wire).

Changed

  • The release pipeline's registry leg is verify-first: after the GitHub release is created, it polls the public MCP Registry for the exact released version (about four minutes, reporting the Actions registry-publish run status while it waits) and succeeds without operator interaction once the workflow-published entry appears. Only on timeout does it fall back to the previous interactive device-code login and direct publish. Standalone make registry-publish keeps its direct login+publish behavior as the manual heal, and the release preflight reminder now notes a browser is needed only if the automated publish fails.

Fixed

  • A cancel request no longer downgrades an order's journaled transmit state, so a missed cancel confirmation can no longer wedge the row permanently write-ineligible ("open" yet not cancel-eligible); the cancel simply stays retryable until broker truth arrives.
  • Position/order matching now accepts the wire's "STOCK" security-type label as equivalent to "STK". Protective orders journaled without a contract id (hand-previewed drafts, especially non-US routings) previously matched no position and were falsely classified as uncovered, which mislabeled healthy stops as critical and blocked their legitimate modifies. Caught by the paper-account rehearsal on the first real modify attempt.
  • Broker open-order snapshots cannot mint phantom journal rows: unmatched openOrder/orderStatus callbacks (e.g. manual TWS orders) are observed but not adopted into the daemon's order journal.
  • ibkr status background-task line for open orders now leads with the current account/mode count (matching the orders tab) and discloses any off-scope remainder as (+N other scope) instead of silently reporting a different total.

Removed

  • The Codex delegation lane (agent development process, no product change): the implementation-lane hook, delegation runner, waiver valve, and lane policy are retired, and agent sessions implement inline again. The lane and its reactivation runbook are archived in docs/archive/codex-delegation-lane.md.