Skip to main content
Glama
android-reserve-mcp

android-reserve-mcp

by lonnnnnng

android-reserve-mcp

聚焦Android产物、DEX、JS、SO、资源和运行观测的MCP服务。使用本地CLI和静态解析器,复杂查询按需启动REA后端;对模型提供20个分组入口,避免加载整个通用逆向工具集。

当前 GitHub Release 为 v0.5.2:下载 Release,源码仓库:lonnnnnng/android-reserve-mcp。0.5.2尚未发布到 npm registry;可从 GitHub Release 下载 tarball,或按下方说明从源码运行。版本变更及验证边界见变更记录、实施进展和验证记录。

OpenCode 连接名和专用模式名均为 android-reserve,协议服务名与 npm 包名为 android-reserve-mcp。OpenCode 工具前缀为 android-reserve_。各类应用的覆盖范围见 能力与限制。

先准备环境

完整能力依赖与安装检查见 环境与工具依赖。 最小启动需要 Node.js ≥26.12.1;APK 摘要需要 Python ≥3.11。完整静态分析还需要完整 JDK 17+、JADX CLI、apktool、Android SDK、ripgrep、LLVM readelf,以及 REA 6.9.0 和独立的 JADX headless MCP 0.7.1 JAR。动态分析还需要 Frida Node binding 和可连接的 Android 设备环境。

发布后可通过npm install android-reserve-mcp安装CLI;首发前请按下方步骤从源码运行,或从Release候选tarball安装。npm/GitHub首次发布状态见首发待办。

JS分析依赖随npm安装,不需要浏览器。Native函数分析需要配置可用provider;本机已验证Ghidra12.2、macOS ARM64原生decompiler及独立JDK25。Hermes HBC84、Flutter/Dart3.11.5、ILSpy托管程序集、Godot4.3脚本字节码已有自有样本通过;这不等于完整RN/MAUI/游戏恢复。可选环境、固定参数和安装记录见 引擎说明与引擎安装。

安装本项目依赖:

cd /absolute/path/android-reserve-mcp
npm ci --ignore-scripts
node src/cli.js --help

上面跳过依赖安装脚本,可用于基础静态能力与自动测试。java-methods/trace-java还需要frida-compile的Node原生binding;本仓库npm 11配置已锁定允许frida@17.26.3。安装后用npm install-scripts ls确认授权,再执行npm rebuild frida --ignore-scripts=false并验证binding可导入。若作为依赖装入另一个npm项目,项目级授权不会继承;需在那个项目确认锁文件中Frida确为17.26.3后,显式批准该包脚本。设备注入仍由REA的Frida17.23.2完成,勿因此更换设备server版本。安装条件和许可见环境文档。

在 MCP 客户端配置中合并下面的服务器项,替换两个绝对路径,不覆盖原有服务器或模型设置:

{
  "mcp": {
    "android-reserve": {
      "type": "local",
      "command": ["node", "/absolute/path/android-reserve-mcp/src/cli.js", "--allowedRoots", "/absolute/path/apk-projects"],
      "enabled": true,
      "timeout": 30000
    }
  }
}

这是 OpenCode 的格式;通用 stdio 客户端使用相同 command/args,参见 示例。启动命令保持运行等待 MCP 消息是正常现象。先让客户端调用 doctor,再分析 APK。

Related MCP server: OpenAPK

工具入口

工具

能力

doctor

检查依赖路径、headless JAR 校验、后端状态,不连接设备

apk

ZIP/DEX/ABI/SHA256、Manifest、签名复验

decode

JADX Java 导出、apktool 资源/smali 解包,可报告部分成功

dex

类/方法/静态引用、mappingPath;Kotlin原始metadata/suspend/inline、协程/Compose候选及JavascriptInterface声明

packages

APK集合包名/长版本/签名/split依赖校验、聚合DEX/分模块资源、AAB派生与APKS显式设备spec选择

managed

store v1/v2/v3、ELF封装与XALZ/LZ4、XAZS/Zstd有界提取

webview

显式设备/包/PID的已开放WebView调试会话,DOM/源码/网络与正文采集

evidence

跨任务内容哈希、签名、词法绑定、受限运行调用ID的持久证据索引

search

导出源码的文本检索,给出文件和行号

resources

解码资源并按语言分页读取字符串;view-events列出XML android:onClick声明候选,不代表DEX/运行确认

native

ELF/JNI;独立target的函数清单、伪代码、引用/callers/callees、provider状态;Go/Rust元数据接口

artifact

文件/目录/嵌套归档索引、magic/ABI/框架候选、按chain安全提取

script

JS/TS/JSX/Flow静态索引、格式化及显式source map位置映射

framework

可选引擎状态/探测/固定CLI分析:Hermes、Flutter、ILSpy、Godot、IL2CPP、Ark

device

ADB 列设备、属性、包、进程、有限 logcat,只读操作

frida

attach/spawn、Java精确方法观测、动态JNI注册/撤销、导出名或模块RVA Native观测、Java↔Native同调用关联、load/unload/resume/status/close

rebuild

apktool 重建、zipalign、自选 keystore 签名并复验

jobs

任务列表、状态、取消

artifacts

列任务文件,按字节分页读取结果/日志/源码

guidance

按需读取本地 Android 逆向 Skill 与参考资料

一个完整调用流程

工具参数示例(在客户端发起工具调用,并非 shell 命令):

{"tool":"apk","arguments":{"action":"inspect","path":"/absolute/path/apk-projects/app.apk"}}

长任务立即返回 id。把它作为 jobId 查询:

{"tool":"jobs","arguments":{"action":"status","jobId":"<返回的 id>"}}
{"tool":"artifacts","arguments":{"action":"read","jobId":"<返回的 id>","path":"result.json","offset":0,"limit":12000}}

根据 nextOffset 继续读取。succeeded、partial、failed、canceled、interrupted 是不同终态;失败先看 error 和任务日志,不能仅凭拿到 id 判断成功。

建议:doctor → artifact → apk/decode/dex/script/native/framework → artifacts。artifact的框架指纹是候选;source map、静态引用和运行证据有不同语义,不能相互冒充。Native用法见 引擎说明。

Frida:先明确设备与目标;spawn 创建暂停进程,读取任务结果中的 session_id 后执行 load → resume → status → close。attach 对已运行进程操作,不需要 resume。脚本可能改变目标行为,服务不会自行生成或加载绕过脚本。

Java专项:默认先java-methods读取app loader的真实重载;自定义loader先java-loaders复制唯一selector,再读取真实重载,卸载枚举脚本,再以显式argumentTypes调用trace-java。需要关联JNI时,使用该action的nativeHooks,不要另load一份Native脚本后按时间猜关联。加载成功只说明脚本被接受,spawn须先resume,再从status确认java-hook-installed和实际事件;详见Java/JNI调用示例。

隐藏JNI专项:spawn后先trace-jni并确认ready再resume;匹配注册尝试与成功返回,取得类/方法/签名/模块RVA。卸载观测后,以相同模块RVA进行Native或Java联合追踪。RVA栈为候选地址,不能冒充精确调用链;完整流程、预算与边界见动态JNI说明。

CLI 与数据位置

参数

说明

--allowedRoots /path

允许输入的目录,可重复;默认启动时 cwd

--workspace /path

分析工作目录,默认 ~/.local/share/android-reserve-mcp

--skillRoot /path

本地 Skill 根目录,可重复;默认 ~/.config/opencode/skills

--no-rea

禁用后端,只使用本地能力

--version / --help

查看版本/参数

任务写入 workspace/jobs/<id>/,不会自动删除。允许目录与工作目录使用 realpath 校验;产物读接口限定在对应任务目录。工作目录本身也可作为后续输入。此路径限制不能约束 Frida 脚本在目标进程中的行为,服务也不是执行不可信 APK 解析器的操作系统沙箱。

文档与验证

npm run check
npm test
node scripts/smoke.mjs
npm run check:pack
npm run smoke:release

npm test 使用自有样本和模拟后端,不连接设备;smoke:release会在临时目录安装实际npm tarball并验证stdio工具清单。完整静态 smoke 需要静态工具链、Android SDK platform 和headless JAR,生成自有APK/临时签名,不安装或启动APK。

MIT © long。

Available Tools

20 tools
apkB
Read-only

APK ZIP/DEX/ABI 摘要、签名复验或 Manifest 摘要。返回任务;随后读 result.json。

Inputs: path (required), action (required).

artifactA
Destructive

按内容识别产物、嵌套包/模块/ABI与框架候选;支持文件或目录。extract按inspect返回的chain定向提取到任务目录,不覆盖原文件。

Inputs: path (required), action (required), chain.

artifactsA
Read-only

列任务产物或按字节 offset 读取文件;只读本服务任务目录,最多 32KB 一页。

Inputs: jobId (required), action (required), path, limit, +1 more.

decodeB
Destructive

JADX/apktool 解包到独立任务目录;报告部分失败,不覆盖已有工程。

Inputs: path (required), engine, timeoutSeconds.

deviceB
Read-only

ADB 设备列表或明确 serial 的 getprop/packages/processes/logcat;不安装/卸载。

Inputs: action (required), limit, serial.

dexC
Read-only

精确DEX类/方法/引用;kotlin读取原始metadata/suspend/inline/JVM签名、协程/Compose候选及JavascriptInterface声明。class/method可用mappingPath。

Inputs: path (required), action (required), query, className, +3 more.

doctorA
Read-only

检查本机 Android 依赖、允许目录和后端状态;不连接设备或启动 REA。

Inputs: no named parameters.

evidenceC
Read-only

合并已完成任务的持久证据索引,按内容哈希/签名/同脚本调用ID查询;不把时间接近、相同路径或PID当跨任务关联。

Inputs: action (required), kind, limit, query, +3 more.

frameworkA
Destructive

列可选引擎/探测/分析:Hermes、Blutter、ILSpy、GDRE、IL2CPP、Ark。仅调用配置好的固定CLI,不自动安装。Blutter需显式允许下载构建。

Inputs: action (required), path, engine, metadataPath, +1 more.

fridaB
Destructive

明确设备的attach/spawn/load/resume/status/close;java-loaders枚举唯一selector,java-methods读取默认或显式唯一loader方法重载,trace-java需显式argumentTypes,可同agent nativeHooks按线程/调用范围关联JNI。trace-jni观测未来动态注册/撤销;Native选择symbolName或模块rva二选一,未加载模块等待时间有限且可缩短。unload只撤销本服务scriptId。

Inputs: action (required), pid, rva, deviceId, +18 more.

guidanceB
Read-only

列或按需分页读取本地 Android 逆向 Skill/参考文档;不自动执行其中命令。

Inputs: action (required), name, path, limit, +1 more.

jobsB
Destructive

列任务、查状态或取消长任务;长结果不直接塞进上下文。

Inputs: action (required), jobId.

managedB
Destructive

离线inspect/extract已核验的.NET assembly store或XALZ/XAZS压缩程序集;支持有_assembly_store符号的ELF封装,不执行目标。提取后用framework.ilspy分析PE/CLI。

Inputs: path (required), action (required).

nativeC
Destructive

ELF/JNI/Go/Rust;open独占后端并返回任务,结果含targetId。随后functions/function/references/callers/callees/status,最后close;providers检查引擎。

Inputs: action (required), path, provider, targetId, +3 more.

packagesC
Destructive

对显式所选APK集合校验包名/版本/全部签名证书/split依赖;APKS需members,不能混合设备变体。decode只在一致性通过后聚合DEX并按模块导出资源。

Inputs: path (required), action (required), engine, members, +1 more.

rebuildA
Destructive

重建 apktool 工程或用明确 keystore 签名并复验;密码使用环境变量名,不自动安装。

Inputs: path (required), action (required), alias, keystore, +1 more.

resourcesC
Read-only

资源字符串分页;可扫描已解码XML或APK中的View android:onClick声明,输出待DEX核对的候选,不证明运行时行为。

Inputs: path (required), limit, action, locale, +2 more.

scriptB
Read-only

离线JS/TS/JSX/Flow索引或格式化,返回函数/依赖/调用点/字符串/URL;不执行代码。map只读取显式mapPath映射位置。

Inputs: path (required), action (required), line, column, +2 more.

webviewA
Destructive

明确serial/packageName/pid的已开放调试WebView。discover/open后scripts/source/dom/network/body,最后close。只采集Network启用后事件;不用外部URL,不强制开调试。

Inputs: action (required), pid, serial, rootRead, +5 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 20 tools

    Disambiguation3/5

    Most tools target distinct resources (dex, native, frida, webview, resources, script), and several descriptions explicitly disambiguate neighbors (search is not DEX xref, native vs frida static/dynamic). However the `artifact` (content-based identification/extraction) vs `artifacts` (list/read task files) pair is a near-collision that will cause misselection, and `apk`/`packages`/`decode` plus `framework`/`managed` have overlapping edges that only the long descriptions disentangle.

    Naming Consistency3/5

    Naming is consistently lowercase single tokens throughout, which is readable, but it never encodes an action (no verb_noun pattern) so the operation must be inferred from the description. Singular/plural collisions (`artifact` vs `artifacts`) and role-mixed tokens (`doctor`, `guidance`, `jobs`) weaken predictability.

    Tool Count3/5

    20 tools is at the heavy end, though the domain genuinely spans static analysis, native, .NET, dynamic instrumentation, WebView, devices, rebuild, and job/artifact management. Each tool roughly maps to a real capability, but the set is large enough that a few (guidance, doctor, jobs, artifacts) could plausibly be folded together.

    Completeness4/5

    Coverage is broad: inspect/decode APK, DEX and resource queries, native and managed analysis, Frida tracing, WebView debugging, rebuild/sign, search, evidence, and job orchestration form a coherent workflow. Minor gaps exist — device interaction stops at getprop/packages/processes/logcat with no file push/pull or device-side artifact retrieval, and keystore creation is assumed rather than provided.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables mobile application penetration testing with 83+ tools covering Frida instrumentation, APK analysis, decompilation, signing, emulator support, and system compatibility checks.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables offline Android package analysis by loading APK, DEX, JAR, class, and XAPK files to inspect app metadata, manifests, classes, methods, resources, strings, and cross-references, and to export decompiled Java sources through CRUDE MCP-AQL tools.
      AGPL 3.0
    • A
      license
      C
      quality
      A
      maintenance
      Enables AI agents to inspect APKs and resources, analyze native libraries, trace runtime behavior with Frida, and connect app screen actions to code through ADB.
      89
      MIT