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).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ghidra-headless-mcpload ./libnative.so, list its functions, and decompile the one matching 'copy'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: SO Analyzer MCP
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 + auto-analyze a binary (ELF/.so, PE, Mach-O...). Call first. Cached per file. |
| 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.
Environment
Variable | Purpose |
| Ghidra install directory (required) |
| Where projects are stored (default |
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
GHIDRA_INSTALL_DIR=/opt/ghidra python tests/smoke.py ./some_binary some_functionThis server cannot be deployed
Maintenance
Related MCP Connectors
Headless CAD engine & MCP server for 2D/3D drafting, solids, DXF/SVG export, and automation.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Self-hosted MCP server: 26 deterministic dev, security, and EVM tools.
Related MCP Servers
- AlicenseBqualityAmaintenanceA Model Context Protocol server that connects to a custom JADX fork (JADX-AI) and enables local LLMs to interact with decompiled Android app code for live reverse engineering assistance.32805Apache 2.0
- FlicenseNot gradedqualityFmaintenanceEnables analysis of native Android libraries (SO files) and Flutter applications, including decompilation, function identification, SSL certificate bypass patching, and binary modification through 30+ specialized tools.12-
- 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
- AlicenseAqualityAmaintenanceMCP server integrating Rizin reverse engineering, RzGhidra decompiler, and capa for binary analysis, enabling LLMs to open binaries, identify capabilities, extract function addresses, and decompile to C pseudocode.104MIT