GhidraMCP
AI-powered binary analysis through Model Context Protocol integration with Ghidra
Key Features
Use Cases
README
GhidraMCP
A Ghidra plugin that implements the Model Context Protocol (MCP) for AI-assisted binary analysis.
Overview
GhidraMCP bridges the gap between Ghidra's powerful reverse engineering capabilities and AI assistants through the Model Context Protocol (MCP). This plugin enables AI models to connect to Ghidra and assist with binary analysis tasks, making reverse engineering more efficient and accessible.
Features
- AI-Powered Binary Analysis: Connect AI assistants to Ghidra via the Model Context Protocol
- Natural Language Interface: Ask questions about binaries in plain English
- Deep Code Insights: Retrieve detailed function information and decompiled code
- Binary Structure Analysis: Explore imports, exports, and memory layouts
- Automated Security Analysis: Get AI-assisted insights about potential security vulnerabilities
- Socket-Based Architecture: High-performance communication between Ghidra and AI assistants
- Cross-Platform Compatibility: Works on all platforms supported by Ghidra
Installation
Prerequisites
- Ghidra 11.2.1+
- Java 17 or newer
- Python 3.8+ (for the bridge script)
Steps
- Download the latest release ZIP file from the Releases page
- Open Ghidra
- Navigate to
File > Install Extensions - Click the "+" button and select the downloaded ZIP file
- Restart Ghidra to complete the installation
- Enable the extension by going to
File > Configure > Miscellaneousand checking the box next to "MCPServerPlugin"
Usage
Starting the MCP Server
The server automatically starts when you open a Ghidra project after enabling the plugin. By default, it runs on:
- Host:
localhost - Port:
8765
You can verify the server is running by checking the Ghidra console for messages like:
MCP Server started on port 8765
Connecting with AI Assistants
Connecting with Claude
To connect Claude to the GhidraMCP plugin:
-
Install the MCP bridge script:
bashpip install FastMCP -
Add the following configuration to your Claude MCP setup:
json{ "mcpServers": { "ghidra": { "command": "python", "args": ["PATH-TO-REPO/GhidraMCP/ghidra_server.py"] } } }
The bridge script creates a connection between Ghidra and Claude, enabling real-time binary analysis through natural language.
Available Tools
The plugin exposes several powerful functions through the MCP interface:
| Tool | Description |
|---|---|
get_function(address, decompile=False) |
Retrieve detailed information about a function at a specific address |
analyze_binary(question) |
Ask natural language questions about the loaded binary |
get_imports() |
List all imported functions in the binary |
get_exports() |
List all exported functions in the binary |
get_memory_map() |
Get the memory layout of the binary |
connect_to_ghidra(host, port) |
Connect to a specific Ghidra instance |
rename_function(current_name, new_name) |
Rename a function by its current name |
rename_data(address, new_name) |
Rename a data label at a specific address |
extract_api_call_sequences(address) |
Extract API calls from a function for security analysis |
identify_user_input_sources() |
Find potential sources of user input in the binary |
generate_call_graph(address, max_depth=3) |
Generate a hierarchical representation of function calls |
identify_crypto_patterns() |
Detect cryptographic implementations in the binary |
find_obfuscated_strings() |
Locate potentially obfuscated strings |
Example Queries
Here are examples of questions you can ask through an MCP-compatible AI client:
- "What encryption algorithms are used in this binary?"
- "Can you show me the decompiled code for the function at 0x401000?"
- "What suspicious API calls does this malware make?"
- "Explain the purpose of this binary based on its imports and exports."
- "How does the authentication mechanism in this program work?"
- "Are there any potential buffer overflow vulnerabilities in this code?"
- "What network connections does this binary establish?"
- "Can you rename this function to something more descriptive?"
- "Show me all potential user input sources that could be exploited."
- "Generate a call graph for the main function."
Advanced Usage
Security Analysis Capabilities
GhidraMCP provides specialized tools for security-focused analysis:
API Call Sequence Analysis
Extract and categorize external API calls from a function for security analysis. This helps identify potentially dangerous functions and understand their interactions.
User Input Sources
Identify entry points where external data enters the program, crucial for vulnerability assessment and understanding attack surfaces.
Call Graph Generation
Create structured call graphs to understand execution flow, track data propagation, and identify potential attack paths.
Cryptographic Pattern Detection
Identify cryptographic implementations including standard algorithms (AES, RSA, etc.) and custom implementations based on code patterns.
Obfuscated String Detection
Find strings that may be obfuscated through techniques like XOR encoding or character-by-character construction.
Custom Configurations
You can modify the server port by editing the MCPServerPlugin.java file:
server.setPort(YOUR_CUSTOM_PORT);
Integration with Analysis Workflows
GhidraMCP can be integrated into your existing analysis workflows:
- Use Ghidra's standard analysis features to identify areas of interest
- Leverage AI assistance through GhidraMCP for deeper understanding
- Combine the AI insights with your manual analysis
- Rename functions and data based on AI insights for better readability
Building from Source
To build the plugin from source:
-
Clone this repository
bashgit clone https://github.com/yourusername/GhidraMCP.git -
Set up a Ghidra development environment as described in the Ghidra Developer Guide
-
Set the
GHIDRA_INSTALL_DIRenvironment variable:bashexport GHIDRA_INSTALL_DIR=/path/to/ghidra -
Build with Gradle:
bash./gradlew buildExtension -
The extension ZIP will be created in the
distdirectory
Troubleshooting
Common Issues
- Connection Issues: Make sure the Ghidra instance is running and the plugin is enabled
- Port Conflicts: If port 8765 is already in use, modify the port in the plugin configuration
- Bridge Script Errors: Check if all required Python packages are installed with
pip install FastMCP - Null Results for Analysis Functions: Some security analysis functions may return null results if the binary doesn't contain relevant patterns
Logs
Check the following logs for troubleshooting:
- Ghidra console for server-side messages
ghidra_mcp_bridge.logfor bridge script issues
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Acknowledgments
- National Security Agency (NSA) for developing Ghidra
- Model Context Protocol community
- All contributors to this project
GhidraMCP is not affiliated with or endorsed by the NSA or the Ghidra project.
Star History
Repository Owner
User
Repository Details
Programming Languages
Tags
Join Our Newsletter
Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.
Related MCPs
Discover similar Model Context Protocol servers
ghidraMCP
MCP server enabling LLMs to autonomously reverse engineer binaries via Ghidra.
ghidraMCP acts as a Model Context Protocol (MCP) server, exposing core Ghidra reverse engineering functionality for use by large language models. It enables model clients to perform actions such as decompilation, binary analysis, and automated renaming of methods and data. The system integrates as both a Ghidra plugin and a Python MCP server, supporting interoperability with various MCP-compliant clients. By bridging Ghidra and MCP, it allows autonomous or semi-autonomous analysis of compiled application binaries.
- ⭐ 6,483
- MCP
- LaurieWired/GhidraMCP
GhidrAssistMCP
Bringing Model Context Protocol server connectivity to Ghidra for AI-assisted reverse engineering.
GhidrAssistMCP is a Ghidra extension providing a Model Context Protocol (MCP) server that allows AI assistants and other tools to interact programmatically with Ghidra's reverse engineering platform. It offers a standardized API for querying program data, managing tool interactions, and enabling real-time analysis features. The extension features a configurable UI, built-in logging, and dynamic management of 31 specialized analysis tools.
- ⭐ 337
- MCP
- jtang613/GhidrAssistMCP
IDA Pro MCP
Enabling Model Context Protocol server integration with IDA Pro for collaborative reverse engineering.
IDA Pro MCP provides a Model Context Protocol (MCP) server that connects the IDA Pro reverse engineering platform to clients supporting the MCP standard. It exposes a wide array of program analysis and manipulation functionalities such as querying metadata, accessing functions, globals, imports, and strings, decompiling code, disassembling, renaming variables, and more, in a standardized way. This enables seamless integration of AI-powered or remote tools with IDA Pro to enhance the reverse engineering workflow.
- ⭐ 4,214
- MCP
- mrexodia/ida-pro-mcp
Binary Ninja MCP
Seamlessly integrate Binary Ninja with Model Context Protocol clients for enhanced reverse engineering.
Binary Ninja MCP enables real-time integration of Binary Ninja's reverse engineering environment with various Model Context Protocol (MCP) clients. It acts as a server exposing Binary Ninja's capabilities via HTTP endpoints and includes a bridge to connect to MCP clients. The extension supports auto-setup with popular clients such as Cline, Claude Desktop, Roo Code, and others, streamlining the use of AI-assisted workflows. This enhances tasks such as analyzing binaries, switching targets, and leveraging LLM-driven automation in reverse engineering.
- ⭐ 112
- MCP
- fosdickio/binary_ninja_mcp
JADX-AI-MCP
Automated AI-powered APK analysis via Model Context Protocol.
JADX-AI-MCP is a fully automated server and plugin for integrating Model Context Protocol (MCP) with JADX for the purpose of analyzing Android APKs using large language models such as Claude. It streamlines vulnerability discovery, reverse engineering, and static analysis by leveraging LLMs in conjunction with established tools. The project facilitates real-time code review and efficient collaboration between AI and human analysts.
- ⭐ 637
- MCP
- zinja-coder/jadx-ai-mcp
mcp-recon
Conversational reconnaissance interface and MCP server for HTTP and ASN analysis.
mcp-recon acts as a conversational interface and Model Context Protocol (MCP) server, enabling seamless web domain and ASN reconnaissance through natural language prompts. It integrates powerful tooling like httpx and asnmap to conduct lightweight or full HTTP analysis and ASN lookups, exposing these capabilities to any MCP-compatible AI assistant. With predefined prompts and Docker-based deployment, it streamlines infrastructure analysis via AI interfaces such as Claude Desktop.
- ⭐ 22
- MCP
- nickpending/mcp-recon
Didn't find tool you were looking for?