2026-10-12
Using Ghidra with REA (MCP)
For native binaries, REA can drive an existing Ghidra install as an MCP-backed provider. REA does not download Ghidra or Java. You install those outside REA, export absolute paths, then doctor + setup.
Wiring table
| Item | Typical value | Check |
|---|---|---|
GHIDRA_INSTALL_DIR | Absolute path to Ghidra PUBLIC tree | Exists; version documented upstream (often 12.1.x) |
JAVA_HOME | Absolute path to 64-bit JDK 21+ | java -version matches |
| Doctor | doctor --provider ghidra --json | Native decompiler present for your OS |
| Setup | npx rea-agents@VERSION setup | Reconnect MCP client after |
export GHIDRA_INSTALL_DIR=/absolute/path/to/ghidra_PUBLIC
export JAVA_HOME=/absolute/path/to/jdk-21
npx -y [email protected] doctor --provider ghidra --json
npx -y [email protected] setup
macOS note (verifiable issue)
Ghidra 12.1.4 PUBLIC commonly ships native decompilers for linux_x86_64 and win_x86_64 only. On macOS, doctor may report native_decompiler missing; REA refuses to auto-build. Community recipe: build via Ghidra’s make ghidra_opt (or current equivalent) and copy into os/mac_x86_64/ / mac_arm_64/. Details: /faq/macos-ghidra-decompiler/ (issue #1994).
Windows note
Windows × Ghidra is a P0 wiring story — env vars, read-only PE/DLL posture, cold-start windows. See /docs/windows-ghidra/ and community lab /showcase/rea-lab/ (pins Ghidra 12.1.4 + rea-agents 6.4.0 in that repo’s narrative).
Large binaries
First queries can time out while Ghidra cold-starts. Timeouts, heap, and pre-import ideas: /docs/ghidra-large-binaries/. 6.4 also adds import language/compiler seeding before auto-analysis (release notes).
Steps
- Install Ghidra + JDK outside REA.
- Export absolute
GHIDRA_INSTALL_DIR/JAVA_HOME. - Run doctor; fix decompiler OS folder if needed.
- Setup + reconnect agent.
- Analyze only authorized targets with absolute paths.
Compliance
- BYO toolchain only; no proprietary plugin piracy.
- Authorized targets only — /compliance/.
- Mythbust: setup does not install Ghidra — /faq/setup-vs-providers/.
Sources
- Upstream installation docs in morluto/rea
- #1994 macOS decompiler
- 6.4.0 release Ghidra seeding notes
Path checklist
| Step | Check |
|---|---|
| JDK | Version Ghidra 12.x docs require |
| GHIDRA_INSTALL_DIR | Absolute, stable across shells |
| doctor | --provider ghidra --json green |
| MCP | Host config points at same install |
Compliance
Analyze only authorized programs. Teaching labs should seed challenges, not scrape production malware without containment policy.