- Reverse Engineer Anything agents connect through two interfaces: CLI for terminal users and MCP Server for AI coding agents.
- Supported agents include Claude Code, Cursor, Codex, Gemini CLI, Windsurf, and Devin.
- Local-first analysis: REA runs evidence-driven investigation on your machine, never auto-copying source code.
- Best practice: use focused, narrow tool requests so agent conclusions stay verifiable.
- Setup entry point: one command bootstraps the environment and agent configuration.
What Reverse Engineer Anything Agents Do
Reverse Engineer Anything (REA) is an open-source reverse engineering toolkit built specifically for AI coding agents. Instead of forcing you to drive a disassembler by hand, REA exposes a CLI and an MCP Server so agents can analyze applications, websites, JavaScript, Electron packages, and native binaries while keeping every step local and evidence-backed.
The key idea is separation: the agent plans and interprets, while REA tools perform bounded operations such as symbol listing, string search, function inspection, cross-references, and tracing. The agent never gets unrestricted system access—it requests specific, scoped operations.
CLI Interface
- Terminal-first workflow
- Commands like analyze, inspect, search, xrefs, trace
- Ideal for scripted, repeatable pipelines
MCP Server
- Exposes tools to agent hosts
- Local communication, scoped schemas
- Tool calls cite concrete addresses and artifacts
Evidence Chain
- Every conclusion links to evidence
- Prevents guess-based agent answers
- Reports preserve reproducibility
REA's official project emphasizes local analysis, evidence chains, and reproducible investigation flows—not recovering original source code or automatically cloning software. Frame your agent prompts around investigation questions, not "rebuild this app."
Agent Integration Map
REA supports more than six coding agent integrations. The table below summarizes the main connection patterns and what each integration is best used for.
| Agent | Connection Type | Best For | Key Notes |
|---|---|---|---|
| Claude Code | MCP + skill install | Full investigation tasks | Submit tasks, read Evidence results |
| Cursor | MCP client config | Project-level analysis | JSON config, prompt templates for tool calls |
| Codex | CLI-first | Scripted batch analysis | Deterministic stages, agent interprets output |
| Gemini CLI | MCP / CLI | Quick triage | Good for string and symbol sweeps |
| Windsurf | MCP client | Interactive workflows | Narrow tool scopes recommended |
| Devin | Hosted + gateway | Long-running jobs | Use bounded results and review gates |
Whether you use MCP or CLI, expose only the directories and environment variables the analysis needs. Reject paths outside the approved workspace, require human confirmation before executing unknown binaries, and keep credentials out of the server's working directory.
For deeper background on the protocol side, the official Model Context Protocol architecture docs explain how hosts, clients, and servers communicate.
Step-by-Step: First Agent Investigation
Follow this sequence to take an agent from a clean environment to a validated, evidence-backed analysis.
Prepare an Isolated Environment
Use a disposable VM or container for unknown binaries. Record the target's SHA-256 hash, keep the original read-only, and separate analysis output from the source file.
Run Setup
Bootstrap REA with npx rea-agents@latest setup. The setup flow covers installation planning, agent configuration detection, and dependency checks—run rea doctor if anything fails.
Register the MCP Server
Add the server command and arguments to your agent host's MCP configuration. Use stdio for local development, pass only required paths, and confirm tools appear in the host after restart.
Identify the Target
Start non-invasive: file type, architecture, imports, symbols, and strings. Build a target profile before opening any debugger.
Request Focused Analysis
Ask the agent narrow questions—list symbols, find references to a string, decompile one function, trace a call path. Focused requests produce context you can actually validate.
Validate and Preserve Evidence
Reproduce important conclusions with the underlying tool, separate confirmed facts from open questions, and save the report with the target hash.
Treat the agent as an analysis assistant, not an authority. Any conclusion that cannot be tied to an address, function, string reference, or runtime trace belongs in the "open questions" list, not the findings.
Prompts and Workflows That Work
Prompt quality determines output quality. The comparison below shows weak versus strong request patterns for agent-driven analysis.
| Weak Request | Strong Request | Why It Works |
|---|---|---|
| "Reverse engineer this app" | "List imported functions and flag anything touching networking" | Maps to a specific tool call |
| "What does this binary do?" | "Find references to the string 'auth failed' and summarize nearby functions" | Produces verifiable evidence |
| "Explain this decompilation" | "Explain inputs, control flow, side effects, and uncertain inferences separately" | Forces evidence vs. inference separation |
| "Rebuild this feature" | "Trace the speed formula in this game loop, then propose a reconstruction" | Investigation before reconstruction |
A reliable explanation prompt structure covers five sections: inputs and outputs, control-flow summary, memory and state changes, external calls and side effects, and uncertain inferences—requiring the agent to cite the code pattern supporting every inferred purpose.
Never paste an entire disassembly into a prompt. Pass artifact paths and retrieve excerpts, keep a compact investigation ledger of names, addresses, and open questions, and let the agent request more context when needed.
Troubleshooting Common Agent Issues
Most agent integration failures fall into a few predictable categories. Diagnose by symptom first, then apply the narrowest fix.
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| MCP server exits immediately | Wrong path, missing dependency, stdout pollution | Run the same command manually; redirect logs to stderr |
| Tools not discovered | Registration after init, invalid schema | Register tools during initialization; restart the client |
| Decompilation unreadable | Stripped binary, wrong architecture | Verify format with file; load symbols; validate dynamically |
| Permission denied | Path outside approved root | Move inputs into the analysis workspace; check mount ownership |
| Analysis times out | Whole-file scan for a narrow question | Add range and max-result parameters; split into bounded jobs |
| Context window overflow | Full disassembly in prompt | Use function-level queries; pass paths, not raw dumps |
Shell syntax, executable formats, and path rules differ across Linux, macOS, and Windows. Resolve and validate paths against a configured workspace root with a cross-platform library, and record tool versions in every report.
Agent Integration Checklist:
- Isolated environment prepared with recorded target hash
- Setup completed and rea doctor reports no issues
- MCP server registered and tools visible in the agent host
- Filesystem scope limited to the analysis workspace
- Evidence ledger separating confirmed facts from open questions
FAQ
Q: What are Reverse Engineer Anything agents used for?
They are AI coding agents—such as Claude Code, Cursor, Codex, Gemini CLI, Windsurf, and Devin—that connect to REA through its MCP Server or CLI to analyze apps, websites, JavaScript, Electron packages, and native binaries with evidence-backed, local workflows.
Q: Does REA recover original source code?
No. The official project states REA focuses on local analysis, evidence chains, and reproducible investigation rather than restoring original source or automatically copying software. Outputs are structured findings, call relationships, and reconstruction guidance.
Q: MCP or CLI—which interface should I use?
Use MCP when your agent host supports tool discovery, since it enables scoped, schema-validated calls. Use the CLI for deterministic, scripted stages and batch pipelines. Many workflows combine both: CLI for stable operations, MCP for interactive agent reasoning.
Q: How do I stop the agent from guessing?
Use narrow requests mapped to individual tools, require every inferred conclusion to cite an address, string reference, or trace, and validate important findings yourself in the disassembler or debugger before recording them as confirmed.