Skip to main content
Glama

airgap-re

Analyze someone else's binary without handing it your privileges.

A security-first reverse-engineering MCP server. It gives an AI agent (Claude Code, Cursor, any MCP client)a small, read-only set of static RE tools over a proven stack — and runs every untrusted sample inside ano-network bubblewrap chamber that is never executed and whose isolation is proven in CI.

CI   M8ven Score   License Python Protocol Isolation

Why · What it is · Architecture · Guarantees · vs. REA · Install · Usage · Layout

Status — v0.1.0, early but gated. The surface is small and the API may still move, but nothing merges unless the isolation proof runs green in CI. We would rather ship a narrow tool whose guarantees are real than a broad one whose guarantees are hopes.

Scope / lawful use. For software you own, in-scope bug-bounty targets, CTFs, abandonware, and interoperability research permitted by law. Read-only by design: it never patches, rebuilds, or executes the target. See SECURITY.md and the Threat Model.


Why this exists

A wave of "AI reverse-engineers anything over MCP" tooling is genuinely useful — broad, convenient, well-packaged. The best-known of them, morluto/rea, covers an impressively wide surface (native, mobile, web, firmware, network, WASM, managed code). On raw breadth, REA leads, and this project does not try to match it.

This project makes a different, narrower bet: when you point an analysis tool at a hostile binary, the thing that matters most is isolation and auditability, not feature count. That is exactly the axis where broad orchestrators tend to be weakest — many run their dynamic/runtime paths with your own user privileges and no container at all.

The honest one-liner: REA optimizes for breadth; airgap-re optimizes for safety and auditability on the native-static lane, the lane where you actually touch untrusted code.

Put it another way. Most "analyze anything" tools ask what can I analyze? This one also asks what if the file bites back? A glovebox, not an open workbench. When the code is hostile, isolation wins.


What it is, precisely

A stdio MCP server (Python, one pinned dependency) that orchestrates a pre-existing RE stack:

Backend

Used for

Ghidra (headless)

per-function decompilation, function inventory

re_triage.py (capa · floss · sink-ranking · angr)

full static triage → ranked suspicious functions

r2 / rizin

fast symbol/import/string inventory

jadx / apktool (native-lib path)

Android APK native .so triage

bubblewrap (bwrap)

the isolation chamber for untrusted samples

It contains no RE logic of its own — it is a thin, auditable bridge. That is a deliberate feature: the whole server is small enough to read in one sitting (1,232 lines of own code, across 8 files, behind a single pinned dependency).

MCP tools exposed

Tool

What it does

re_capabilities

health check: which backends are present + versions

analyze_binary

full host-side static triage of a native binary (own/in-scope)

sandbox_analyze_binary

same triage, isolated (no network, cgroup caps) — for untrusted samples

sandbox_selftest

live proof of the isolation guarantees (no analysis target needed)

decompile_function

one function → C via Ghidra

list_symbols

fast r2/rizin inventory (functions / imports / strings)

analyze_apk

Android native-lib triage (sandboxed by default)


Architecture and trust boundary

The server holds no RE logic; it validates input, picks the trusted vs. sandboxed path, and shells out to a pre-existing backend stack. The sandbox boundary is the product — everything below bubblewrap is treated as hostile when the sample is third-party. An untrusted sample.bin goes in; the network, your ~/.ssh, and your privileges stay unreachable:

flowchart TD
    A[MCP client / AI agent] -->|tool call + path| B[re_mcp.server]
    B --> V{_validate<br/>abs path, is-file, size cap}
    V -->|invalid| E[JSON error]
    V -->|valid| P{trusted or untrusted?}

    P -->|own / in-scope| H[analyze_binary<br/>host-side triage]
    P -->|untrusted| S[sandbox_analyze_binary]

    subgraph chamber[bubblewrap chamber: --unshare-all, caps dropped, host read-only, cgroup caps]
        S --> T[re_triage.py]
        T --> G[Ghidra headless]
        T --> C[capa / floss]
        T --> N[angr optional]
    end

    H --> T2[re_triage.py host-side]
    B --> R[list_symbols: r2 / rizin]
    B --> D[decompile_function: Ghidra]
    B --> K[analyze_apk: native .so, sandboxed]

    T --> O[(ranked JSON<br/>via /out, host-temp)]
    chamber -.no network, no host write.-> X((egress impossible))

Full data flow, properties, and the trust boundary: docs/architektur.md.


The security guarantees, proven in CI

Every claim below has a test that fails the build if the guarantee breaks (tests/test_sandbox_isolation.py). The tests drive the shipped script (engine/sandbox_analyze.sh --selftest), not a hand-rolled command — so the guard covers the exact code the server runs. Removing --unshare-all from the shipped script turns the egress test red (verified by sabotage).

Guarantee

How it holds

Test

No egress

chamber runs bwrap --unshare-all → the network namespace is gone; an outbound connection is not blocked by policy, it is structurally impossible

test_shipped_script_blocks_egress

Host read-only

one throwaway /out (mktemp, removed on exit); writes to host paths fail

test_shipped_script_host_readonly

Resource caps

cgroup MemoryMax + MemorySwapMax=0 → a memory-bomb is OOM-killed, not the host

test_cgroup_memory_cap_enforced

Never executed

the pipeline is purely static; the sample is mounted read-only and analysed as data

(by construction)

Run the proof yourself:

pip install -e ".[dev]"
pytest -v          # includes the isolation proof (needs bubblewrap)

Non-goal (stated honestly). No custom seccomp-BPF filter is applied. bwrap applies none by default, and a wrong filter would silently break Ghidra/Python. Isolation here rests on namespaces (--unshare-all) + capability drop + read-only binds + cgroup limits — not on a syscall filter we cannot verify. A reviewed seccomp profile is possible future work, not a current claim.


Honest comparison vs REA

Not a knock on REA — it is static-by-default and leads on breadth. But even its static pass runs with your privileges and the network reachable. Different bets for different threat models.

The left column below is measured by benchmark/run_benchmark.py on this repo (see benchmark/REPORT.md). The right column is from REA's public repo / README and our 2026-10-12 tool review — external, not measured here.

Dimension

airgap-re

REA (morluto/rea)

Tool breadth

native + APK-native (focused)

very broad — REA leads

Untrusted-sample isolation

bwrap no-net + cgroup, never executed

no sandbox; runtime paths run with your user rights

Runtime dependencies

1 direct (mcp) / 28 transitive

~35 npm (per our review, different counting basis)

Setup footprint

local; does not write into your agent config

npx … setup writes into ~/.claude

Auditability

1,232 lines of own code, 8 files

large tree (~2,255 files, per our review)

License

MIT

MIT

If you need the widest possible toolbox on trusted inputs, REA is a strong choice. If you need to analyse someone else's binary without handing it your privileges, this is built for that.


Install

git clone https://github.com/NEO849/airgap-re
cd airgap-re
python -m venv .venv && . .venv/bin/activate
pip install -e .

# System tools (analysis backends — bring your own, like any RE tool):
#   bubblewrap (required for the sandbox), radare2/rizin, Ghidra (headless),
#   optional: capa, floss, jadx, apktool, angr venv.
sudo apt-get install -y bubblewrap radare2

Register with your MCP client (stdio). Example ~/.claude.json fragment:

{
  "mcpServers": {
    "airgap-re": {
      "type": "stdio",
      "command": "/path/to/.venv/bin/python",
      "args": ["-m", "re_mcp.server"],
      "env": { "REMCP_GHIDRA_HEADLESS": "/opt/ghidra/support/analyzeHeadless" }
    }
  }
}

All paths auto-discover from PATH and common install locations; override any via REMCP_* environment variables (see re_mcp/config.py). Confirm the wiring with the re_capabilities tool — it reports which backends are present and their versions.

Run with Docker. A Dockerfile is included and powers the Glama directory build:

docker build -t airgap-re .

Point your MCP client at the container instead of a local venv:

{ "mcpServers": { "airgap-re": {
  "type": "stdio", "command": "docker", "args": ["run", "-i", "--rm", "airgap-re"]
} } }

The image ships bubblewrap; real isolation inside a container needs a privileged runtime (--privileged or appropriate user-namespace settings), and the heavier backends (Ghidra, radare2/rizin) are host-installed as above — so for full-capability use the native pip install path is recommended. The image exists mainly so directory builds (e.g. Glama) are deterministic.


Usage

  1. re_capabilities — see what's available.

  2. list_symbols — fast overview, pick targets.

  3. analyze_binary (own/in-scope) or sandbox_analyze_binary (untrusted) — ranked triage.

  4. decompile_function — read the candidates.

Untrusted / third-party samples always go through sandbox_analyze_binary.


Project layout

re_mcp/        server.py (MCP tools) · config.py (env/auto-discovery)
engine/        re_triage.py · sandbox_analyze.sh · apk_native_triage.sh · ghidra_scripts/
tests/         test_validate.py · test_sandbox_isolation.py (the proof)
benchmark/     run_benchmark.py → REPORT.md
docs/          architektur.md (data-flow diagram) · readme/ (figures)

See docs/architektur.md for the data-flow and trust boundaries, THREAT_MODEL.md for what the sandbox does and does not defend against, and CONTRIBUTING.md to hack on it.


Built by NEO849. Issues and PRs welcome — start with CONTRIBUTING.md.

License &nbsp; Built with

MIT — see LICENSE.

Available Tools

7 tools
analyze_apkA

Android-APK-Triage: zieht native Libs (lib//.so) und jagt jede durch re_triage.py (Ghidra-Dekompilat -> capa/floss -> Sink-Rang). Deckt die native Schicht ab, die jadx/apktool nicht sehen. 'arch' optional, z.B. 'arm64-v8a' (sonst alle). 'sandbox' (Default True): läuft in der bwrap-Kammer (keine Ausführung, kein Netz). READ-ONLY, entpackt nur, führt NICHTS aus der APK aus. Eigene / in-scope APKs.

Inputs: path (required), arch, sandbox. Returns: result

analyze_binaryA

Volle statische Triage eines nativen Binaries (ELF/PE/Mach-O/.so) HOST-seitig via re_triage.py: Ghidra-Dekompilat -> capa-Capabilities -> floss-Strings (opt) -> Sink-Rang -> angr (opt). Liefert strukturiertes JSON (Top-verdächtige Funktionen, Capabilities, Strings). READ-ONLY. Für EIGENE / in-scope / CTF-Binaries. Fremde/untrusted Samples -> sandbox_analyze_binary. Kann mehrere Minuten dauern (Ghidra-Analyse).

Inputs: path (required), floss, symbolic. Returns: result

decompile_functionA

Dekompiliert GENAU EINE Funktion (nach Name oder Entry-Adresse 0x...) via Ghidra-headless -> C-Text + Signatur. 'function' z.B. 'main', 'check_license' oder '0x401160'. READ-ONLY. Kann einige Minuten dauern.

Inputs: path (required), function (required). Returns: result

list_symbolsA

Schnelles Inventar via r2/rizin (ohne Ghidra, Sekunden). kind = 'functions' | 'imports' | 'strings'. Gut für den ersten Überblick / um Ziele für decompile_function zu finden. READ-ONLY.

Inputs: path (required), kind. Returns: result

re_capabilitiesA

Health-Check: welche RE-Backends sind verfügbar (Ghidra/r2/capa/floss/angr/jadx/apktool/bwrap)

  • Versionen. Immer zuerst aufrufen, wenn unklar ist, was geht.

Inputs: no named parameters. Returns: result

sandbox_analyze_binaryA

Wie analyze_binary, aber ISOLIERT in einer bubblewrap-Wegwerfkammer: --unshare-all (KEIN Netz -> Egress strukturell unmöglich), keine Capabilities, cgroup Mem/PID/CPU-Limits, Host read-only, kein Host-Secret. Für UNTRUSTED / fremde Samples. Braucht bwrap (bubblewrap). READ-ONLY, Ziel wird NIE ausgeführt.

Inputs: path (required), floss. Returns: result

sandbox_selftestA

Beweist LIVE die Isolations-Garantien der AUSGELIEFERTEN Sandbox (keine Analyse eines Ziels): ruft exakt engine/sandbox_analyze.sh --selftest auf — denselben bwrap-Aufbau (inkl. --unshare-all) wie die echte Analyse. (1) Netz-Zugriff schlägt fehl, (2) Host-Schreiben scheitert. PASS/FAIL je Check.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools target clearly distinct operations (capability check, symbol inventory, single-function decompile, full triage, APK triage, sandbox selftest). The main ambiguity is analyze_binary vs sandbox_analyze_binary, whose names are nearly identical, but descriptions strongly disambiguate them via the host-vs-untrusted-sample rule. decompile_function also overlaps with the decompilation phase inside analyze_binary, though its single-target scope keeps it separable.

    Naming Consistency4/5

    Names follow a mostly predictable snake_case verb_noun pattern (decompile_function, list_symbols, analyze_binary, analyze_apk, sandbox_selftest). The sandbox_ prefix is used consistently as a qualifier. The only deviation is re_capabilities, which is a noun phrase with a domain prefix rather than a verb_noun action.

    Tool Count5/5

    Seven tools is well-scoped for a reverse-engineering server: each covers a distinct stage (backend discovery, fast inventory, targeted decompile, full host triage, sandboxed triage, sandbox verification, APK triage). No obvious redundancy or filler tools.

    Completeness4/5

    The surface covers the core static RE workflow: discover backends, inventory symbols, decompile a function, run full triage, and do so safely in a sandbox for untrusted samples including APKs. Minor gaps remain, e.g. no explicit cross-reference/call-graph query, no disassembly view, and no dynamic execution, but these are reasonable omissions for a static, read-only toolset.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables agents to reverse-engineer software across native binaries, managed code, Electron apps, websites, and live runtime behavior, returning findings linked to the evidence and limitations behind each conclusion. It also maintains a durable workspace where those behaviors can be inspected, questioned, compared against real execution, and exported as runnable handoffs.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to reverse engineer native binaries, JavaScript/Electron applications, .NET assemblies, web captures, EVM bytecode, and process behavior through a provider-neutral MCP interface. Every result is an evidence envelope stating what was observed, derived, unexamined, or unprovable, with all capabilities gated by a deterministic fail-closed policy engine.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents (and a matching CLI) to inspect native binaries, JavaScript/Electron apps, .NET assemblies, Go/Rust/WASM artifacts, EVM bytecode, SQLite databases, recorded crashes, and websites without source code, explaining how features work and returning the evidence and limitations behind each conclusion. Analysis runs locally, using optional Hopper, Ghidra, or IDA providers for native targets.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to reverse-engineer binaries they own or are authorized to test, exposing static analysis through Ghidra or IDA (functions, strings, xrefs, decompilation, disassembly, raw bytes) plus controlled Windows Sandbox runs. Every recorded claim must cite quoted evidence and addresses, which a verifier checks, and unexamined areas are reported as unknown rather than clean.
      12 PyPI
      Apache 2.0