Ghidra integration for the Model Context Protocol (MCP)
- Analyze RTTI - Microsoft RTTI structure analysis with type detection and demangling
- Decompile Code - Function decompilation to C-like pseudocode with P-code analysis
- Demangle Symbols - C++ symbol demangling with multiple format support
- Script Guidance - Provides guidance on using Ghidra scripts like DemangleAllScript for advanced demangling
- Manage Data Types - Create and update structures, enums, unions, typedefs, and categories
- Manage Functions - Create, update, and manage function definitions and prototypes
- Manage Memory - Read/write bytes, manage segments, and analyze memory layout
- Manage Project - Navigate addresses, manage bookmarks, and control project settings
- Manage Symbols - Create, rename, and organize symbols with namespace support
- Read Data Types - Browse and query program data types with filtering and pagination
- Read Functions - Enumerate functions with detailed metadata and filtering
- Read Listing - View disassembly and data from program listing with address, range, or function-based viewing
- Read Memory Blocks - View memory segments, permissions, and properties
- Read Symbols - Browse symbols with type and namespace filtering
- Delete Bookmark - Remove bookmarks by address or category
- Delete Data Type - Remove data type definitions from the program
- Delete Function - Remove function definitions and associated data
- Delete Symbol - Remove symbols by name, ID, or address
- List Analysis Options - View available analysis options and settings
- List Programs - Discover open and closed programs in the project with pagination and filtering
- Find References - Locate code and data references with pagination support
- Search Memory - Pattern search with hex, string, binary, and regex support
- Batch Operations - Execute multiple tool operations in a single transaction with automatic rollback on failure
- Undo/Redo - Transaction-based undo/redo operations
- Download the latest release
zipfile from the Releases page. - In Ghidra, go to
File->Install Extensions.... - Click the
+button (Add extension) in the top right corner. - Navigate to the downloaded
zipfile and select it. - Ensure the
GhidraMCPextension is checked in the list and clickOK. - Restart Ghidra.
Configure the MCP server settings (see 'Configuration' below) and ensure your MCP Client is configured to connect (see 'Configuring an MCP Client' below).
Warning
Script Error Dialogs: Some tools that execute Ghidra scripts may trigger
GUI error dialogs via Msg.showError. These dialogs must be manually
closed, or the server will hang and become unresponsive.
Tip
Missing fileName Parameter: When tools request a fileName parameter, use
the list_programs tool to see available programs. Most tools provide this
context automatically on failed calls.
The GhidraMCP server can be configured through Ghidra's application-level settings:
- In Ghidra, go to Browser β Edit β Tool Options.
- In the left panel, expand Miscellaneous and select GhidraMCP HTTP Server.
- Configure the following options:
- Server Port: The port number for the MCP server (default: 8080)
- Auto-start Server: Whether to automatically start the server when Ghidra launches
- Click OK to save your settings.
- Clone the repository:
git clone https://github.com/themixednuts/GhidraMCP.git
- Ensure you have Apache Maven and JDK 21 or later installed.
- Copy the following required JAR files from your Ghidra installation directory
into the
lib/directory (create it if needed):Ghidra/Features/Base/lib/Base.jarGhidra/Features/Decompiler/lib/Decompiler.jarGhidra/Framework/Docking/lib/Docking.jarGhidra/Framework/Generic/lib/Generic.jarGhidra/Framework/Project/lib/Project.jarGhidra/Framework/SoftwareModeling/lib/SoftwareModeling.jarGhidra/Framework/Utility/lib/Utility.jarGhidra/Framework/Gui/lib/Gui.jarGhidra/Features/MicrosoftCodeAnalyzer/lib/MicrosoftCodeAnalyzer.jarGhidra/Features/MicrosoftDemangler/lib/MicrosoftDemangler.jarGhidra/Features/MicrosoftDmang/lib/MicrosoftDmang.jar
- Build the project using Maven:
mvn clean package
- The installable
zipfile will be in thetarget/directory (e.g.,target/GhidraMCP-0.5.0.zip). Install it using the steps above.
Tip
CI Test JAR: The test JAR with dependencies is only built when explicitly requested. To build it locally for testing:
mvn clean package -P ci-testsConfigure your MCP client to connect to http://127.0.0.1:8080/mcp (or your
configured port).
π€ Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"ghidra": {
"url": "http://127.0.0.1:8080/mcp"
}
}
}Configuration file location:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
After updating the configuration, restart Claude Desktop to apply the changes.
π§ Claude Code (CLI)
For Claude Code, use the following command to add the GhidraMCP server:
claude mcp add ghidra "http://127.0.0.1:8080/mcp" --transport httpβ‘ Cursor
For Cursor, you can install via this link.
Or manually add to your MCP configuration:
{
"mcpServers": {
"ghidra": {
"url": "http://127.0.0.1:8080/mcp"
}
}
}Configuration file location:
~/.cursor/mcp_settings.json(or your Cursor configuration directory)
π οΈ Custom MCP Client
For custom MCP clients or other implementations, use the standard MCP configuration format:
{
"mcpServers": {
"ghidra": {
"url": "http://127.0.0.1:8080/mcp",
"transport": "http"
}
}
}Important
The default port is 8080 (configurable in Ghidra: Browser β Edit β
Tool Options β Miscellaneous β GhidraMCP HTTP Server). If you
change the port, update your client configuration accordingly. Ghidra must be
running with the extension enabled for the client to connect.
Note
Timeout Issues: If you encounter timeout problems, refer to the Ghidra timeout configuration guide.
Contributions are welcome! Please feel free to submit pull requests or open
issues. AI agents are also welcome to contribute; please ensure agents refer to
the project's contribution guidelines and development conventions (often found
in .cursor/rules/ or a CONTRIBUTING.md file if present).
This project is heavily inspired by and based on the work of LaurieWired. Instead of using a bridge, this plugin directly embeds the server in the plugin.