✨ Check out this insightful post from Hacker News 📖
📂 **Category**:
💡 **What You’ll Learn**:
If you find this useful, please ⭐ star the repo — it helps others discover it!
A production-ready Model Context Protocol (MCP) server that bridges Ghidra’s powerful reverse engineering capabilities with modern AI tools and automation frameworks.
- Full MCP Compatibility – Complete implementation of Model Context Protocol
- 110 MCP Tools Available – Comprehensive API surface for binary analysis
- Production-Ready Reliability – Tested batch operations and atomic transactions
- Real-time Analysis – Live integration with Ghidra’s analysis engine
Binary Analysis Capabilities
- Function Analysis – Decompilation, call graphs, cross-references
- Data Structure Discovery – Automatic struct/union/enum creation
- String Extraction – Comprehensive string analysis and categorization
- Import/Export Analysis – Symbol table and library dependency mapping
- Memory Mapping – Complete memory layout documentation
- Cross-Binary Documentation – Function hash matching across binary versions
- Automated Development Cycle – Complete build-test-deploy-verify pipeline
- Ghidra Script Management – Create, run, and manage Ghidra scripts via MCP
- Multi-Program Support – Switch between and compare multiple open programs
- Batch Operations – Efficient bulk renaming, commenting, and typing
- Java 21 LTS (OpenJDK recommended)
- Apache Maven 3.9+
- Ghidra 12.0.2 (or compatible version)
- Python 3.8+ with pip
-
Clone the repository:
git clone https://github.com/bethington/ghidra-mcp.git cd ghidra-mcp -
Install Python dependencies:
pip install -r requirements.txt
-
Copy Ghidra libraries (see Library Dependencies for full list):
# Windows - run the provided batch script copy-ghidra-libs.bat "C:\path\to\ghidra_12.0.2_PUBLIC" # Linux/Mac - copy manually from your Ghidra installation # See Library Dependencies section below for all 14 required JARs
-
Build the plugin:
mvn clean package assembly:single -DskipTests
-
Deploy to Ghidra:
# Windows (automated) .\deploy-to-ghidra.ps1 # Or manually copy to Ghidra Extensions Copy-Item target\GhidraMCP-2.0.0.zip "C:\ghidra\Extensions\Ghidra\"
Option 1: Stdio Transport (Recommended for AI tools)
python bridge_mcp_ghidra.py
Option 2: SSE Transport (Web/HTTP clients)
python bridge_mcp_ghidra.py --transport sse --mcp-host 127.0.0.1 --mcp-port 8081
- Start Ghidra and load a binary
- Go to Tools > GhidraMCP > Start MCP Server
- The server runs on
http://127.0.0.1:8080/by default
📊 Production Performance
- MCP Tools: 110 tools fully implemented
- Speed: Sub-second response for most operations
- Efficiency: 93% reduction in API calls via batch operations
- Reliability: Atomic transactions with all-or-nothing semantics
- Deployment: Automated version-aware deployment script
check_connection– Verify MCP connectivityget_metadata– Program metadata and infoget_version– Server version informationget_entry_points– Binary entry points discovery
list_functions– List all functions (paginated)search_functions_by_name– Search functions by name/patternsearch_functions_enhanced– Advanced function search with filtersdecompile_function– Decompile function to C pseudocodeget_decompiled_code– Get decompiled code by addressget_function_callers– Get function callersget_function_callees– Get function calleesget_function_call_graph– Function relationship graphget_full_call_graph– Complete call graph for programanalyze_function_complete– Comprehensive function analysisanalyze_function_completeness– Documentation completeness score
list_segments– Memory segments and layoutget_function_by_address– Function at addressdisassemble_function– Disassembly listingdisassemble_bytes– Raw byte disassemblyget_xrefs_to– Cross-references to addressget_xrefs_from– Cross-references from addressget_bulk_xrefs– Bulk cross-reference lookupanalyze_data_region– Analyze memory region structureinspect_memory_content– View raw memory contentdetect_array_bounds– Detect array boundaries
Cross-Binary Documentation (v1.9.4+)
get_function_hash– SHA-256 hash of normalized function opcodesget_bulk_function_hashes– Paginated bulk hashing with filterget_function_documentation– Export complete function documentationapply_function_documentation– Import documentation to target functionbuild_function_hash_index– Build persistent JSON indexlookup_function_by_hash– Find matching functions in indexpropagate_documentation– Apply docs to all matching instances
list_data_types– Available data typessearch_data_types– Search for data typescreate_struct– Create custom structureadd_struct_field– Add field to structuremodify_struct_field– Modify existing fieldremove_struct_field– Remove field from structurecreate_enum– Create enumerationget_enum_values– Get enumeration valuescreate_array_type– Create array data typeapply_data_type– Apply type to addressdelete_data_type– Delete a data typeconsolidate_duplicate_types– Merge duplicate typesget_valid_data_types– Get list of valid Ghidra types
list_imports– Imported symbols and librarieslist_exports– Exported symbols and functionslist_external_locations– External location referenceslist_strings– Extracted strings with analysislist_namespaces– Available namespaceslist_globals– Global variablescreate_label– Create label at addressbatch_create_labels– Bulk label creationdelete_label– Delete label at addressbatch_delete_labels– Bulk label deletionrename_label– Rename existing labelrename_or_label– Rename or create label
rename_function– Rename function by namerename_function_by_address– Rename function by addressrename_data– Rename data itemrename_variables– Rename function variablesrename_global_variable– Rename global variablerename_external_location– Rename external referencebatch_rename_function_components– Bulk renamingset_decompiler_comment– Set decompiler commentset_disassembly_comment– Set disassembly commentset_plate_comment– Set function plate commentget_plate_comment– Get function plate commentbatch_set_comments– Bulk comment setting
set_function_prototype– Set function signatureset_local_variable_type– Set variable typeset_parameter_type– Set parameter typebatch_set_variable_types– Bulk type settingset_variable_storage– Control variable storage locationset_function_no_return– Mark function as non-returninglist_calling_conventions– Available calling conventionsget_function_variables– Get all function variablesget_function_labels– Get labels in function
list_scripts– List available scriptsrun_script– Run a scriptlist_ghidra_scripts– List custom Ghidra scriptssave_ghidra_script– Save new scriptget_ghidra_script– Get script contentsrun_ghidra_script– Execute Ghidra scriptupdate_ghidra_script– Update existing scriptdelete_ghidra_script– Delete script
list_open_programs– List all open programsget_current_program_info– Current program detailsswitch_program– Switch active programlist_project_files– List project filesopen_program– Open program from projectcompare_programs_documentation– Compare documentation between programs
find_next_undefined_function– Find undefined functionsfind_undocumented_by_string– Find functions by string referencebatch_string_anchor_report– String anchor analysissearch_byte_patterns– Search for byte patternsget_assembly_context– Get assembly contextanalyze_struct_field_usage– Analyze structure field accessget_field_access_context– Get field access patternscreate_function– Create function at addressget_function_jump_target_addresses– Get jump targets
See docs/README.md for complete documentation.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ AI/Automation │◄──►│ MCP Bridge │◄──►│ Ghidra Plugin │
│ Tools │ │ (bridge_mcp_ │ │ (GhidraMCP.jar) │
│ (Claude, etc.) │ │ ghidra.py) │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
MCP Protocol HTTP REST Ghidra API
(stdio/SSE) (localhost:8080) (Program, Listing)
- bridge_mcp_ghidra.py – Python MCP server that translates MCP protocol to HTTP calls
- GhidraMCP.jar – Ghidra plugin that exposes analysis capabilities via HTTP
- ghidra_scripts/ – Collection of 70+ automation scripts for common tasks
# Build the plugin (skip integration tests)
mvn clean package assembly:single -DskipTests
# Deploy to Ghidra
.\deploy-to-ghidra.ps1
ghidra-mcp/
├── bridge_mcp_ghidra.py # MCP server (Python)
├── src/main/java/ # Ghidra plugin (Java)
├── lib/ # Ghidra library dependencies
├── ghidra_scripts/ # 70+ automation scripts
├── docs/ # Documentation
│ ├── prompts/ # AI workflow prompts
│ ├── releases/ # Version release notes
│ └── project-management/ # Project docs
├── examples/ # Example usage
└── scripts/ # Build/utility scripts
The lib/ folder must contain Ghidra JAR files for compilation. Run the provided script to copy them from your Ghidra installation:
# Windows
copy-ghidra-libs.bat "C:\path\to\ghidra_12.0.2_PUBLIC"
# Or manually copy from your Ghidra installation
Required Libraries (14 JARs, ~37MB):
| Library | Source Path | Purpose |
|---|---|---|
| Base.jar | Features/Base/lib/ |
Core Ghidra functionality |
| Decompiler.jar | Features/Decompiler/lib/ |
Decompilation engine |
| PDB.jar | Features/PDB/lib/ |
Microsoft PDB symbol support |
| FunctionID.jar | Features/FunctionID/lib/ |
Function identification |
| SoftwareModeling.jar | Framework/SoftwareModeling/lib/ |
Program model API |
| Project.jar | Framework/Project/lib/ |
Project management |
| Docking.jar | Framework/Docking/lib/ |
UI docking framework |
| Generic.jar | Framework/Generic/lib/ |
Generic utilities |
| Utility.jar | Framework/Utility/lib/ |
Core utilities |
| Gui.jar | Framework/Gui/lib/ |
GUI components |
| FileSystem.jar | Framework/FileSystem/lib/ |
File system support |
| Graph.jar | Framework/Graph/lib/ |
Graph/call graph analysis |
| DB.jar | Framework/DB/lib/ |
Database operations |
| Emulation.jar | Framework/Emulation/lib/ |
P-code emulation |
Note: Libraries are NOT included in the repository (see
.gitignore). You must copy them from your Ghidra installation before building.
- Automated Deployment: Version-aware deployment script
- Batch Operations: Reduces API calls by 93%
- Atomic Transactions: All-or-nothing semantics
- Comprehensive Logging: Debug and trace capabilities
See CONTRIBUTING.md for detailed contribution guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Build and test your changes (
mvn clean package assembly:single -DskipTests) - Update documentation as needed
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache License 2.0 – see the LICENSE file for details.
| Metric | Value |
|---|---|
| Version | 2.0.0 |
| MCP Tools | 110 fully implemented |
| Compilation | ✅ 100% success |
| Batch Efficiency | 93% API call reduction |
| Ghidra Scripts | 70+ automation scripts |
| Documentation | Comprehensive with AI prompts |
See CHANGELOG.md for version history and release notes.
- Ghidra Team – For the incredible reverse engineering platform
- Model Context Protocol – For the standardized AI integration framework
- Contributors – For testing, feedback, and improvements
- re-universe — Ghidra BSim PostgreSQL platform for large-scale binary similarity analysis. Pairs perfectly with GhidraMCP for AI-driven reverse engineering workflows.
- cheat-engine-server-python — MCP server for dynamic memory analysis and debugging.
Ready for production deployment with enterprise-grade reliability and comprehensive binary analysis capabilities.
🔥 **What’s your take?**
Share your thoughts in the comments below!
#️⃣ **#bethingtonghidramcp #Productiongrade #Ghidra #MCP #Server #endpoints #crossbinary #documentation #transfer #batch #analysis #headless #mode #Docker #deployment #AIpowered #reverse #engineering**
🕒 **Posted on**: 1770196824
🌟 **Want more?** Click here for more info! 🌟
