GhidraMCP
If you are the rightful owner of GhidraMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcpreview.com.
A Ghidra plugin that implements the Model Context Protocol (MCP) for AI-assisted binary analysis.
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 > Miscellaneous
and 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:
pip install FastMCP
-
Add the following configuration to your Claude MCP setup:
{ "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
git clone https://github.com/yourusername/GhidraMCP.git
-
Set up a Ghidra development environment as described in the Ghidra Developer Guide
-
Set the
GHIDRA_INSTALL_DIR
environment variable:export GHIDRA_INSTALL_DIR=/path/to/ghidra
-
Build with Gradle:
./gradlew buildExtension
-
The extension ZIP will be created in the
dist
directory
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.log
for 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.
Related MCP Servers
View all developer_tools servers →context7
by upstash
Context7 MCP provides up-to-date, version-specific documentation and code examples directly into your prompt, enhancing the capabilities of LLMs by ensuring they use the latest information.
git-mcp
by idosal
GitMCP is a free, open-source, remote Model Context Protocol (MCP) server that transforms GitHub projects into documentation hubs, enabling AI tools to access up-to-date documentation and code.
Sequential Thinking
by modelcontextprotocol
An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.
github-mcp-server
by github
The GitHub MCP Server is a Model Context Protocol server that integrates with GitHub APIs for automation and interaction.
claude-task-master
by eyaltoledano
Task Master is a task management system for AI-driven development with Claude, designed to work seamlessly with Cursor AI.
deepwiki-mcp
by regenrek
This is an unofficial Deepwiki MCP Server that processes Deepwiki URLs, crawls pages, converts them to Markdown, and returns documents or lists by page.
terraform-mcp-server
by hashicorp
The Terraform MCP Server is a Model Context Protocol server that integrates with Terraform Registry APIs for advanced automation in Infrastructure as Code development.
Everything MCP Server
by modelcontextprotocol
The Everything MCP Server is a comprehensive test server designed to demonstrate the full capabilities of the Model Context Protocol (MCP). It is not intended for production use but serves as a valuable tool for developers building MCP clients.