From 25590831d851e9e8ab8ff15b4122e01dfafd6d58 Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 10 Jul 2026 11:55:33 +0200 Subject: server: inject a del_type tool into ida-pro-mcp (enables struct delete) ida-pro-mcp has no delete-type tool, so struct-editor delete couldn't work. We don't vendor/fork the server; instead server/patch_server.py idempotently appends a del_type @tool to the installed ida_pro_mcp/ida_mcp/api_types.py, which every worker (python -m ida_pro_mcp.idalib_server) imports -> it self-registers on the shared MCP_SERVER. spawn.sh runs the patch before launching, so it's re-applied on each start (survives reinstalls) and tracked in-repo instead of hand-editing site-packages. del_type calls ida_typeinf.del_named_type(get_idati(), name, NTF_TYPE). After a supervisor restart, Program.delete_type() now succeeds; the struct editor's Del removes the type and the list refreshes. Verified end-to-end; pilot 84/84. --- spawn.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spawn.sh') diff --git a/spawn.sh b/spawn.sh index 4b0c63c..9db8310 100755 --- a/spawn.sh +++ b/spawn.sh @@ -1,5 +1,12 @@ #!/bin/sh # Start the ida-pro-mcp supervisor. IDA_MCP_MAX_WORKERS raises the ceiling on # concurrently-open binaries (default 4); idle workers self-exit and free slots. + +# Ensure idatui's extra server tools (del_type, needed by the struct editor) are +# present in the installed ida-pro-mcp. Idempotent; patches the api_types.py that +# the /usr/bin/python workers import. See server/patch_server.py. +/usr/bin/python "$(dirname "$0")/server/patch_server.py" || \ + echo "warn: server patch skipped (del_type may be unavailable)" + IDA_MCP_MAX_WORKERS="${IDA_MCP_MAX_WORKERS:-8}" \ uv run idalib-mcp --host 127.0.0.1 --port 8745 $(pwd)/bin/ls -- cgit v1.3.1-sl0p