bethington/ghidra-mcp
Ghidra MCP Server — 200+ MCP tools for AI-powered reverse engineering. GUI plugin + headless server, lazy tool loading, convention enforcement, batch operations, Ghidra Server integration, and Docker deployment.
Ghidra MCP Server – What It Is
Ghidra MCP is a production‑ready server that exposes Ghidra’s reverse‑engineering engine through the Model Context Protocol (MCP). In practice it lets you control a Ghidra installation (both GUI and headless) from external programs – including AI agents, CI pipelines, or custom scripts – via a rich, typed API.
Why It Matters
- Full‑featured API – 253 MCP “tools” cover everything Ghidra can do: reading and writing symbols, creating structures, running decompilation, performing P‑code emulation, attaching a live debugger, and even managing Ghidra Server projects.
- AI‑friendly – The server enforces naming‑convention rules and scoring logic so that large‑language‑model assistants can produce consistent, style‑compliant output without having to embed style guides in every prompt.
- Production‑grade – Atomic transactions, batch operations (cutting API calls by ~90 %), configurable timeouts, and graceful error handling make it safe for automated pipelines.
- Cross‑binary documentation – Functions are identified by SHA‑256 hashes; documentation written once can be propagated to newer versions of the same binary automatically.
- Headless & Docker‑ready – Can run without the Ghidra GUI, making it suitable for CI/CD, cloud services, or large‑scale batch analysis.
Core Features (as listed in the README)
| Category | Highlights |
|---|---|
| MCP Integration | Complete Model Context Protocol implementation; 253 tools; atomic transactions; batch mode; real‑time analysis. |
| Static Binary Analysis | Decompilation, call‑graph, cross‑references, completeness scoring, data‑flow (P‑code‑graph) analysis, struct/enum discovery, string extraction, import/export inspection, raw memory reads. |
| Dynamic Analysis (v5.4.0) | P‑code emulation via Ghidra’s EmulatorHelper; live debugger bridge (17 Java + 22 Python endpoints) supporting Windows (dbgeng) and Unix (gdb/lldb) debuggers, breakpoints, register/memory access, ASLR‑aware address translation. |
| AI‑Powered Workflows | Multi‑step function‑documentation pipeline (Hungarian notation, type audit, verification scoring), parallel batch documentation, orphaned‑code discovery, systematic structure discovery, cross‑version hash‑matching. |
| Automation & DevOps | Manage Ghidra scripts, multi‑program handling, bulk renaming/commenting/typing, headless server mode, Ghidra Server project/version control, programmatic analyzer control. |
| Convention Enforcement | Tiered rule system (auto‑fix, warn, reject) for naming, typing, and other conventions – useful for both human teams and AI agents. |
Getting Started (Quick‑Start Summary)
- Prerequisites – Java 21, Maven 3.9+, Ghidra 12.1.2, Python 3.10+ (uv recommended). Install system packages for your OS (Ubuntu/Debian, macOS Homebrew, Arch AUR packages are all documented).
- Clone & Pre‑flight
git clone https://github.com/bethington/ghidra-mcp.git && cd ghidra-mcp python -m tools.setup preflight --ghidra-path <path‑to‑ghidra> - Build & Deploy – The
tools.setuphelper installs Ghidra JARs into your local Maven repo, builds the extension, and copies it into Ghidra’sExtensions/folder.python -m tools.setup ensure-prereqs --ghidra-path <path> python -m tools.setup build python -m tools.setup deploy --ghidra-path <path> - Run the Bridge – The server can be started with three transport options:
- stdio (default) – ideal for AI tools that pipe JSON over stdin/stdout.
- streamable‑http – a lightweight HTTP endpoint (
/mcp) for web clients or browsers. - sse – deprecated older streaming mode.
uv run bridge-mcp-ghidra # stdio uv run bridge-mcp-ghidra --transport streamable-http --mcp-port 8081 - Configure Clients – Add the server to an MCP‑aware client (e.g., Claude Code, Autohand Code, or the open‑source MCP Inspector) by pointing it at the stdio command or the HTTP URL.
Typical Use Cases
- Automated reverse‑engineering pipelines – CI jobs that load a binary, run the documentation workflow, and export structured JSON for downstream analysis.
- AI‑assisted code understanding – Large‑language‑model agents query the server for decompilation, data‑flow, or rename suggestions, then write back consistent annotations.
- Live debugging assistance – An AI assistant can attach to a running process via the debugger bridge, step through code, and query P‑code state on‑the‑fly.
- Cross‑version knowledge sharing – Hash‑based documentation propagation lets you keep comments in sync across multiple releases of the same product.
Project Health Indicators (from the shields)
- Tests – CI runs on every push.
- Release – Versioned releases are published.
- OpenSSF Scorecard – Security audit score is publicly visible.
- Active community – Discussions, issue tracker, and sponsorship options are provided.
In short: ghidra‑mcp is a real, actively maintained bridge that turns Ghidra into a programmable AI‑friendly service. It is squarely in the frontier‑technology space of AI‑augmented reverse engineering and automated binary analysis.
Related
- Project
- Project
- Project
- Project
- Project