Labsco
MCP SERVER

Ghidra MCP Server

by Bamimore-Tomi

Turns Ghidra into a reverse-engineering backend for an assistant — headless decompilation, then pseudocode, structs, enums and function prototypes on demand.

Runtime Debugging & Crash Analysis
Summary
Analysis happens once, then everything is a read.

The design splits the expensive part from the interactive part: Ghidra runs headless a single time and dumps the analysis to JSON, after which listing functions or pulling one function's pseudocode costs nothing. That is what makes it usable in a conversation. Two setup traps are called out explicitly and both bite people — Java must be 21 exactly, not 17 or 24, and the client may need the full path to `uv`.

What it is

A bridge between Ghidra's headless analyzer and an MCP client. It runs Ghidra over a binary, extracts the analysis into a JSON context file, and then serves that analysis as tools so a model can read decompiled code and data structures without driving the Ghidra GUI.

What you get
  • A setup call that runs Ghidra over a binary and builds the analysis context — `setup_context`
  • Function-level access: the full function list, and decompiled pseudocode for any one of them by name — `list_functions`, `get_pseudocode`
  • Data structures: every struct with the detail of any one, and every enum with its values — `list_structures`, `get_structure`, `list_enums`, `get_enum`
  • Function prototypes: the full list, and the return type and arguments of one — `list_function_definitions`, `get_function_definition`
  • Extraction that also carries names, parameters, variables, strings and comments out of the analysis
Requirements

Ghidra 11.3.1 or newer and Java 21 — Ghidra 11.3.1 rejects other Java versions, so `JAVA_HOME` must point at 21. Python 3.10 or higher, and the `mcp` CLI, installed with `pip install mcp`; register the server with `mcp install main.py`. Tested on macOS. If your client cannot find `uv` by name, the config needs its absolute path.