symgraph/GhidrAssistMCP
An native MCP server extension for Ghidra
GhidrAssistMCP – AI‑enabled bridge for Ghidra
What it is
GhidrAssistMCP is a Ghidra extension that runs a Model Context Protocol (MCP) server inside the Ghidra application. The server exposes Ghidra’s reverse‑engineering functions (listing functions, getting disassembly, editing comments, running analysis, etc.) through a clean, HTTP‑based API that AI assistants or other automation tools can call.
Why it matters for AI/ML
- Standardised API – By speaking MCP, external LLM‑based assistants (e.g., the companion GhidrAssist client) can ask Ghidra questions and receive structured JSON answers without needing to embed Java code.
- Tool catalog – 100 explicit “tools” are defined with input schemas and read/write annotations, making it easy for an LLM to discover what operations are available and how to call them.
- Async & caching – Long‑running analyses run as background jobs and results are cached, which is useful when an LLM iteratively refines its queries.
- Multi‑program & headless support – The server works both in the GUI and in Ghidra’s
analyzeHeadlessmode, so AI pipelines can run fully automated analyses on many binaries.
Core features (as described in the README)
| Feature | What it does |
|---|---|
| MCP Server Integration | Implements the official MCP Java SDK (v2.0.1) and exposes two HTTP transports – Server‑Sent Events (SSE) and a streamable JSON endpoint. |
| Explicit tool catalog | 100 named tools (93 enabled by default) covering project management, program inspection, disassembly, decompilation, comments, types, analysis options, and more. |
| Resource templates & prompts | Pre‑defined MCP resources for program metadata, functions, strings, imports/exports, and segments; plus 7 ready‑made analysis prompts for common RE tasks. |
| Result caching & async tasks | Repeated queries hit a cache; long‑running operations return a task ID that can be polled or cancelled. |
| Multi‑program & focus awareness | Handles several open programs, automatically uses the program window that has focus, and lets clients specify a program_name. |
| Shared runtime & UI | One server instance is owned by the Ghidra project manager; every CodeBrowser window gets a view that shares configuration and logs. |
| Headless mode | Can be started from analyzeHeadless so AI pipelines can interact with Ghidra without a GUI. |
| Configurable UI | A Ghidra window (Window → GhidrAssistMCP) lets users enable/disable tools, change host/port, and watch live request/response logs. |
How you would use it
- Install the extension (ZIP) via File → Install Extensions in Ghidra (requires Ghidra 12.0/12.1 and Java 25+).
- Start Ghidra – the MCP server launches automatically when the project manager opens.
- Configure host/port if needed and enable the tools you want.
- Call a tool from any MCP‑compatible client (e.g., the companion GhidrAssist UI or a custom script):
The server replies with a JSON list of functions.{"method":"tools/call","params":{"name":"list_functions","arguments":{"program_name":"/binaries/example"}}} - Run headless – use Ghidra’s
analyzeHeadlesslauncher with a pre‑script that starts the server, then let an external AI service query the endpoints (/mcpor/sse).
Who might benefit?
- Security researchers building LLM‑driven binary analysis assistants.
- Automation pipelines that need program‑level information (functions, CFGs, decompilation) without embedding Ghidra’s Java API.
- Educational tools that let students explore reverse engineering via a web‑based UI powered by an LLM.
Limitations & considerations (from the docs)
- The server runs on a single port (default 8080); the port must be free.
- Some powerful operations (
import_file,export_program, script execution) are disabled by default for safety. - The extension depends on the MCP Java SDK 2.0.1; newer MCP revisions may need an updated SDK.
- In headless mode the server stays alive only while the JVM is running; a
completion_filecan be used to shut it down cleanly.
All information above is taken directly from the repository’s README; no additional features have been inferred.
Related
- Project
- Project
- Project
- Project
- Project