Reverse Engineer Anything Agents: Integration & Workflow - セットアップ

Reverse Engineer Anything Agents: Integration & Workflow

Learn how to connect AI coding agents to Reverse Engineer Anything through MCP servers and CLI workflows, with setup steps, tool maps, and...

2026-10-18
reverse engineer anything Wiki Team
Quick Guide
  • 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
Design Philosophy

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.

AgentConnection TypeBest ForKey Notes
Claude CodeMCP + skill installFull investigation tasksSubmit tasks, read Evidence results
CursorMCP client configProject-level analysisJSON config, prompt templates for tool calls
CodexCLI-firstScripted batch analysisDeterministic stages, agent interprets output
Gemini CLIMCP / CLIQuick triageGood for string and symbol sweeps
WindsurfMCP clientInteractive workflowsNarrow tool scopes recommended
DevinHosted + gatewayLong-running jobsUse bounded results and review gates
Minimum Permission Principle

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.

1

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.

2

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.

3

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.

4

Identify the Target

Start non-invasive: file type, architecture, imports, symbols, and strings. Build a target profile before opening any debugger.

5

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.

6

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.

Evidence Rule

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 RequestStrong RequestWhy 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.

Context Management

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.

SymptomLikely CauseQuick Fix
MCP server exits immediatelyWrong path, missing dependency, stdout pollutionRun the same command manually; redirect logs to stderr
Tools not discoveredRegistration after init, invalid schemaRegister tools during initialization; restart the client
Decompilation unreadableStripped binary, wrong architectureVerify format with file; load symbols; validate dynamically
Permission deniedPath outside approved rootMove inputs into the analysis workspace; check mount ownership
Analysis times outWhole-file scan for a narrow questionAdd range and max-result parameters; split into bounded jobs
Context window overflowFull disassembly in promptUse function-level queries; pass paths, not raw dumps
Cross-Platform Gotcha

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.

Related Articles