ghidra-headless-mcp
Analyzes native libraries (.so ELF files) extracted from Android apps, allowing disassembly, decompilation, renaming, and commenting of functions in native code pulled from APKs (e.g. via the Revoid jadx-based server).
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ghidra-headless-mcp
Minimal headless MCP server for Ghidra. No GUI, no plugin, no HTTP bridge: it runs Ghidra in-process through PyGhidra. Sibling of Revoid (jadx) and uses the same tool style.
Install
Requires Python 3.9+, JDK 21+ and Ghidra 11.3+ (tested on 12.1).
pip install git+https://github.com/samudoria/ghidra-headless-mcp # or the wheel from Releases{
"mcpServers": {
"ghidra": {
"command": "ghidra-headless-mcp",
"env": { "GHIDRA_INSTALL_DIR": "/opt/ghidra" }
}
}
}OpenCode
In opencode.json (project) or ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ghidra": {
"type": "local",
"command": ["ghidra-headless-mcp"],
"environment": { "GHIDRA_INSTALL_DIR": "/opt/ghidra" },
"enabled": true
}
}
}Related MCP server: REA (Reverse Engineer Anything)
Use with Revoid
For Android apps: in Revoid call list_native_libraries, then extract_native_library
to get a .so path on disk, and pass that path to load_binary here. Each server keeps its own renames and comments.
Tell the model to rename and comment as it goes; the notes are what the next analyst reads.
Tools
Tool | Description |
| Import a binary (ELF/.so, PE, Mach-O...) and start auto-analysis in the background. Call first. Returns immediately. Cached per file. |
| Load state: |
| Functions (name, address, signature); |
| Decompiled C ( |
| Assembly listing of a function. |
| Paginated, |
| Call graph neighbours of a function. |
| References to an address, function or string. |
| Shortest call chain from one function to another. |
| Hex dump of bytes at an address (max 4096). |
| Byte pattern search, hex with |
| Instructions with a given scalar operand (crypto constants, magic numbers). Paginated. |
| Apply a C prototype to a function ( |
| Change a local/parameter type as seen in the decompiled C. |
| Rename a function or label. |
| Rename a local/parameter seen in the decompiled C. |
|
|
All lists take limit (default 50) and offset; the reply contains next_offset (null at the end).
Edits are saved to the Ghidra project immediately and survive restarts: reloading the same file reopens your names and comments.
Load flow (non-blocking)
load_binary no longer blocks on Ghidra's multi-minute auto-analysis. The import is synchronous (seconds);
full analysis then runs on a background thread. The intended agent flow:
load_binary(path)— returns at once with{"state":"analyzing"|"ready", ...}.Read immediately, while analysis runs:
list_exports,list_imports,list_strings,list_functions,read_memory,search_bytes— the structural questions (which exports? JNI functions? suspicious imports/strings?).Poll
load_status()until{"state":"ready","analyzed":true}.Then call decompiler-driven tools:
get_function,get_disassembly,get_callers/get_callees/get_xrefs,call_path,search_constants,rename*,retype_variable,set_signature,add_comment.
Called before analysis is done, a decompiler-driven tool returns a soft
{"status":"analyzing","retry_after_s":N,"hint":...} — not an error and never an under-analyzed answer. With
analyze=False, the first such call starts analysis itself (triage cheaply, pay for analysis only when you decompile).
A re-analyzed cached project loads straight to ready with no re-analysis.
Environment
Variable | Purpose |
| Ghidra install directory (required) |
| Where projects are stored (default |
|
|
| Bind address for the HTTP transports (default |
| Per-function decompile timeout in seconds (default |
|
|
| Comma-separated analyzer names to skip when trimming (default |
HTTP / SSE
GHIDRA_INSTALL_DIR=/opt/ghidra GHIDRA_MCP_TRANSPORT=sse ghidra-headless-mcp
# SSE endpoint: http://127.0.0.1:8000/sse
# streamable-http: GHIDRA_MCP_TRANSPORT=streamable-http -> http://127.0.0.1:8000/mcp{
"mcpServers": {
"ghidra": { "type": "sse", "url": "http://127.0.0.1:8000/sse" }
}
}One binary is loaded at a time; load_binary closes the previous one. Only one server may open a given project at a time.
Logs go to stderr; stdout is reserved for the protocol.
Test
python tests/test_state.py # state machine, no Ghidra needed
GHIDRA_INSTALL_DIR=/opt/ghidra python tests/smoke.py ./some_binary some_function # end-to-end over stdioTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Evidence-oriented REA + Ghidra static-analysis workflows, read-only PE32 and Delphi VMT tools.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Self-hosted MCP server: 26 deterministic dev, security, and EVM tools.
Behavioral oracle for Rust crate APIs: runtime behavior, yank/advisory, deprecation, sig search
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for analyzing Android APK, DEX, or JAR files via a headless jadx engine, enabling LLM agents to query decompiled code, symbols, call graphs, and more.2GPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to inspect and decompile software they have no source for — Android APKs, Electron bundles, .NET assemblies, and Go, Rust or WASM binaries — plus adb device interaction, through a token-guarded Streamable HTTP MCP endpoint, stdio MCP, or a CLI. Ghidra-powered native binary decompilation can be opted in at startup for ELF, PE and Mach-O targets.6Do What The F*ck You Want To Public
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to inspect and reverse-engineer large binaries through bounded stdio JSON-RPC 2.0 tools for graph queries, SSA facts, path solving, runtime grounding, and mod scaffolding.1AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents (and a matching CLI) to inspect native binaries, JavaScript/Electron apps, .NET assemblies, Go/Rust/WASM artifacts, EVM bytecode, SQLite databases, recorded crashes, and websites without source code, explaining how features work and returning the evidence and limitations behind each conclusion. Analysis runs locally, using optional Hopper, Ghidra, or IDA providers for native targets.351,335 npmMIT