jadx-headless-mcp

English | 简体中文
Headless MCP server for Android APK static analysis, built directly on jadx-core. No JADX GUI required, no Python adapter, no plugin to install — just one JVM process speaking MCP over stdio.
Why
jadx is two parts: the jadx-core decompiler engine, and a GUI wrapped around it for a human to click through by hand.
Give a capable LLM direct access to jadx-core and the GUI loses its reason to exist. The model walks the same class tree, resolves the same xrefs, reads the same source — headless and scriptable. As models get stronger, Java-layer reverse engineering increasingly runs end to end from the model, without a reverse engineer driving it by hand.
So this server drops the GUI and exposes jadx-core as ~26 MCP tools over stdio.
Tools
Session management
| Tool | Description |
|---|
status | Whether an APK is loaded; path, class/resource counts, load duration |
load_apk | Load an APK / DEX / JAR (replaces any current one) |
unload_apk | Release the loaded APK and free memory |
Static analysis (require a loaded APK)
| Tool | Description |
|---|
get_app_info | Package name, version, minSdk/targetSdk, permissions |
get_android_manifest | Full decoded AndroidManifest.xml |
get_main_activity_class | LAUNCHER activity FQN |
get_main_application_classes_names | FQNs of classes under the Manifest package — a lightweight "is the right APK loaded" probe |
list_classes | Paginated class FQN list |
search_classes_by_keyword | Substring search over class FQNs |
get_class_source | Decompiled Java source. Auto-falls back to smali when jadx hits anti-decompile stubs (marker // [jadx java-decompile failed → smali]; smali_fallback=false to opt out). Pageable via offset (UTF-8 byte offset into full source); header reports total_bytes/next_offset. Resolves inner/$Companion names. |
get_class_summary | Class skeleton (method signatures, fields, inner-class names) — no method bodies |
get_smali_of_class | Smali disassembly. Pageable via offset (byte offset into full smali); header reports total_bytes/next_offset |
get_methods_of_class | Method signatures |
get_method_by_name | Java source of a single method; same smali fallback as get_class_source |
get_method_body | One method as Java-if-possible-else-smali, in a JSON envelope (mode, fell_back, markers); handles overloads |
get_method_smali | Smali of a single method (all overloads), sliced from the class disassembly |
get_inner_classes | Inner/nested classes with both dotted full_name and raw $-joined raw_name |
resolve_class | Resolve an inner/$Companion/fuzzy class name to its exact FQN, or list candidates |
get_fields_of_class | Field list with types |
search_method_by_name | Global method search (includes inner-class methods) |
get_xrefs_to_class | References to a class |
get_xrefs_to_method | References to a method |
get_xrefs_to_field | References to a field |
get_strings | String resources with optional filter |
list_resource_files | Resource file names |
get_resource_file | Resource file content (text or base64) |
Build
Requires JDK 17+.
./gradlew installDist
Output: build/install/jadx-headless-mcp/bin/jadx-headless-mcp (and .bat on Windows).
For a single portable fat jar:
./gradlew shadowJar
# build/libs/jadx-headless-mcp-<version>-all.jar
No build needed? Prebuilt artifacts (fat jar + distribution zip) are attached to every GitHub Release — download one and point your MCP config at it directly.
Run
Empty start (load an APK later via load_apk tool):
./build/install/jadx-headless-mcp/bin/jadx-headless-mcp
Or eager-load on startup:
./build/install/jadx-headless-mcp/bin/jadx-headless-mcp \
--apk /path/to/app.apk \
--max-source-bytes 200000
The server speaks MCP over stdio. Logs go to stderr.
Startup options
Pass these as args alongside --apk / --max-source-bytes (all optional; load_apk can override the per-APK ones at runtime):