loading…
Search for a command to run...
loading…
Model Context Protocol server for Ghidra reverse engineering. 179 tools for decompilation, symbol management, cross-references, and binary analysis.
Model Context Protocol server for Ghidra reverse engineering. 179 tools for decompilation, symbol management, cross-references, and binary analysis.
Tests Release License GitHub Sponsors
Stars Last commit Discussions Issues
If you find this useful, please ⭐ star the repo — it helps others discover it!
If Ghidra MCP saves you time, consider sponsoring the project. One-time and recurring support both help fund compatibility updates, production hardening, docs, and new tooling.
A production-ready Model Context Protocol (MCP) server that bridges Ghidra's powerful reverse engineering capabilities with modern AI tools and automation frameworks. 225 MCP tools, battle-tested AI workflows, and the most comprehensive Ghidra-MCP integration available — now including P-code emulation, live debugger integration, and PCode-graph data flow analysis.
Most Ghidra MCP implementations give you a handful of read-only tools and call it a day. This project is different — it was built by a reverse engineer who uses it daily on real binaries, not as a demo.
You've been there: six months into a project you find ProcessItem, process_items, handleItem, and ItemProc in the same codebase — four functions doing the same thing, named by four different sessions or engineers with no shared contract. Fixing it takes longer than it should, and the problem will happen again.
v5.0 moves conventions from "things to remember" into the tool layer, where they can actually be enforced.
| Tier | Behavior | Example |
|---|---|---|
| Auto-fix | Applied silently | count field on a uint32 → auto-prefixed dwCount on save |
| Warn | Change goes through, warning returned | processData → "name should be PascalCase with a verb: ProcessData" |
| Reject | Change blocked with explanation | undefined → undefined type change → "no-op rejected, type unchanged" |
For AI agents, this means consistent output across every session, every model, every run — without pasting a style guide into every prompt. The tool knows the rules; the model just needs to make the call.
For teams, it eliminates the entire class of review comment that says "that's not our naming convention." Convention arbitration stays in the tool, not in code review.
For solo work at scale, analyze_function_completeness gives you a 0–100% score that measures honestly: structural deductions (unfixable compiler artifacts) are forgiven in your effective score, log-scaling prevents one bad category from burying everything else, and tiered plate comment quality means you know exactly what's missing and why.
Compatibility note: MCP tool names are normalized for GitHub Copilot CLI and CAPI validation. Exposed tool names use lowercase letters, digits, underscores, and hyphens only; nested HTTP paths such as
/debugger/statusare advertised as names likedebugger_status_2when needed to avoid collisions with static bridge tools.
EmulatorHelper; brute-force API hash resolution in millisecondsRecommended for all platforms: use
python -m tools.setupdirectly.
ensure-prereqsinstalls runtime Python requirements plus the Ghidra JARs needed in the local Maven repository.deploycopies the build output, installs the user-profile extension, and patches Ghidra user config.
Clone the repository:
git clone https://github.com/bethington/ghidra-mcp.git
cd ghidra-mcp
Recommended: run environment preflight first:
python -m tools.setup preflight --ghidra-path "F:\ghidra_12.0.4_PUBLIC"
Build and deploy to Ghidra:
python -m tools.setup ensure-prereqs --ghidra-path "F:\ghidra_12.0.4_PUBLIC"
python -m tools.setup build
python -m tools.setup deploy --ghidra-path "F:\ghidra_12.0.4_PUBLIC"
deploy saves/closes an already-running matching Ghidra instance when
needed, installs the extension, starts Ghidra, waits for MCP health, and runs
schema smoke checks.
Optional strict/manual mode (advanced):
# Skip automatic prerequisite setup
python -m tools.setup build
python -m tools.setup deploy --ghidra-path "F:\ghidra_12.0.4_PUBLIC"
Show command help:
python -m tools.setup --help
Optional build-only mode (advanced/troubleshooting):
python -m tools.setup build
Supported build path: python -m tools.setup build uses Maven under the hood and is the canonical workflow used by the repo tasks and docs.
# Manual Maven build (requires Ghidra deps already installed in local .m2)
mvn clean package assembly:single -DskipTests
# Secondary/manual Gradle build path only (not used by tools.setup or VS Code tasks)
GHIDRA_INSTALL_DIR=/path/to/ghidra gradle buildExtension
Clone the repository:
git clone https://github.com/bethington/ghidra-mcp.git
cd ghidra-mcp
Install system prerequisites (if not already installed):
sudo apt update && sudo apt install -y openjdk-21-jdk maven python3 python3-pip curl jq unzip
Run environment preflight:
python -m tools.setup preflight --ghidra-path ~/ghidra_12.0.4_PUBLIC
Build and deploy to Ghidra (single command):
python -m tools.setup ensure-prereqs --ghidra-path ~/ghidra_12.0.4_PUBLIC
python -m tools.setup build
python -m tools.setup deploy --ghidra-path ~/ghidra_12.0.4_PUBLIC
This will:
~/.m2/repositoryGhidraMCP-<version>.zip with Maven~/.config/ghidra/ghidra_<version>_PUBLIC/Extensions/preferences with LastExtensionImportDirectoryOptional: setup only Maven dependencies:
python -m tools.setup install-ghidra-deps --ghidra-path ~/ghidra_12.0.4_PUBLIC
Show command help:
python -m tools.setup --help
Linux paths: The extension is installed to
$HOME/.config/ghidra/ghidra_<version>_PUBLIC/Extensions/GhidraMCP/. Ghidra config files are in$HOME/.config/ghidra/ghidra_<version>_PUBLIC/.
Install prerequisites:
brew install openjdk@21 maven python ghidra
Clone the repository:
git clone https://github.com/bethington/ghidra-mcp.git
cd ghidra-mcp
Install Ghidra JARs into local Maven:
python -m tools.setup install-ghidra-deps \
--ghidra-path /opt/homebrew/opt/ghidra/libexec
Build and deploy:
python -m tools.setup ensure-prereqs \
--ghidra-path /opt/homebrew/opt/ghidra/libexec
python -m tools.setup build
python -m tools.setup deploy \
--ghidra-path /opt/homebrew/opt/ghidra/libexec
The extension is installed to ~/Library/ghidra/ghidra_12.0.4_PUBLIC/Extensions/GhidraMCP/.
Note:
--ghidra-versionis required when using the Homebrew path because the path contains no version string.
Start Ghidra and enable the plugin:
/opt/homebrew/opt/ghidra/libexec/ghidraRun
In the main project window: Tools > GhidraMCP > Start MCP Server
Configure Cursor/Claude MCP (~/.cursor/mcp.json):
{
"mcpServers": {
"ghidra": {
"command": "uv",
"args": ["run", "--script", "/path/to/ghidra-mcp/bridge_mcp_ghidra.py"]
}
}
}
python bridge_mcp_ghidra.py
python bridge_mcp_ghidra.py --transport streamable-http --mcp-host 127.0.0.1 --mcp-port 8081
MCP client config for the HTTP transport (add to your client's MCP config file):
{
"mcpServers": {
"ghidra-mcp-http": {
"url": "http://127.0.0.1:8081/mcp"
}
}
}
python bridge_mcp_ghidra.py --transport sse --mcp-host 127.0.0.1 --mcp-port 8081
| Flag | Default | Description |
|---|---|---|
--transport |
stdio |
stdio (AI tools), streamable-http (web clients), sse (deprecated) |
--mcp-host |
127.0.0.1 |
Bind host for HTTP transports |
--mcp-port |
— | Port for HTTP transports |
--lazy |
off | Load only the default tool groups on connect. Faster startup, but MCP clients that don't support tools/list_changed will see an incomplete tool list. Not recommended for Claude Code. |
--no-lazy |
(default) | Load all tool groups immediately on connect. Required for most AI clients. |
--default-groups |
listing,function,program |
Comma-separated groups loaded on connect when --lazy is set. |
python -m pip install -r requirements-debugger.txt
python -m debugger
The debugger server listens on http://127.0.0.1:8099/ by default and is
required for the debugger_* proxy tools exposed by the MCP bridge.
Debugger server flags:
| Flag | Default | Description |
|---|---|---|
--port |
8099 |
HTTP server port |
--host |
127.0.0.1 |
Bind address (0.0.0.0 to expose on LAN) |
--exports-dir |
— | Path to a dll_exports/ directory for ordinal-to-name resolution |
--log-level |
INFO |
DEBUG, INFO, WARNING, or ERROR |
Set GHIDRA_DEBUGGER_URL in .env if you change the default port or host so the bridge can find it.
http://127.0.0.1:8089/ by default# Quick health check
curl http://127.0.0.1:8089/check_connection
# Expected: "Connected: GhidraMCP plugin running with program '<name>'"
# Get version info
curl http://127.0.0.1:8089/get_version
If Ghidra MCP saves you engineering or reverse-engineering time, consider sponsoring the project.
GhidraMCP is designed for localhost-only development. The default configuration — HTTP server bound to 127.0.0.1, no authentication — is safe on a trusted single-user workstation and matches pre-v5.4.1 behavior.
If you expose the server beyond loopback, configure these three environment variables first. The server refuses to start on a non-loopback bind without a token.
| Env var | Effect |
|---|---|
GHIDRA_MCP_AUTH_TOKEN |
When set, every HTTP request must carry Authorization: Bearer <token>. Timing-safe comparison. /mcp/health, /health, /check_connection are exempt. |
GHIDRA_MCP_ALLOW_SCRIPTS |
Set to 1, true, or yes to enable /run_script_inline and /run_ghidra_script. Off by default as of v5.4.1 — these endpoints execute arbitrary Java against the Ghidra process. |
GHIDRA_MCP_FILE_ROOT |
When set to a directory path, filesystem-path endpoints (/import_file, /open_project, /delete_file, etc.) canonicalize the input and require it to fall under this root. Prevents path-traversal. |
export GHIDRA_MCP_AUTH_TOKEN=$(openssl rand -hex 32)
export GHIDRA_MCP_ALLOW_SCRIPTS=1 # only if your workflow needs it
export GHIDRA_MCP_FILE_ROOT=/srv/ghidra/inputs
java -jar GhidraMCPHeadless.jar --bind 0.0.0.0 --port 8089
When connecting to a shared Ghidra Server, GhidraMCP can suppress the password dialog automatically. It resolves credentials in this order (first non-empty value wins):
GHIDRA_SERVER_PASSWORD environment variable (or .env file in the Ghidra install directory or ~)~/.ghidra-cred — single-line password file in your home directory<ghidra-install-dir>/.ghidra-credUsername resolves similarly: GHIDRA_SERVER_USER env var → user.name system property.
If no password is found, Ghidra shows its normal GUI prompt. Set these in .env (see .env.template for the full block) to enable silent auth.
/run_script_inline or /run_ghidra_script, export GHIDRA_MCP_ALLOW_SCRIPTS=1. This is a deliberate breaking change; the prior default was unsafe.Cause: Plugin not enabled or installed incorrectly.
Solution:
Cause: Server not started or wrong port.
Solution:
# Linux/macOS
lsof -i :8089
# Windows
netstat -ano | findstr :8089
python -m debugger fails with ModuleNotFoundError for pybag or comtypesCause: The standalone debugger server uses optional Windows-only Python dependencies that are not installed by the base requirements file.
Solution:
python -m pip install -r requirements-debugger.txt
python -m debugger
If you have both a global Python and a project venv, make sure you install into and run from the same interpreter.
Cause: Server-side exception, often due to missing program data.
Solution:
Cause: Endpoint doesn't exist or wrong URL.
Solution:
curl http://127.0.0.1:8089/get_versionCause: JAR file in wrong location.
Solution:
~/.ghidra/ghidra_12.0.4_PUBLIC/Extensions/GhidraMCP/lib/GhidraMCP.jarCause: Ghidra JARs not installed in local Maven repository.
Solution:
# Windows (recommended)
python -m tools.setup install-ghidra-deps --ghidra-path "C:\ghidra_12.0.4_PUBLIC"
check_connection - Verify MCP connectivityget_metadata - Program metadata and infoget_version - Server version informationget_function_count - Return total function count for a programget_entry_points - Binary entry points discoveryget_current_address - Get cursor address (GUI only)get_current_function - Get function at cursor (GUI only)get_current_selection - Get current selection context (address + function)read_memory - Read raw bytes from memorysave_program - Save the current programexit_ghidra - Save and exit Ghidra gracefullylist_functions - List all functions (paginated)list_functions_enhanced - List with isThunk/isExternal flagslist_classes - List namespace/class names (paginated)search_functions_enhanced - Advanced function search with filtersdecompile_function - Decompile function to C pseudocodeforce_decompile - Force fresh decompilation (bypass cache)batch_decompile - Batch decompile multiple functionsget_function_callers - Get function callersget_function_callees - Get function calleesget_function_call_graph - Function relationship graphget_full_call_graph - Complete call graph for programget_function_signature - Get function prototype stringget_function_hash - SHA-256 hash of normalized function opcodesget_bulk_function_hashes - Paginated bulk hashing with filterget_function_jump_targets - Get jump target addresses from disassemblyget_function_metrics - Get complexity metrics for a functionget_function_xrefs - Get function cross-referencesanalyze_function_full - Comprehensive function analysisanalyze_function_completeness - Documentation completeness scorebatch_analyze_completeness - Batch completeness analysis for multiple functionsfind_similar_functions_across_programs - Cross-program similarity matchingbulk_fuzzy_match_functions - Bulk fuzzy match across all functionsdiff_functions - Diff two functions side by sidevalidate_function_prototype - Validate a function prototype stringcan_rename_at_address - Check if address can be renameddelete_function - Delete function at addresslist_segments - Memory segments and layoutlist_data_items - List defined data labels and values (paginated)list_data_items_by_xrefs - Data items sorted by xref countget_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 boundariessearch_byte_patterns - Search for byte patternscreate_memory_block - Create a new memory blockget_function_documentation - Export complete function documentationapply_function_documentation - Import documentation to target functioncompare_programs_documentation - Compare documentation between programsbuild_function_hash_index - Build persistent JSON indexlookup_function_by_hash - Find matching functions in indexpropagate_documentation - Apply docs to all matching instanceslist_data_types - Available data typessearch_data_types - Search for data typesget_data_type_size - Get byte size of a data typeget_valid_data_types - Get list of valid Ghidra builtin typesget_struct_layout - Get detailed field layout of a structurevalidate_data_type - Validate data type syntaxvalidate_data_type_exists - Check if a data type existscreate_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 typecreate_typedef - Create typedef aliascreate_union - Create union data typecreate_pointer_type - Create pointer data typeclone_data_type - Clone a data type with a new nameapply_data_type - Apply type to addressdelete_data_type - Delete a data typeconsolidate_duplicate_types - Merge duplicate typessuggest_field_names - AI-assisted field name suggestions for a structurecreate_data_type_category - Create a category folder in the type managermove_data_type_to_category - Move a type to a different categorylist_data_type_categories - List all data type categoriesimport_data_types - Import types from a GDT/header filelist_imports - Imported symbols and librarieslist_exports - Exported symbols and functionslist_external_locations - External location referencesget_external_location - Specific external location detaillist_strings - Extracted strings with analysissearch_memory_strings - Search strings by regex/substring patternlist_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 labelrename_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 settingclear_function_comments - Clear all comments for a functionlist_bookmarks - List all bookmarksset_bookmark - Create or update a bookmarkdelete_bookmark - Delete a bookmarkset_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-returningclear_instruction_flow_override - Clear flow override on instructionlist_calling_conventions - Available calling conventionsget_function_variables - Get all function variablesget_function_labels - Get labels in functionlist_scripts - List available scriptslist_ghidra_scripts - List custom Ghidra scriptssave_ghidra_script - Save new scriptget_ghidra_script - Get script contentsrun_ghidra_script - Execute Ghidra script by namerun_script_inline - Execute inline script codeupdate_ghidra_script - Update existing scriptdelete_ghidra_script - Delete scriptlist_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 projectcreate_project - Create a new Ghidra projectopen_project - Open an existing projectclose_project - Close the current projectdelete_project - Delete a projectlist_projects - List Ghidra projects in a directorycreate_folder - Create a folder in the project treemove_file - Move a domain file to another foldermove_folder - Move a folder to another locationdelete_file - Delete a domain file from the projectfind_next_undefined_function - Find undefined functionsfind_undocumented_by_string - Find functions by string referencefind_undocumented_functions_by_strings - Find undocumented functions by string referencesget_assembly_context - Get assembly contextanalyze_struct_field_usage - Analyze structure field accessget_field_access_context - Get field access patternscreate_function - Create function at addressanalyze_control_flow - Cyclomatic complexity and loop detectionanalyze_call_graph - Build function call graphanalyze_api_call_chains - Detect API call threat patternsdetect_malware_behaviors - Detect malware behavior categoriesfind_anti_analysis_techniques - Find anti-analysis techniquesfind_dead_code - Detect unreachable codeextract_iocs_with_context - Extract IOCs from stringsapply_data_classification - Apply data classification to addresseslist_analyzers - List all available Ghidra analyzersconfigure_analyzer - Enable/disable or configure an analyzerrun_analysis - Trigger Ghidra auto-analysis programmaticallyconnect_server - Connect to a Ghidra Serverdisconnect_server - Disconnect from Ghidra Serverserver_status - Check server connection statuslist_repositories - List repositories on the servercreate_repository - Create a new repositorylist_repository_files - List files in a server repository folderget_repository_file - Get metadata for a file in a server repositorycheckout_file - Check out a file from version controlcheckin_file - Check in a file with a commentundo_checkout - Undo a checkout without committingadd_to_version_control - Add a file to version controlget_version_history - Get full version history for a fileget_checkouts - Get active checkout statusterminate_checkout - Forcibly terminate a user's checkoutlist_server_users - List all users on the Ghidra Serverset_user_permissions - Set a user's repository access levelSee CHANGELOG.md for version history.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ AI/Automation │◄──►│ MCP Bridge │◄──►│ Ghidra Plugin │
│ Tools │ │ (bridge_mcp_ │ │ (GhidraMCP.jar) │
│ (Claude, etc.) │ │ ghidra.py) │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
MCP Protocol HTTP REST Ghidra API
(stdio/SSE) (localhost:8089) (Program, Listing)
# Recommended: direct Python-first workflow
python -m tools.setup ensure-prereqs --ghidra-path "C:\ghidra_12.0.4_PUBLIC"
python -m tools.setup build
python -m tools.setup deploy --ghidra-path "C:\ghidra_12.0.4_PUBLIC"
# Version bump (updates all maintained version references atomically)
python -m tools.setup bump-version --new X.Y.Z
The authoritative build system today is Maven. tools.setup, the VS Code tasks, and the documented deploy flow all build through pom.xml and write artifacts to target/. build.gradle remains in the repo as a manual fallback for direct Ghidra/Gradle users, but it is not the primary path.
| Command | What it does |
|---|---|
ensure-prereqs |
Install Python deps + Ghidra Maven JARs in one shot. Start here on a new machine. |
preflight |
Validate Python, build tool, Ghidra path, and JAR availability without making changes. Add --strict to also check network reachability. |
build |
Build the plugin JAR and extension ZIP via Maven (or Gradle when TOOLS_SETUP_BACKEND=gradle). |
deploy |
Copy the built extension into the Ghidra profile and patch FrontEndTool.xml for auto-activation. |
start-ghidra |
Launch the configured Ghidra installation. |
clean |
Remove Maven/Gradle build outputs (target/, build/). |
clean-all |
Remove build outputs plus local cache artifacts (.m2 Ghidra JARs, etc.). |
install-ghidra-deps |
Install only the Ghidra JARs into ~/.m2. Useful when the build environment changes. |
install-python-deps |
Install only the Python requirements files. |
run-tests |
Run the Java offline test suite (no live Ghidra needed). |
verify-version |
Check that version strings are consistent across pom.xml, CHANGELOG.md, and README.md. |
bump-version --new X.Y.Z |
Atomically update all version references. Pass --tag to create a git tag. |
Common flags accepted by most commands:
| Flag | Description |
|---|---|
--ghidra-path PATH |
Ghidra installation directory. Defaults to GHIDRA_PATH from .env. |
--dry-run |
Print actions without executing them. |
--force |
Reinstall Ghidra JARs even if already present (install-ghidra-deps, ensure-prereqs). |
--with-debugger |
Force-install debugger Python requirements (Windows only). |
--use-debugger-toggle |
Read INSTALL_DEBUGGER_DEPS from .env to decide whether to install debugger deps. |
--test TIER |
(deploy only) Opt into live deploy regression tiers such as release or debugger-live. |
--strict |
(preflight only) Also check network reachability for Maven Central and PyPI. |
Deploy test tiers are opt-in because benchmark tiers can import/reset
Benchmark.dll and BenchmarkDebug.exe in the active Ghidra project. Use
--test release before cutting releases, or set
GHIDRA_MCP_DEPLOY_TESTS=release in a local .env when you want every deploy
on your machine to run the live benchmark regression. See
Testing and Release Regression.
# Standard first-time setup and deploy
python -m tools.setup ensure-prereqs --ghidra-path "C:\ghidra_12.0.4_PUBLIC"
python -m tools.setup build
python -m tools.setup deploy --ghidra-path "C:\ghidra_12.0.4_PUBLIC"
# Preflight check before deploying
python -m tools.setup preflight --strict --ghidra-path "C:\ghidra_12.0.4_PUBLIC"
# Version bump and tag
python -m tools.setup bump-version --new X.Y.Z --tag
# Run offline Java tests
python -m tools.setup run-tests
# Show full help
python -m tools.setup --help
ghidra-mcp/
├── bridge_mcp_ghidra.py # MCP server (Python, 225 catalog entries)
├── src/main/java/ # Ghidra plugin + headless server (Java)
│ └── com/xebyte/
│ ├── GhidraMCPPlugin.java # GUI plugin (177 endpoints)
│ ├── headless/ # Headless server (183 endpoints)
│ └── core/ # Shared service layer (12 services)
├── debugger/ # Optional standalone debugger server (port 8099)
├── ghidra_scripts/ # Automation scripts for batch workflows
├── tests/ # Python unit tests + endpoint catalog
│ ├── unit/ # Catalog consistency, schema, tool function tests
│ └── endpoints.json # Endpoint specification (225 entries)
├── docs/ # Documentation
│ ├── prompts/ # AI workflow prompts (V5 documentation workflows)
│ ├── releases/ # Version release notes
│ └── project-management/ # Contributor planning docs (Gradle migration, etc.)
├── tools/setup/ # Build and deployment CLI (python -m tools.setup)
├── fun-doc/ # Internal RE curation tool — not part of the MCP plugin
│ # Priority-queue worker, LLM scoring, web dashboard.
│ # See fun-doc/README.md for details.
└── .github/workflows/ # CI/CD pipelines
Ghidra JARs must be installed into your local Maven repository (~/.m2/repository) before compilation.
This is a one-time setup per machine, and again when your Ghidra version changes.
-Deploy now installs these automatically by default.
The tool enforces version consistency between:
pom.xml (ghidra.version)--ghidra-path version segment (e.g., ghidra_12.0.4_PUBLIC)If these do not match, deployment fails fast with a clear error.
If you see a version mismatch error, align both values:
pom.xml → ghidra.version--ghidra-path version segment (ghidra_X.Y.Z_PUBLIC)Then rerun:
python -m tools.setup preflight --ghidra-path "C:\ghidra_12.0.4_PUBLIC"
# Windows
python -m tools.setup install-ghidra-deps --ghidra-path "C:\path\to\ghidra_12.0.4_PUBLIC"
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 install them from your Ghidra installation before building.
Automation entry point:
python -m tools.setupis the supported setup/build/deploy/versioning interface- use
ensure-prereqs,build,deploy,preflight,clean-all, andbump-versiondirectly- these commands currently use Maven as the canonical Java build backend
GhidraMCP includes a headless server mode for automated analysis without the Ghidra GUI.
# Build and run
docker-compose up -d ghidra-mcp
# Test connection
curl http://localhost:8089/check_connection
# Connection OK - GhidraMCP Headless Server v5.6.0
# 1. Load a binary
curl -X POST -d "file=/data/program.exe" http://localhost:8089/load_program
# 2. Run auto-analysis (identifies functions, strings, data types)
curl -X POST http://localhost:8089/run_analysis
# 3. List discovered functions
curl "http://localhost:8089/list_functions?limit=20"
# 4. Decompile a function
curl "http://localhost:8089/decompile_function?address=0x401000"
# 5. Get metadata
curl http://localhost:8089/get_metadata
| Endpoint | Method | Description |
|---|---|---|
/load_program |
POST | Load binary file for analysis |
/run_analysis |
POST | Run Ghidra auto-analysis |
/list_functions |
GET | List all discovered functions |
/list_exports |
GET | List exported symbols |
/list_imports |
GET | List imported symbols |
/decompile_function |
GET | Decompile function to C code |
/create_function |
POST | Create function at address |
/get_metadata |
GET | Get program metadata |
/create_project |
POST | Create a Ghidra project |
/list_analyzers |
GET | List available analyzers |
/server/status |
GET | Check Ghidra Server connection |
Environment variables for Docker:
GHIDRA_MCP_PORT - Server port (default: 8089)GHIDRA_MCP_BIND_ADDRESS - Bind address (default: 0.0.0.0 in Docker)JAVA_OPTS - JVM options (default: -Xmx4g -XX:+UseG1GC)See CONTRIBUTING.md for detailed contribution guidelines.
git checkout -b feature/amazing-feature)mvn clean package assembly:single -DskipTests or GHIDRA_INSTALL_DIR=/path/to/ghidra gradle buildExtension)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
| Metric | Value |
|---|---|
| Version | 5.6.0 |
| MCP Tools | 225 fully implemented |
| GUI Endpoints | 177 (GhidraMCPPlugin) |
| Headless Endpoints | 195 (GhidraMCPHeadlessServer) |
| Compilation | ✅ 100% success |
| Batch Efficiency | 93% API call reduction |
| AI Workflows | 7 proven documentation workflows |
| Ghidra Scripts | Automation scripts included |
| Documentation | Comprehensive with AI prompts |
See CHANGELOG.md for version history and release notes.
This project has benefited from the work of dedicated contributors:
@heeen — Significant contributions including:
Fuzzy function matching and structured diff for cross-binary comparison (#13)
Script execution improvements and bug fixes (#12)
New API endpoints: save_program, exit_ghidra, delete_function, create_memory_block, run_script_inline (#11)
Architectural vision: annotation-driven design, UDS transport, Python bridge optimization proposals
Ghidra Team - For the incredible reverse engineering platform
Model Context Protocol - For the standardized AI integration framework
Contributors - For testing, feedback, and improvements
Ready for production deployment with enterprise-grade reliability and comprehensive binary analysis capabilities.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"ghidra-mcp-server": {
"command": "npx",
"args": []
}
}
}