ghidra-mcp  by bethington

AI-powered reverse engineering framework for Ghidra

Created 8 months ago
2,078 stars

Top 20.9% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Ghidra MCP Server addresses the challenges of inconsistent reverse engineering practices and integration with AI tools by providing a comprehensive Model Context Protocol (MCP) server. It offers over 244 MCP tools, enabling AI agents and human engineers to perform complex reverse engineering tasks with enhanced consistency and efficiency. The project targets reverse engineers, security researchers, and developers seeking to automate and scale Ghidra-based analysis, offering benefits like standardized workflows, improved code quality through convention enforcement, and seamless integration with modern AI frameworks.

How It Works

The system comprises a Python MCP Bridge (bridge_mcp_ghidra.py), a Ghidra plugin (GhidraMCP.jar), and an optional headless server. AI tools communicate with the bridge via the MCP protocol (stdio or HTTP), which then translates requests into Ghidra API calls through the plugin. This architecture leverages Ghidra's powerful analysis capabilities, extending them with features like P-code emulation, live debugger integration, and data flow analysis. A key design choice is enforcing naming and typing conventions directly within the tool layer, ensuring consistent output across different models and sessions without manual prompt engineering.

Quick Start & Requirements

  • Prerequisites: Java 21 LTS (OpenJDK recommended), Apache Maven 3.9+, Ghidra 12.1 (or compatible), Python 3.10+.
  • Installation: Clone the repository, then use python -m tools.setup ensure-prereqs --ghidra-path <path/to/ghidra>, python -m tools.setup build, and python -m tools.setup deploy --ghidra-path <path/to/ghidra>.
  • Documentation: GitHub Repository

Highlighted Details

  • Comprehensive Tooling: Implements 244 MCP tools, significantly more than competing solutions, offering full read/write access to Ghidra's features.
  • AI-Driven Workflows: Includes battle-tested AI workflows for function documentation, type auditing, and automated verification, refined across hundreds of real-world binaries.
  • Convention Enforcement: Opinionated design moves naming conventions and type safety into the tool layer for consistent output and reduced code review friction.
  • Advanced Analysis: Supports P-code emulation for isolated function execution and live integration with Ghidra's debugger.
  • Cross-Binary Documentation: Automatically propagates documentation across different binary versions using SHA-256 function hash matching.

Maintenance & Community

The project is actively maintained, with core contributors listed as @heeen and @huehuehuehueing. Sponsorship is encouraged to fund compatibility updates, production hardening, documentation, and new tooling. Community interaction primarily occurs through the GitHub repository.

Licensing & Compatibility

  • License: Apache License 2.0.
  • Compatibility: Ghidra 12.1 clients require a Ghidra Server version 12.1, 12.0.5, or newer. Compatibility with older Ghidra Server versions is not guaranteed.

Limitations & Caveats

The default configuration binds the HTTP server to 127.0.0.1 without authentication, suitable for single-user workstations. Exposing the server beyond localhost requires configuring environment variables like GHIDRA_MCP_AUTH_TOKEN for security. Script execution endpoints are disabled by default as of v5.4.1 due to security risks. Ghidra 12.1 no longer enables Jython by default, requiring manual installation of the Jython extension for .py scripts.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
53
Issues (30d)
25
Star History
366 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.