LabscoMCP early access ↗
Bamimore-TomiMCP SERVER

Ghidra MCP Server

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

by Bamimore-Tomi ↗Runtime Debugging & Crash AnalysisCommunity

LABSCO 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. uv, which runs the server from your clone and installs its Python dependencies — the project's pyproject.toml asks for Python 3.12 or later, although the README's own list still says 3.10+. The README's alternative is registering it with mcp install main.py through the mcp CLI. Tested on macOS. If your client cannot find uv by name, the config needs its absolute path.

Setup effort

Follow the published steps — brew install --cask temurin@21