GhidraMCP
An embedded MCP server for Ghidra, exposing program data and reverse engineering functionalities.
Ghidra integration for the Model Context Protocol (MCP)
A Ghidra extension that runs an embedded MCP server to expose Ghidra program data and functionalities via tools.
✨ Features
GhidraMCP provides comprehensive MCP tools for reverse engineering workflows:
Core Analysis
- 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
- Execute Scripts - Run Ghidra scripts within the analysis environment
Management Operations
- 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 Operations
- Read Data Types - Browse and query program data types with filtering and pagination
- Read Functions - Enumerate functions with detailed metadata and filtering
- Read Memory Blocks - View memory segments, permissions, and properties
- Read Symbols - Browse symbols with type and namespace filtering
Delete Operations
- 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
Discovery & Search
- List Analysis Options - View available analysis options and settings
- List Programs - Discover open and closed programs in the project
- Find References - Locate code and data references
- Search Memory - Pattern search with hex, string, binary, and regex support
Utilities
- Batch Operations - Execute multiple tool operations in a single transaction with automatic rollback on failure
- Undo/Redo - Transaction-based undo/redo operations
🚀 Installation
- Download the latest release
zip
file 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
zip
file and select it. - Ensure the
GhidraMCP
extension is checked in the list and clickOK
. - Restart Ghidra.
▶️ Usage
- Ensure Ghidra is running with the GhidraMCP extension active.
- Configure the MCP server settings (see 'Configuration' below).
- Ensure your MCP Client is configured to connect to the GhidraMCP server (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 thelist_open_files
tool to see available programs. Most tools provide this context automatically on failed calls.
⚙️ Configuration
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.
[!NOTE] > Port Configuration: If you change the default port (8080), you must update your MCP client configuration accordingly (see 'Configuring an MCP Client' below).
🛠️ Building from Source
- Clone the repository:
git clone https://github.com/themixednuts/GhidraMCP.git
- Navigate to the project directory:
cd GhidraMCP
- Ensure you have Apache Maven and a JDK (compatible version, e.g., JDK 21 or later recommended for modern Ghidra development) installed.
- Copy the following required JAR files from your Ghidra installation directory
into the
lib/
directory of this project. Create thelib/
directory if it doesn't exist:Ghidra/Features/Base/lib/Base.jar
Ghidra/Features/Decompiler/lib/Decompiler.jar
Ghidra/Framework/Docking/lib/Docking.jar
Ghidra/Framework/Generic/lib/Generic.jar
Ghidra/Framework/Project/lib/Project.jar
Ghidra/Framework/SoftwareModeling/lib/SoftwareModeling.jar
Ghidra/Framework/Utility/lib/Utility.jar
Ghidra/Framework/Gui/lib/Gui.jar
Ghidra/Features/MicrosoftCodeAnalyzer/lib/MicrosoftCodeAnalyzer.jar
Ghidra/Features/MicrosoftDemangler/lib/MicrosoftDemangler.jar
Ghidra/Features/MicrosoftDmang/lib/MicrosoftDmang.jar
[!NOTE] Paths are relative to your Ghidra installation folder. Exact paths might vary slightly based on Ghidra version and OS.
- Build the project using Maven:
mvn clean package assembly:single
- The installable
zip
file will be located in thetarget/
directory (e.g.,target/GhidraMCP-*-SNAPSHOT-ghidra.zip
). Follow the Installation steps above using this file.
🔌 Configuring an MCP Client
To allow an MCP client (like Claude Desktop or a custom client) to interact with Ghidra via this extension, you need to configure the client to connect to the server endpoint provided by GhidraMCP.
The GhidraMCP server runs within Ghidra itself when the extension is active. It exposes an HTTP endpoint for stateless MCP communication.
Agent-Specific Setup Instructions
For Claude Desktop, add the following configuration to your
claude_desktop_config.json
file. Adjust the key ("ghidra"
in this example)
as needed:
{
"mcpServers": {
"ghidra": {
"url": "http://127.0.0.1:8080/mcp"
}
// Add other MCP server configurations here if needed
}
}
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.
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
This will automatically configure the MCP server connection for Claude Code.
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)
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"
}
}
}
The server supports standard MCP over HTTP protocol.
[!IMPORTANT] Port: The default port is
8080
. This is configurable within Ghidra under Browser → Edit → Tool Options → Miscellaneous → GhidraMCP HTTP Server. If you change the port in Ghidra, you must update theurl
in your client configuration accordingly.
[!IMPORTANT] Server Status: Ghidra must be running with the GhidraMCP extension enabled for the client to connect successfully.
[!NOTE] Timeout Issues: If you encounter timeout problems, refer to the Ghidra timeout configuration guide.
🤝 Contributing
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).
Acknowledgements
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.
Related Servers
Remote MCP Server (Authless)
A remote MCP server deployable on Cloudflare Workers without authentication.
WordPress Community DEV Docs
Access WordPress development rules and best practices from the WordPress LLM Rules repository. It dynamically creates tools for each rule and caches content using Cloudflare Durable Objects.
Quantum Code Validator
A server for validating quantum computing library code, with support for PennyLane.
Tiktoken MCP
Count tokens using OpenAI's tiktoken library.
Lingo.dev
Make your AI agent speak every language on the planet, using Lingo.dev Localization Engine.
MCP Expert Server
An MCP server for query generation and documentation assistance using Claude AI.
Model Context Protocol servers
A collection of reference MCP server implementations in TypeScript and Python, demonstrating MCP features and SDKs.
OpenZipline MCP
Provides secure, standards-compliant smart contract templates for tokens, access control, finance, and governance.
MCP Trading Partner Management
An MCP server for managing trading partners in the SAP Integration Suite.
MCP Think Tool Server
An MCP server implementing the 'think' tool to improve Claude's complex reasoning capabilities.