Skip to main content

Android APK MCP

CI Release GitHub stars Python 3.11+ MCP stdio

Windows Linux macOS Codex Claude Desktop

ADB import Split APKs SHA-256 verification DEX via JADX Flutter AOT via Jadart Android resources Smali via Apktool Native ELF JSON reports Ruff Black

Android APK MCP archives, compares, and analyzes Android releases locally. The CLI and MCP server can copy a base APK and every installed split for a selected package from an authorized Android device. The analysis recovers supported DEX and Flutter AOT output, decodes compiled Android resources, and inventories native ELF libraries.

Install

Requires Python 3.11+. Install the package from this repository or use the wheel from GitHub Releases.

git clone https://github.com/ahmedsaeed1-eng/android-apk-mcp.git
cd android-apk-mcp
python -m pip install .
android-apk-mcp --help

The setup scripts create a project virtual environment and write local MCP client configuration. The archive, comparison, and manifest tools work with the Python installation above.

Windows

& .\scripts\setup.ps1
& .\.venv\Scripts\Activate.ps1
android-apk-mcp --help

Linux and macOS

Install Python 3.11+ with the venv module and Bash. On Ubuntu, install python3-venv if the system Python does not include it.

bash scripts/setup.sh
source .venv/bin/activate
android-apk-mcp --help

Analyze an APK or a device

android-apk-mcp engines
android-apk-mcp analyze-apks base.apk split_config.arm64_v8a.apk
android-apk-mcp devices
android-apk-mcp analyze-device org.example.app --serial DEVICE_SERIAL
android-apk-mcp analysis-inputs ANALYSIS_ID --limit 25

For direct import, connect the Android device, enable USB debugging, and approve the normal Android prompt. With one connected device, the serial is optional. Import verifies that every installed APK still belongs to the same installation and checks each copied file's length. Use packages that you own or have permission to analyze.

Use import, list, compare, and export to work with archived versions. Set --library before the command or set ANDROID_APK_MCP_LIBRARY to choose a storage directory. Editable installs use the checkout's data/ directory. Wheels and other regular installs use a per-user directory.

Optional analysis engines

  • DEX uses JADX 1.5.6 and Java 11 or newer. Set MCP_JADX_JAR to the absolute path of the release's bundled JAR. An editable install also detects .tools/jadx/jadx.jar in the checkout.
  • Flutter AOT uses Jadart with its disassembly extra. The setup scripts pin the same source revision. The server uses Jadart from its Python environment or the absolute executable path in MCP_JADART_EXE.
  • USB import uses Android Platform Tools. Put adb on PATH.

On Linux and macOS, install Git, curl, and Java, then run:

bash scripts/setup-analysis.sh
.venv/bin/android-apk-mcp engines

The Bash installer checks the official JADX download against its pinned SHA-256 and verifies the installed Jadart and Capstone runtime. To install one engine, pass --jadx-only or --jadart-only.

On Windows, download the bundled JAR from the JADX CLI distribution and run:

& .\scripts\setup-analysis.ps1 -JadxJar 'C:\Tools\jadx\lib\jadx-1.5.6-all.jar'
& .\.venv\Scripts\android-apk-mcp.exe engines

The engines process APK contents on your computer. See Third-party components for the projects and pinned sources.

Analysis output

The analysis directory contains report.json, an inventory, and artifacts tied to the original APK hash, split, and member.

Input Output
DEX and ARM64, built in Dalvik register operations and branch graphs, or ARM64 instructions and register effects
DEX Reconstructed Java and separate low-level fallback files from JADX
DEX, optional Smali output from the pinned Apktool release
Flutter AOT Approximate Dart or verified class structure from Jadart
Compiled Android resources Decoded manifests, resource tables and files by split, with a built-in XML fallback
Native libraries ELF architecture, load segments, sections and shared-library dependencies

Inspect each stage status to see which inputs were recovered and which hit format, tool, or resource limits. Static reconstruction cannot recover the original source exactly. Native reports describe ELF structure and dependencies.

Per-DEX reports can include a short-class-name signal from a bounded sample. Short names are a heuristic and do not identify the tool that produced them.

Built-in code and XML readers

Use the release ID from import or list. These commands run locally with Python and report the SHA-256 of the APK containing the selected member.

android-apk-mcp decode-dex RELEASE_ID --class 'Lorg/mcp/demo/MainActivity;' --method onCreate --signature '(Landroid/os/Bundle;)V'
android-apk-mcp decode-arm64 RELEASE_ID lib/arm64-v8a/libapp.so --instructions 128
android-apk-mcp decode-xml RELEASE_ID AndroidManifest.xml

Use --split for a member in an installed split, --member for a different root DEX, or --symbol to select an exact ARM64 function. The corresponding MCP tools are decode_dex_method, decode_arm64_function, and decode_android_xml.

The DEX reader supports standard little-endian DEX versions 035–040. Its register pseudocode reports the normal control-flow blocks and leaves unsupported instruction forms visible as bytecode. The ARM64 reader labels an executable-section sample when a function boundary is unavailable. ARM64 coverage counts decoded and unknown instruction words. The XML reader preserves numeric resource references where names are unresolved. JADX supplies resource-table decoding and whole-APK Java output, Apktool supplies optional Smali output, and Jadart supplies Flutter AOT recovery.

Optional Smali pass

Download the official Apktool 3.0.3 JAR, set MCP_APKTOOL_JAR to its absolute path, and run:

android-apk-mcp analyze-apks --smali base.apk feature.apk
# Or analyze an existing release:
android-apk-mcp analyze RELEASE_ID --smali

The JAR must match the release SHA-256. Apktool receives staged DEX entries and publishes Smali by split. In Codex or Claude Desktop, set MCP_APKTOOL_JAR in the server's environment and pass include_smali: true to start_analysis.

Review a release you maintain

android-apk-mcp review-manifest RELEASE_ID
android-apk-mcp review-source path/to/config.py

The manifest review reports the declared or default setting, its origin, and components that warrant review. A reference to Network Security Config identifies where to look for per-domain rules. Component findings describe declarations. Credential findings examine one source file at a time and return candidate types and line and column numbers with values redacted.

Runtime measurements

For an app you can build and benchmark, run Jetpack Macrobenchmark and pass the exported benchmark JSON to the CLI:

android-apk-mcp runtime-report benchmarkData.json

The summary includes metric ranges and medians from recorded runs. You can also put the JSON in the local inbox and use summarize_android_benchmark through MCP.

Connect an MCP client

Install the package in the Python environment used by your client. The server uses local stdio and returns structured tool results.

Codex

Add the server to your Codex configuration. Use the absolute path to .venv/bin/python or .venv\Scripts\python.exe.

[mcp_servers.android-apk-library]
command = "/absolute/path/to/python"
args = ["-m", "android_apk_mcp.cli", "serve"]

Claude Desktop

Add the entry under mcpServers in the Claude Desktop configuration. An absolute Python path lets the client start the correct environment from the desktop.

{
  "mcpServers": {
    "android-apk-library": {
      "command": "/absolute/path/to/python",
      "args": ["-m", "android_apk_mcp.cli", "serve"]
    }
  }
}

Available tools

Tools Purpose
list_inbox, import_release, export_release Import APK sets and export verified copies
list_releases, inspect_release, list_manifest, list_files Browse releases, declared components and package entries
compare_releases Compare APK hashes, permissions, components, splits and entry metadata
check_analysis_engines, list_android_devices Check local engine and device availability
start_analysis, start_device_analysis, get_analysis, list_analyses Start and track analysis jobs
list_analysis_inputs Page through input provenance and stage results
decode_dex_method, decode_arm64_function Read selected instructions with the built-in Dalvik or ARM64 reader
decode_android_xml Decode an archived Android manifest or resource XML
review_android_manifest Review archived application flags and component declarations
review_source_credentials Locate redacted credential candidates in one source file placed in the inbox
summarize_android_benchmark Read metrics from an AndroidX Benchmark JSON export
record_behavior, implementation_brief Save developer observations and summarize a release

Place APKs in the library's inbox/ for MCP imports. An analysis start returns an ID. Read its progress with get_analysis; completed results include paths to generated artifacts.

Development

The repository includes an original Java sample with two versions and a Flutter ARM64 sample. They are built using the Android and Flutter SDKs.

python -m pip install -e '.[dev]'
python -m ruff check src tests
python -m black --check src tests
python -m unittest discover -s tests -v

Ubuntu CI builds the Java and Flutter APKs and runs the full suite with both analysis engines. macOS CI runs the same tests using those fixtures with its own engine installations. Windows CI builds the Java APKs and exercises JADX and the MCP lifecycle. Release checks also install and run the wheel outside the checkout.

See Contributing, Changelog, Security reporting, and Third-party components.

Metadata

Release files for android-apk-mcp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for android-apk-mcp 0.3.0
File Size Uploaded Provenance Actions
android_apk_mcp-0.3.0.tar.gz 106.8 kB With provenance Details for android_apk_mcp-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for android-apk-mcp 0.3.0
File Interpreter ABI Platform Actions
android_apk_mcp-0.3.0-py3-none-any.whl Python 3 none any Details for android_apk_mcp-0.3.0-py3-none-any.whl

Total release size: 187.6 kB

Release files / android_apk_mcp-0.3.0.tar.gz

Download URL android_apk_mcp-0.3.0.tar.gz
Size 106.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eb8bc7decdc7b7c6cda1815727b8f22552a65c2c5fe40696e0bef371cd8e9885
BLAKE2b-256 checksum
How to use checksums
876eaf1b7785bd60b2ff07c1f9a378a26aa7c7deaaec2bffbc6f142cc0ead5dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / android_apk_mcp-0.3.0-py3-none-any.whl

Download URL android_apk_mcp-0.3.0-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13df52f43ccbc8ee563b74118af9c387fcad4e8dc1933c5484ebcb824dd209c8
BLAKE2b-256 checksum
How to use checksums
c5b70f3efd3edb57eb0755137c6fc308333e74c270e397a5ce73e6716c37bf7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for android-apk-mcp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for android_apk_mcp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page