Ghidra
by LaurieWired
A Ghidra plugin plus Python bridge that exposes decompilation, renaming, and cross-reference lookups as MCP tools, so an LLM can reverse-engineer a binary function by function.
Run the Python bridge (after installing the Ghidra plugin)
python bridge_mcp_ghidra.py --ghidra-server http://127.0.0.1:8080/
About
GhidraMCP pairs a Java plugin (installed inside Ghidra) with a Python bridge script that speaks MCP on one side and Ghidra's own HTTP interface on the other. Once both are running, an MCP client can list every function, class, import, export, and string in a loaded binary, pull decompiled C pseudocode or raw disassembly for any function by name or address, and trace cross-references in either direction, the same primitives a human analyst uses when manually working through a stripped binary.
It also exposes write operations, not just read-only inspection: an agent can rename functions, variables, and data labels, set a function's full prototype, assign a type to a local variable, and drop comments directly into the decompiler or disassembly view. That turns a typical LLM-assisted reverse engineering session into something closer to autonomous cleanup: the model renames `sub_401000` to something meaningful as it figures out what the function does, and those renames persist in the Ghidra project.
Key features
- Function-level decompilation to C pseudocode and raw disassembly by name or address
- Full-database enumeration: functions, classes, namespaces, imports, exports, segments, strings, and data labels
- Bidirectional cross-reference lookups (what calls this / what does this call)
- Write access to rename functions, variables, and data, and to set function prototypes and variable types
- Inline commenting in both the decompiler and disassembly views
- Works with any MCP client via a standalone Python bridge, not tied to one AI tool
Use cases
- Having an agent triage an unfamiliar stripped binary by systematically renaming functions as it identifies their purpose
- Pulling decompiled pseudocode for a suspicious function during malware analysis without leaving the chat
- Mapping call graphs and cross-references to understand how a vulnerability is reachable
- Batch-documenting a legacy binary by having an LLM add decompiler comments across many functions
Available tools
decompile_function
Converts a named function to C pseudocode.
rename_function
Changes a function's name in the Ghidra database.
list_imports
Lists imported symbols with pagination.
get_xrefs_to
Finds all references that target a given address.
set_function_prototype
Defines a function's full signature.
search_functions_by_name
Finds functions whose name matches a substring query.
Frequently asked questions
Do I need Ghidra open and a binary loaded for this to work?
Yes. The plugin runs inside a live Ghidra session with a program loaded; the Python bridge just relays MCP calls to Ghidra's local HTTP interface on port 8080 by default.
Can the agent permanently modify my Ghidra project?
Yes for renames, prototypes, types, and comments. Those writes persist in the Ghidra database, the same as if you'd made them by hand.