🔍 Ghidra MCP Server
This project lets you use Ghidra in headless mode to extract rich binary analysis data (functions, pseudocode, structs, enums, etc.) into a JSON file, and expose it to LLMs like Claude via Model Context Protocol (MCP).
It turns Ghidra into an interactive reverse-engineering backend.
🚀 Features
Decompiles a binary using Ghidra headless mode
Extracts:
Function pseudocode, names, parameters, variables, strings, comments
Data structures (structs), enums, and function definitions
Outputs to
ghidra_context.jsonMCP server exposes tools like:
list_functions(),get_pseudocode(name)list_structures(),get_structure(name)list_enums(),get_enum(name)list_function_definitions(),get_function_definition(name)
⚙️ System Requirements
macOS (tested)
Python 3.10+
Ghidra 11.3.1+
Java 21 (Temurin preferred)
MCP client (e.g. Claude Desktop)
mcp(install viapip install mcp)
🧪 Installation & Setup
✅ 1. Install Java 21 (REQUIRED by Ghidra 11.3.1)
Then set it:
Check it:
Should say: openjdk version "21.0.x"...
✅ 2. Install Ghidra
Download and extract Ghidra 11.3.1
✅ 3. Set up the project
✅ 4. Install the server via MCP CLI
This registers the MCP server so Claude or other clients can access it.
✅ 5. Run in dev mode (for testing)
This enables hot reload and developer logs.
🛰️ Tools Available
Tool | Description |
| Run Ghidra on a binary |
| All functions |
| Decompiled pseudocode |
| All structs |
| Details of a struct |
| All enums |
| Enum values |
| All function prototypes |
| Return type & args |
Sample Promot
Analyze the binary file located at <BINARY_PATH> using Ghidra installed at <GHIDRA_PATH>. First, set up the analysis context using both paths, then list all functions in the binary. Examine the main entry point function and provide a high-level overview of what the program does.
🧠 Common Issues & Fixes
❌ Ghidra fails with “unsupported Java version”
➡️ Fix: Install Java 21, not 17 or 24:
❌ spawn uv ENOENT (Claude Desktop can't find your UV binary)
➡️ Claude can't locate uv by name. To fix:
Run in your terminal:
Example output:
Open your Claude Desktop config file:
Update it like so:
Restart Claude Desktop. You should now see your custom MCP tools.
❌ The operation couldn’t be completed. Unable to locate a Java Runtime.
➡️ Fix: Java not installed or JAVA_HOME is unset. Follow setup instructions above.
📂 Project Structure
File | Purpose |
| MCP server with tools |
| Ghidra script that extracts JSON |
| Sample C binary |
| Compiled binary to test |
👨💻 Author
Related MCP Servers
- -security-license-qualityAn MCP server that allows LLMs to autonomously reverse engineer applications by exposing Ghidra functionality, enabling decompilation, analysis, and automatic renaming of methods and data.Last updated -6,169Apache 2.0
- -security-license-qualityA server that enables seamless integration of Binary Ninja's reverse engineering capabilities with LLM assistance, allowing AI tools like Claude to interact with binary analysis features in real-time.Last updated -109GPL 3.0
- -securityFlicense-qualityA server that provides remote binary analysis capabilities through IDA Pro's headless mode, allowing users to manage and manipulate functions, variables, and other binary elements via the Multi-Client Protocol.Last updated -21
- -securityAlicense-qualityAn MCP server that allows LLMs to autonomously reverse engineer applications by exposing Ghidra's functionality, including decompiling binaries, analyzing code, and renaming methods and data.Last updated -Apache 2.0