[PR #5883] [CLOSED] feat(ida): support the official Hex-Rays ida-mcp server #7099

Closed
opened 2026-11-01 21:45:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5883
Author: @L1nf
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: feat/ida-hexrays-official-server


📝 Commits (2)

  • 7b406f0 feat(ida): support the official Hex-Rays ida-mcp server
  • e9e62b6 fix(ida): prove hexrays identity, call edges, and failure evidence

📊 Changes

15 files changed (+1709 additions, -134 deletions)

View changed files

📝 docs/ida-provider.md (+33 -2)
📝 scripts/verify-real-ida.mjs (+61 -4)
📝 src/ida/IdaConfiguration.ts (+1 -1)
📝 src/ida/IdaContainment.test.ts (+11 -3)
➕ src/ida/IdaHexraysProtocol.test.ts (+236 -0)
➕ src/ida/IdaHexraysProtocol.ts (+413 -0)
➕ src/ida/IdaHexraysSession.test.ts (+312 -0)
📝 src/ida/IdaMcpConnection.ts (+1 -1)
📝 src/ida/IdaNativeProtocol.test.ts (+1 -1)
📝 src/ida/IdaOperationRunner.ts (+95 -23)
📝 src/ida/IdaProtocolValues.ts (+3 -0)
📝 src/ida/IdaProvider.ts (+12 -7)
📝 src/ida/IdaProviderCapabilities.ts (+14 -7)
📝 src/ida/IdaSessionClient.ts (+366 -85)
📝 tests/fixtures/idaMcp.ts (+150 -0)

📄 Description

Summary

Fixes #1416. Add support for the official Hex-Rays IDA MCP server through REA's existing IDA provider, with both attached GUI and headless analysis.

Change and scope

  • IdaHexraysProtocol.ts: translates existing IDA operations into read-only IDAPython queries that REA generates and sends through execute_python.
  • IdaSessionClient: GUI attachment checks the recorded input digest; headless opens a private copy of the target and pins every query to the returned worker instance.
  • "protocol": "hexrays" registration inside the existing IDA provider; existing registrations unaffected.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/ida adapter, from protocol selection in IdaConfiguration.
  • Contribution scope fit and linked maintainer decision: read-only extension of the existing provider. The maintainer decision on running generated Python is pending; #1416 is the proposal, not an approval.
  • CLI and MCP/tool-catalog contract: no new tools or schemas; existing IDA operations gain the official-hexrays profile, adding headless procedure_callers and resolve_containing_procedure.
  • Provider, bridge, target-format, or platform compatibility: HexRaysSA/ida-mcp 20261008.0.1; missing tools from the required catalog fail closed. Universal Mach-O rules unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: raw observations keep the generated query and its reply; a failed query stays distinguishable from a lookup miss.
  • Target selection, authority, upstream behavior, and cleanup: attached binds to the GUI database whose input digest matches and never saves or closes it; headless releases its worker through close_database and verifies the inventory.
  • Generated metadata, package, or installation impact: authored docs/ida-provider.md only.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: IdaHexraysProtocol.test.ts and IdaHexraysSession.test.ts cover the tool catalog, lifecycle schemas, envelope unwrapping, query translation, name injection, paging, GUI binding with rejection reasons, headless open/pin/release, cleanup retention on failure, and containment; capability, native, and containment tests updated, plus the official-server fixture seam.
  • Base reproduction or other evidence: source-derived. Before this change the official server failed initialization with missing_tools.
  • User-visible CLI/MCP output: profile official-hexrays; an attached binding failure lists each GUI database and why it was rejected, e.g. input digest mismatch.
  • Remaining proof gaps: Windows/Linux and other IDA versions unverified; maintainer scope approval pending.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:local -- src/ida/*.test.ts — 20 files, 359 passed.
  • npm run test:focused -- tests/boundary/mcp/idaTransport.test.ts tests/boundary/idaStartupDiagnostics.test.ts tests/composition/idaProvider.test.ts — 142 passed.
  • npm run test:local -- tests/conformance/readmeConsistency.test.ts — 5 passed.
  • npm run check:fast — typecheck and lint passed.
  • npm run verify:ida (hexrays, headless) — 9/9 checks including the string and xref oracles, on macOS arm64, IDA Professional 9.5, official ida-mcp 20261008.0.1, arm64 Mach-O variant of tests/conformance/ida/inventory.c.
  • npm run verify:ida (hexrays, attached) — 6/6 checks with the fixture open in the IDA GUI; the GUI database stayed open with its original input identity.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; the protocol is opt-in and existing behavior is unchanged.
  • Real Hopper/Ghidra, browser, or OS coverage: real IDA attached and headless on macOS arm64 only; Windows and Linux unverified.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: registrations are local stdio, and REA sends only its own generated queries through execute_python.

Author readiness

Human owner: @L1nf

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5883 **Author:** [@L1nf](https://github.com/L1nf) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/ida-hexrays-official-server` --- ### 📝 Commits (2) - [`7b406f0`](https://github.com/morluto/rea/commit/7b406f0e3d2d61527139cfb02b28c5b517ed724a) feat(ida): support the official Hex-Rays ida-mcp server - [`e9e62b6`](https://github.com/morluto/rea/commit/e9e62b6631537ee4717c65b36660f9c57638ae6e) fix(ida): prove hexrays identity, call edges, and failure evidence ### 📊 Changes **15 files changed** (+1709 additions, -134 deletions) <details> <summary>View changed files</summary> 📝 `docs/ida-provider.md` (+33 -2) 📝 `scripts/verify-real-ida.mjs` (+61 -4) 📝 `src/ida/IdaConfiguration.ts` (+1 -1) 📝 `src/ida/IdaContainment.test.ts` (+11 -3) ➕ `src/ida/IdaHexraysProtocol.test.ts` (+236 -0) ➕ `src/ida/IdaHexraysProtocol.ts` (+413 -0) ➕ `src/ida/IdaHexraysSession.test.ts` (+312 -0) 📝 `src/ida/IdaMcpConnection.ts` (+1 -1) 📝 `src/ida/IdaNativeProtocol.test.ts` (+1 -1) 📝 `src/ida/IdaOperationRunner.ts` (+95 -23) 📝 `src/ida/IdaProtocolValues.ts` (+3 -0) 📝 `src/ida/IdaProvider.ts` (+12 -7) 📝 `src/ida/IdaProviderCapabilities.ts` (+14 -7) 📝 `src/ida/IdaSessionClient.ts` (+366 -85) 📝 `tests/fixtures/idaMcp.ts` (+150 -0) </details> ### 📄 Description ## Summary Fixes #1416. Add support for the [official Hex-Rays IDA MCP server](https://github.com/HexRaysSA/ida-mcp) through REA's existing IDA provider, with both attached GUI and headless analysis. ## Change and scope - `IdaHexraysProtocol.ts`: translates existing IDA operations into read-only IDAPython queries that REA generates and sends through `execute_python`. - `IdaSessionClient`: GUI attachment checks the recorded input digest; headless opens a private copy of the target and pins every query to the returned worker instance. - `"protocol": "hexrays"` registration inside the existing IDA provider; existing registrations unaffected. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/ida` adapter, from protocol selection in `IdaConfiguration`. - Contribution scope fit and linked maintainer decision: read-only extension of the existing provider. The maintainer decision on running generated Python is pending; #1416 is the proposal, not an approval. - CLI and MCP/tool-catalog contract: no new tools or schemas; existing IDA operations gain the `official-hexrays` profile, adding headless `procedure_callers` and `resolve_containing_procedure`. - Provider, bridge, target-format, or platform compatibility: `HexRaysSA/ida-mcp` `20261008.0.1`; missing tools from the required catalog fail closed. Universal Mach-O rules unchanged. - Evidence, artifact, provenance, or reconstruction contract: raw observations keep the generated query and its reply; a failed query stays distinguishable from a lookup miss. - Target selection, authority, upstream behavior, and cleanup: attached binds to the GUI database whose input digest matches and never saves or closes it; headless releases its worker through `close_database` and verifies the inventory. - Generated metadata, package, or installation impact: authored `docs/ida-provider.md` only. Expected effects: - [x] Read existing files or captured data. - [x] Launch or attach to a process. - [x] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [x] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `IdaHexraysProtocol.test.ts` and `IdaHexraysSession.test.ts` cover the tool catalog, lifecycle schemas, envelope unwrapping, query translation, name injection, paging, GUI binding with rejection reasons, headless open/pin/release, cleanup retention on failure, and containment; capability, native, and containment tests updated, plus the official-server fixture seam. - Base reproduction or other evidence: source-derived. Before this change the official server failed initialization with `missing_tools`. - User-visible CLI/MCP output: profile `official-hexrays`; an attached binding failure lists each GUI database and why it was rejected, e.g. `input digest mismatch`. - Remaining proof gaps: Windows/Linux and other IDA versions unverified; maintainer scope approval pending. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:local -- src/ida/*.test.ts` — 20 files, 359 passed. - `npm run test:focused -- tests/boundary/mcp/idaTransport.test.ts tests/boundary/idaStartupDiagnostics.test.ts tests/composition/idaProvider.test.ts` — 142 passed. - `npm run test:local -- tests/conformance/readmeConsistency.test.ts` — 5 passed. - `npm run check:fast` — typecheck and lint passed. - `npm run verify:ida` (hexrays, headless) — 9/9 checks including the string and xref oracles, on macOS arm64, IDA Professional 9.5, official `ida-mcp 20261008.0.1`, arm64 Mach-O variant of `tests/conformance/ida/inventory.c`. - `npm run verify:ida` (hexrays, attached) — 6/6 checks with the fixture open in the IDA GUI; the GUI database stayed open with its original input identity. ## Compatibility, safety, and release - Breaking changes or migration steps: none; the protocol is opt-in and existing behavior is unchanged. - Real Hopper/Ghidra, browser, or OS coverage: real IDA attached and headless on macOS arm64 only; Windows and Linux unverified. - Package or release metadata impact: none. - Security, privacy, process, or containment review: registrations are local stdio, and REA sends only its own generated queries through `execute_python`. ## Author readiness Human owner: @L1nf - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7099
No description provided.