REA MCP: Configure rea-agents with Your Coding Agent
Reverse engineer apps, binaries and browser behavior with your coding agent.
REA MCP connects coding agents (Claude Code, Cursor, Windsurf, Cline) directly to application runtimes, Hopper/Ghidra decompilers, and Electron ASAR bundles via Model Context Protocol. Use REA to reverse engineer apps, binaries and browser behavior with your coding agent in seconds.
REA MCP Configuration Builder
npx rea-agents setup --client claude_code~/.claude/config.json (or run: npx rea-agents setup --client claude_code){
"mcpServers": {
"rea": {
"command": "npx",
"args": ["-y", "rea-agents@latest"],
"env": {
"REA_CLEAN_ROOM": "true",
"REA_MAX_DEPTH": "3"
}
}
}
}Architecture Choice: Full MCP Server vs. Skill-Only
Connects the agent directly to your local system. Allows active execution of bundle unpacking, Ghidra/Hopper native disassembly, and live process inspection.
npx rea-agents setupInstalls agent workflow instructions and domain reasoning prompts without registering a background MCP server or native disassembler bridge.
npx skills add morluto/rea --skill reverse-engineer-anythingWhy Reverse Engineering Needs MCP: Solving the Context Bottleneck
Every reverse engineer and security researcher knows the core challenge of modern software deconstruction: <strong>the scale of decompilation output dwarfs human and LLM context windows</strong>. A standard Electron application or native Mach-O/ELF binary contains millions of compiled instructions, tens of thousands of basic blocks, and hundreds of minified modules.
- Context Window Saturation:Dumping 50,000 lines of Ghidra pseudocode into ChatGPT/Claude chokes attention heads (O(N²) degradation).
- Severe Hallucination:When overwhelmed with raw assembly, LLMs invent function arguments, ignore jump conditions, and misattribute control flow.
- No Execution Feedback:Static text prompts cannot query cross-references (xrefs), verify memory addresses, or inspect live process state.
- Targeted Subgraph Queries:The agent never ingests the entire binary. Instead, it queries specific functions, symbols, and call sites on demand.
- Deterministic Evidence Ledgers:Every assertion made by the AI is backed by reproducible tool execution output stored in a structured JSON ledger.
- Continuous Hypothesis Loop:The agent formulates a hypothesis → calls REA via MCP → inspects results → pivots or refines analysis autonomously.
The Triad: Security Engineers ↔ Model Context Protocol ↔ AI Agents
The Model Context Protocol (MCP), open-sourced by Anthropic, is not a chat prompt—it is a <strong>bidirectional JSON-RPC protocol over standard input/output (stdio) or HTTP/SSE</strong>. In REA, it bridges three distinct layers:
+-------------------------------------------------------------------------+
| 1. Security Analyst / Reverse Engineer (Human) |
| High-level mission: "Trace IPC clipboard serialization in Notion.app" |
+-------------------------------------------------------------------------+
│
▼ (Natural Language Intent)
+-------------------------------------------------------------------------+
| 2. AI Reasoning Engine (Claude Code / Cursor) |
| Deconstructs mission into step-by-step hypothesis & tool call DAG |
+-------------------------------------------------------------------------+
│
│ [Model Context Protocol: stdio JSON-RPC]
│ ──► tools/call: { name: "rea_inspect_bundle", ... }
│ ◄── result: { status: "success", channels: [...] }
▼
+-------------------------------------------------------------------------+
| 3. REA MCP Server Runtime (rea-agents) |
| Local sandboxed orchestration layer driving decompilers and inspectors |
+-------------------------------------------------------------------------+
│ │ │
▼ ▼ ▼
[AST & JS Inspector] [Native Disassembler] [Dynamic Hooking & Tracing]
• Electron app.asar • Hopper (Unix socket) • Frida dynamic hooks
• Webpack AST graphs • Ghidra (headless Java) • LLDB memory breakpoints
• API route schemas • Hex-Rays IDA Pro • mitmproxy network capture
Deterministic functions executed locally on the analyst's machine: <code>rea function</code>, <code>rea xrefs</code>, <code>rea decompile</code>. The model requests analysis; REA executes and returns structured JSON.
Structured read-only artifacts: normalized Evidence Ledgers, AST symbol tables, and extracted IPC channel directories that the agent can read on demand.
Pre-packaged expert workflows: clean-room specification generation, vulnerability surface mapping, and cryptographic routine verification.
Here is what happens under the hood when Claude Code invokes REA to decompile a native function:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "rea_function",
"arguments": {
"path": "./dxball.exe",
"symbol": "SoundPanHelper",
"provider": "hopper"
}
},
"id": 104
}{
"jsonrpc": "2.0",
"result": {
"evidence_id": "ev_8a129f",
"entrypoint": "0x00401a20",
"instruction_count": 63,
"pseudocode": "int pan(int x, int w) { ... }",
"xrefs_in": ["0x00401050", "0x004018e0"],
"status": "success"
},
"id": 104
}REA's Four Core Engineering Subsystems
REA (rea-agents by morluto) translates high-level AI agent queries into concrete system executions across four specialized subsystems:
Engine 01:JavaScript & Electron ASAR Static AST Projection
Instead of unpacking multi-gigabyte Electron applications to disk, REA reads the ASAR header table in-memory, maps module graphs, resolves webpack runtime chunk boundaries, and identifies IPC message patterns (<code>ipcRenderer.send</code> / <code>ipcMain.handle</code>) without executing untrusted code.
Engine 02:Headless Native Disassembler Bridges (Hopper, Ghidra, IDA)
For native Mach-O, ELF, and PE binaries, REA communicates with disassemblers via dedicated IPC channels: a Unix-domain socket bridge (<code>hopper_bridge.py</code>) for instant Hopper queries, a headless Java script bridge (<code>ReaGhidraBridge.java</code>) for Ghidra, and an MCP proxy for live IDA Pro sessions. It parses <code>LC_DYLD_CHAINED_FIXUPS</code>, authenticated arm64e pointer chains, Objective-C class records (<code>_OBJC_CLASS_$_</code>), and Swift witness tables directly to extract function dossiers and CFGs.
Engine 03:Compact Evidence Projection (Evidence Reduction)
Raw binary disassemblies and AST traces can exceed 300MB. REA's Evidence Projection engine filters, normalizes, and compresses the raw output into a dense 10KB semantic slice (<code>inspect-analysis-view</code>). This eliminates context window exhaustion and ensures the LLM focuses purely on relevant decision nodes.
Engine 04:Clean-Room Model & Spec Synthesis
Once the agent validates its behavioral hypothesis against the Evidence ledger, it synthesizes clean-room specifications: standalone TypeScript interfaces, Rust data structures, or verified C functions—reconstructing interoperable logic without containing any proprietary binary bytecode.
How to Use REA: Dual-Mode Operation for Engineers
REA accommodates both conversational interactive exploration with AI agents and automated deterministic pipelines in CLI/CI environments:
Mode A: Interactive Agent Exploration
You steer; the AI agent drives. In Claude Code, Cursor, or Windsurf, the agent invokes REA MCP tools autonomously in the background while you converse in natural language.
npx rea-agents setupMode B: Headless Deterministic CLI
Direct terminal execution for scripting, batch triage, CI/CD audits, and headless decompilation pipelines without an interactive UI.
npm install -g rea-agentsrea function ./app main --provider hopper --jsonrea doctorExposed REA MCP Tools Catalog
Once connected through the Model Context Protocol, REA registers the following high-level tools with Claude Code, Cursor, and Codex:
| Tool Identifier | Target | Functionality |
|---|---|---|
rea_inspect_bundle | Electron / Web | Extracts ASAR header directory, IPC channels, and preload scripts. |
rea_extract_symbols | Native Binaries | Parses Mach-O/PE/ELF exports using Hopper, Ghidra, or IDA Pro bridges. |
rea_query_routes | API Schemas | Discovers private REST, GraphQL, and WebSocket endpoints from bundle strings. |
rea_generate_clean_spec | Clean-Room | Synthesizes clean-room TypeScript or Rust interfaces free of proprietary bytecode. |
Prompting Your AI Agent
After restarting your agent, ask it to investigate a target feature using the new REA tools:
Inspect the search architecture in the target application using REA, show the evidence behind how index ranking operates, and build a clean-room TypeScript interface for my project.