If you found it useful, please ⭐ star the repo – it helps others find it!
A production-ready Model Context Protocol (MCP) server that combines Ghidra’s powerful reverse engineering capabilities with modern AI tools and automation frameworks.
- full mcp compatibility – Full implementation of the Model Context protocol
- 110 MCP tools available – Extensive 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
- job analysis – Decompile, Call Graph, Cross-Reference
- data structure search – Automatic struct/union/enum creation
- string extraction – Comprehensive string analysis and classification
- import/export analysis – Symbol table and library dependency mapping
- memory mapping – Complete memory layout documentation
- Cross-Binary Documentation – function hash matching in binary versions
- automated development cycle – Complete build-test-deployment-verification pipeline
- Ghidra Script Management – Create, run and manage Ghidra scripts through MCP
- Multi-program support – Switch and compare between multiple open programs
- batch operation – Efficient bulk renaming, commenting and typing
- java 21 lts (OpenJDK recommended)
- Apache Maven 3.9+
- Ghidr 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 a complete 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
-
Create plugin:
mvn clean package assembly:single -DskipTests
-
Deploy on 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: Studio Transport (recommended for AI tools)
python bridge_mcp_ghidra.py
Option 2: SSE Transport (Web/HTTP Client)
python bridge_mcp_ghidra.py --transport sse --mcp-host 127.0.0.1 --mcp-port 8081
- Start Ghidra and load a binary
- Go Tools > GhidraMCP > Start MCP Server
- Server keeps running
http://127.0.0.1:8080/As a default
📊Production performance
- mcp tools: 110 tools fully implemented
- pace: sub-second response for most operations
- Capacity: 93% reduction in API calls through batch operations
- reliability: atomic transactions with all or nothing semantics
- deployment:Automatic version-aware deployment script
check_connection– Verify MCP connectivityget_metadata– Program metadata and informationget_version– Server version informationget_entry_points– binary entry point search
list_functions– List all tasks (paged)search_functions_by_name– Search tasks by name/patternsearch_functions_enhanced– Advanced search function with filtersdecompile_function– Decompile function in C pseudocodeget_decompiled_code– Get the code decomposed by addressget_function_callers– get function callersget_function_callees– GET FUNCTION CALLSget_function_call_graph– function relation graphget_full_call_graph– Full call graph for the programanalyze_function_complete– Comprehensive job analysisanalyze_function_completeness– Documentation Completeness Score
list_segments– Memory segments and layoutget_function_by_address– work at addressdisassemble_function– disassembly listdisassemble_bytes– Raw Byte Disassemblyget_xrefs_to– cross-reference to addressget_xrefs_from– cross-reference by addressget_bulk_xrefs– Bulk cross-reference lookupanalyze_data_region– Analyze memory area structureinspect_memory_content– View raw memory contentdetect_array_bounds– find array boundaries
Cross-Binary Documentation (v1.9.4+)
get_function_hash– SHA-256 hash of normalized function opcodeget_bulk_function_hashes– Paginated bulk hashing with filtersget_function_documentation– Export complete function documentationapply_function_documentation– Import document to target functionbuild_function_hash_index– Create persistent JSON indexlookup_function_by_hash– Find matching tasks in the indexpropagate_documentation– Apply document to all matching instances
list_data_types– Available data typessearch_data_types– Find data typescreate_struct– Create custom structureadd_struct_field– add fields to the structuremodify_struct_field– Modify existing fieldsremove_struct_field– remove field from structurecreate_enum– Create calculationget_enum_values– get the calculated valuecreate_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 icons and functionslist_external_locations– external space referencelist_strings– extracted strings with analysislist_namespaces– available namespaceslist_globals– global variablescreate_label– Create address labelsbatch_create_labels– bulk label manufacturingdelete_label– Remove label on addressbatch_delete_labels– bulk label removalrename_label– Rename existing labelrename_or_label– Rename or create a label
rename_function– Rename function by namerename_function_by_address– Change function name based on addressrename_data– Rename data itemrename_variables– Rename function variablerename_global_variable– rename global variablesrename_external_location– Rename external referencebatch_rename_function_components– Changing name in bulkset_decompiler_comment– set decompiler commentsset_disassembly_comment– set disassembly commentset_plate_comment– Set function plate commentget_plate_comment– Get function plate commentbatch_set_comments– Bulk comment settings
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 spaceset_function_no_return– mark the function as non-returninglist_calling_conventions– Available calling conventionsget_function_variables– get all function variablesget_function_labels– get label 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 contentrun_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 programslist_project_files– List project filesopen_program– Open the program from the projectcompare_programs_documentation– Compare documentation between programs
find_next_undefined_function– find undefined functionfind_undocumented_by_string– Find functions by string referencebatch_string_anchor_report– string anchor analysissearch_byte_patterns– Find byte patternsget_assembly_context– get assembly referenceanalyze_struct_field_usage– Analyze structure field accessget_field_access_context– Get field access patterncreate_function– create function on addressget_function_jump_target_addresses– achieve the jump target
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 the MCP protocol into HTTP calls
- GhidraMCP.jar – Ghidra plugin that exposes analytics 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
lib/ The folder must contain Ghidra JAR files for compilation. Run the following 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 JAR, ~37MB):
| Library | source path | Objective |
|---|---|---|
| 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/ |
work identity |
| 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/ |
general utilities |
| utility.jar | Framework/Utility/lib/ |
Main 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 |
Comment: Not included in the library repository (see).
.gitignore). You will need to copy them from your Ghidra installation before building.
- automated deployment:version-aware deployment script
- batch operation: Reduces API calls by up to 93%
- nuclear transaction: all or nothing semantics
- mass 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 documents as needed
- Commit your changes (
git commit -m 'Add amazing feature') - push 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 | price |
|---|---|
| version | 2.0.0 |
| mcp tools | 110 fully implemented |
| Compilation | ✅ 100% success |
| batch efficiency | 93% reduction in API calls |
| ghidra scripts | 70+ automation scripts |
| documentation | Comprehensive with AI signals |
See CHANGELOG.md for version history and release notes.
- Ghidra Team – For incredible reverse engineering platforms
- Model Reference Protocol – For standardized AI integration framework
- Contributors – To test, feedback and improve
- Re-Universe – Ghidra Bsim PostgreSQL platform for large-scale binary similarity analysis. Perfectly integrates with GhidraMCP for AI-powered 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.
<a href