GhidraMCP is a Model Context Protocol (MCP) server for Ghidra, designed to enable large language models (LLMs) to autonomously reverse engineer applications. Through a Ghidra plugin and a Python MCP client, it exposes Ghidra's core functionality to MCP clients.
Purpose: GhidraMCP is mainly used for automated reverse engineering tasks, such as decompiling and analyzing binary files, automatically renaming methods and data, and listing methods, classes, imports, and exports. It allows LLMs to interact with Ghidra through the MCP protocol, thereby performing complex reverse engineering operations without manual intervention.
Main capabilities:
- Decompile and analyze binary files in Ghidra.
- Automatically rename methods and data.
- List methods, classes, imports, and exports.
- Support headless mode (without the Ghidra GUI), importing and analyzing binary files through PyGhidra.
Usage:
- Install Ghidra 12.1.4.
- Install uv (or Python 3.10+, and use pip install git+https://github.com/LaurieWired/GhidraMCP)。
- Download the latest release package from this repository, which contains the Ghidra plugin and the Python MCP client. Import the plugin into Ghidra: select File -> Install Extensions, click the + button, select the downloaded ghidra_12.1.4_PUBLIC_<date>_GhidraMCP.zip, and make sure GhidraMCPPlugin is enabled in File -> Configure -> Developer.
- Optional: configure the port in Ghidra via Edit -> Tool Options -> GhidraMCP HTTP Server.
- Configure the MCP client: most clients accept JSON configuration, and the server IP and port are configurable, defaulting to localhost:8080. For clients that connect via URL, first run the MCP server yourself, then add http://127.0.0.1:8081/mcp as a remote server.
- Example configuration: in VS Code, run MCP: Add Server from the Command Palette, or add the configuration in .vscode/mcp.json; in Claude Code, run the corresponding command.
- Headless mode: ghidra-mcp can use PyGhidra to import and analyze binary files by itself, without the Ghidra GUI. It requires Python 3.10–3.13, installing the GhidraMCP extension in Ghidra (or specifying --extension-jar /path/to/GhidraMCP.jar), and setting GHIDRA_INSTALL_DIR to the Ghidra 12.1.4 directory. The same command and parameters can be used in the client configuration. Add --project DIR to preserve the project. On macOS, the decompiler must be built by running support/gradle/gradlew buildNatives from the Ghidra directory.
Building from source:
- Set GHIDRA_INSTALL_DIR to the Ghidra 12.1.4 directory.
- Build the extension using Gradle (Java 21): cd extension && $GHIDRA_INSTALL_DIR/support/gradle/gradlew buildExtension.
- The generated zip file is in extension/dist/ and contains the built Ghidra plugin and its resources.
- The Python MCP server can be run with uv run ghidra-mcp and tested with uv run pytest.
Applicable scenarios: suitable for security research, malware analysis, vulnerability discovery, and other fields that require reverse engineering binary files, and especially suitable for teams or individuals who want to use LLMs to automate analysis workflows.
Limitations: depends on Ghidra 12.1.4 and a Python 3.10+ environment; headless mode requires additional configuration of PyGhidra and GHIDRA_INSTALL_DIR; on macOS, the native decompiler must be built. Specific feature details, charging status, pricing, platform compatibility, etc. are not provided in the materials.