From 03564655fda1682e61bbf7055c3ef310c448cf28 Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 24 Jul 2026 01:56:47 +0200 Subject: deprecate: make the idalib worker the default backend; mark mcp path for removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opening a binary now defaults to our own idalib worker; the ida-pro-mcp HTTP supervisor path is deprecated (kept only for --db/attach and --backend mcp). * launch.py: --backend default resolves to worker for a fresh binary open, mcp for the attach modes (--db / bare `ida-tui`, which have no worker equivalent); explicit --backend or IDATUI_BACKEND still wins. Logs a deprecation notice when the mcp path is used. * Deprecation markers on client.py and server/patch_server.py; the ida-tui shell header and README now describe the worker as primary and note $IDATUI_WORKER_PYTHON. TODO tracks the removal checklist. No code deleted yet — the mcp fallback stays until the worker is proven on a box where idalib can spawn (pilot against --backend worker is the gate). Backend resolution matrix verified: `ida-tui bash`->worker, bare/`--db`->mcp, explicit flag/env honored. --- README.md | 9 +++++++-- TODO | 8 ++++++++ ida-tui | 12 +++++++----- idatui/client.py | 7 +++++++ idatui/launch.py | 18 ++++++++++++++---- server/patch_server.py | 4 ++++ 6 files changed, 47 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ac9c680..2789105 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ # ida-tui A minimal, keyboard-first (mouse-capable) **TUI frontend for IDA Pro**, built with -[Textual](https://textual.textualize.io/) and talking to the -[ida-pro-mcp](https://github.com/mrexodia/ida-pro-mcp) (idalib) server. +[Textual](https://textual.textualize.io/) and driving **idalib** (IDA headless). + +Opening a binary now spawns our own **idalib worker** — a private subprocess +talking a unix socket (`idatui/worker.py` + `WorkerClient`), ~50–100× cheaper per +call than the old transport. The +[ida-pro-mcp](https://github.com/mrexodia/ida-pro-mcp) HTTP path is **deprecated** +(kept behind `--backend mcp` / `--db` attach) and slated for removal. ## ⚠️ Status: not ready for public consumption diff --git a/TODO b/TODO index 2311d7d..4dd215e 100644 --- a/TODO +++ b/TODO @@ -4,6 +4,14 @@ bugs: current: +[~] DITCH ida-pro-mcp -> our own idalib worker (idatui/worker.py + WorkerClient) + [x] worker + WorkerClient (drop-in for IDAClient, same tool shapes) + [x] --backend {worker,mcp}; worker is now the DEFAULT for opening a binary + [x] worker spawns under the IDA python; {"result":...} wrapping to match MCP + [ ] run the pilot suite against --backend worker (blocked: idalib reaping here) + [ ] progress reporting during analysis (worker streams notes to the overlay) + [ ] once solid: delete client.py, server/patch_server.py, spawn.sh, and + launch.py's whole supervisor/ensure_server/lock-sweep dance [x] RPC endpoint for robot-spectator-ida -> progressssss diff --git a/ida-tui b/ida-tui index d1f4179..ed4db09 100755 --- a/ida-tui +++ b/ida-tui @@ -2,12 +2,14 @@ # Caveman launcher for the IDA TUI: # # ./ida-tui foo.elf # open a binary and drive it — that's it -# ./ida-tui # attach to the sole open session -# ./ida-tui --db # attach to a specific session +# ./ida-tui # attach to the sole open session (mcp) +# ./ida-tui --db # attach to a specific session (mcp) # -# It starts the ida-pro-mcp supervisor if it's down, recovers a binary left -# wedged by a crashed worker, opens/adopts the session, and drops you into the -# TUI. Uses the venv python that has textual (override with $IDATUI_PYTHON). +# Opening a binary now spins up our own idalib worker (a unix-socket subprocess; +# no HTTP, no supervisor). --db/attach still use the deprecated ida-pro-mcp +# path; pass --backend mcp to force it. Uses the venv python that has textual +# (override with $IDATUI_PYTHON); the worker auto-picks the python that has +# ida_pro_mcp (override with $IDATUI_WORKER_PYTHON). set -eu SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) diff --git a/idatui/client.py b/idatui/client.py index 3e5edb4..f39a10d 100644 --- a/idatui/client.py +++ b/idatui/client.py @@ -1,5 +1,12 @@ """Persistent, thread-safe client for the ida-pro-mcp (idalib) MCP server. +DEPRECATED. The default backend is now our own idalib worker (idatui.worker + +idatui.worker_client.WorkerClient), which talks a unix socket instead of HTTP and +is ~50-100x cheaper per call. This module (and the whole ida-pro-mcp +supervisor/HTTP path: server/patch_server.py, spawn.sh, launch.py's server +plumbing) is kept only for `--backend mcp` / --db attach and will be removed once +the worker is battle-tested. Prefer WorkerClient for new code. + This is the foundation the whole TUI stands on. Unlike the throwaway CLI in the ida-mcp skill (which re-does the MCP handshake and spins a fresh socket on every call), this client: diff --git a/idatui/launch.py b/idatui/launch.py index 15352d5..b2f0eec 100644 --- a/idatui/launch.py +++ b/idatui/launch.py @@ -189,12 +189,22 @@ def main(argv: list[str] | None = None) -> int: help="listen for RPC on this unix socket (puppeteer the TUI)") p.add_argument("--no-server", action="store_true", help="do not auto-start the supervisor if it's down") - p.add_argument("--backend", choices=("mcp", "worker"), - default=os.environ.get("IDATUI_BACKEND", "mcp"), - help="'mcp' (ida-pro-mcp supervisor, default) or 'worker' " - "(our own in-process idalib worker over a unix socket)") + p.add_argument("--backend", choices=("mcp", "worker"), default=None, + help="'worker' (our own idalib worker over a unix socket, the " + "default when opening a binary) or 'mcp' (deprecated " + "ida-pro-mcp supervisor; used for --db/attach)") args = p.parse_args(argv) + # Backend selection: explicit flag > IDATUI_BACKEND > worker for a fresh + # binary open, mcp for the attach modes (--db / bare `ida-tui`) which have no + # worker equivalent. The mcp path is deprecated and on its way out. + if args.backend is None: + args.backend = os.environ.get("IDATUI_BACKEND") or ( + "worker" if (args.binary and not args.db) else "mcp") + if args.backend == "mcp": + _log("using the deprecated ida-pro-mcp backend " + "(the idalib worker is default for opening a binary)") + binary = None if args.binary and not args.db: binary = os.path.abspath(os.path.expanduser(args.binary)) diff --git a/server/patch_server.py b/server/patch_server.py index ff14a09..6b69556 100644 --- a/server/patch_server.py +++ b/server/patch_server.py @@ -1,6 +1,10 @@ #!/usr/bin/env python3 """Inject idatui's extra ida-pro-mcp tools into the installed server package. +DEPRECATED along with the ida-pro-mcp transport: the default backend is now the +idalib worker (idatui/worker.py), which registers these same tools in-process and +needs no patching. Kept only for `--backend mcp`; slated for removal. + ida-pro-mcp lacks a few tools idatui needs. Rather than vendor/fork the server, we keep the tool source here and inject it (idempotently) into the installed ``api_types.py``. That module is imported by every worker -- cgit v1.3.1-sl0p