Overview
MCGhidra is a two-part system that bridges NSA’s Ghidra reverse engineering framework with Model Context Protocol (MCP) clients.
What You Get
Section titled “What You Get”- 64 MCP tools across 12 categories (functions, data, structs, symbols, analysis, memory, variables, bookmarks, enums, namespaces, segments, Docker)
- 13 analysis prompts for guided RE workflows (malware triage, crypto identification, auth bypass hunting, protocol analysis, and more)
- 19 MCP resources for quick enumeration without tool calls
- Cursor-based pagination for handling binaries with 100K+ functions
- Server-side grep filtering before results hit the wire
- Docker provisioning with automatic port pooling and session isolation
Components
Section titled “Components”Ghidra Plugin (Java)
Section titled “Ghidra Plugin (Java)”A headless-compatible Ghidra script that starts an HTTP server inside the JVM. The server exposes a HATEOAS REST API — every response includes hypermedia links to related resources, so clients discover the API by following links rather than memorizing paths.
The plugin supports:
- Function listing, decompilation, and disassembly
- Memory reads and data type inspection
- Symbol renaming and annotation
- Cross-reference navigation
- Program metadata and analysis status
- Health checks for container orchestration
MCP Server (Python)
Section titled “MCP Server (Python)”A FastMCP server that wraps the REST API as MCP tools. It adds:
- Multi-instance management — connect to multiple Ghidra sessions, switch between them
- Docker provisioning — automatic container lifecycle with port pooling
- Raw firmware support — specify processor language, base address, and loader for binary blobs
- Session isolation — each MCP client gets its own session ID, preventing cross-talk
How the Pieces Connect
Section titled “How the Pieces Connect”┌──────────────┐ MCP ┌──────────────┐ HTTP ┌──────────────┐│ MCP Client │◄────────────►│ MCGhidra │◄────────────►│ Ghidra ││ (Claude, │ stdio │ Python │ REST API │ Plugin ││ Cursor, │ │ Server │ (HATEOAS) │ (Java) ││ etc.) │ │ │ │ │└──────────────┘ └──────────────┘ └──────────────┘ │ ┌─────┴─────┐ │ Docker │ │ Engine │ └───────────┘The MCP client communicates with MCGhidra over stdio using the Model Context Protocol. MCGhidra translates tool calls into HTTP requests against the Ghidra plugin’s REST API. When Docker is available, MCGhidra can also provision and manage Ghidra containers automatically.
Typical Workflow
Section titled “Typical Workflow”- Start Ghidra — either via Docker (
docker_auto_start) or by running the plugin in an existing Ghidra instance - Connect — the MCP server discovers the Ghidra instance via health checks
- Analyze — use MCP tools to decompile functions, read memory, navigate references
- Iterate — rename symbols, annotate findings, re-decompile to see updated output
Requirements
Section titled “Requirements”- Python 3.11+
- Ghidra 11.0+ (for the plugin)
- Docker (optional, for container management)