StaticApkAuditor MCP
StaticApkAuditor MCP
一个模型上下文协议(MCP)服务器,通过 Claude Code / Claude Desktop 中的自然语言命令,提供基于 Apktool 的反编译功能,以及一套用于 Android APK 安全评估的自定义静态分析启发式规则。
用途
你给它一个 APK。它进行反编译,然后为 AI 助手提供一组工具来分析结果——攻击面、权限、硬编码密钥、加密用法、原生库、业务逻辑候选点——并交叉核验来自 MobSF 等其他工具的发现。每次调用都会以 Markdown 报告的形式记录到磁盘,因此你最终得到的是审计追踪记录,而不仅仅是聊天记录。
这是静态分析辅助工具,不是完整的渗透测试。 多个工具产生的是供人工/动态验证的候选点,而非已确认的漏洞——这一点在工具描述和内置提示中都有明确说明。运行时行为(竞态条件、工作流绕过、实际数据外泄)需要动态测试(Frida、Burp/mitmproxy、真实设备)来确认。
Related MCP server: GDA-MCP-Server
快速开始
假设 Java、Apktool 和 Python 3.10+ 已安装(如果未安装,请参阅下面的前置要求)。
# 1. Set up the project folder
mkdir static-apk-auditor && cd static-apk-auditor
# 2. Create a venv and install the one dependency
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# 3. Sanity check — should hang waiting for stdio input, Ctrl+C to stop
python3 server.py
# 4. Register with Claude Code (adjust paths to your actual location)
claude mcp add static-apk-auditor \
--env APKTOOL_WORK_DIR=$(pwd)/data \
-- $(pwd)/venv/bin/python3 $(pwd)/server.py
# 5. Verify it connected
claude mcp list然后,在 claude 会话中,在运行 claude mcp add 的同一文件夹内(注册默认限定在该文件夹范围内):
/mcp__static-apk-auditor__security_audit
/absolute/path/to/some.apk或者直接用自然语言提问——模型会自行调用 decode_apk 和其余工具:
Decompile /absolute/path/to/some.apk and give me a quick security triage.有关所有可用功能,请参阅下面的提示和工具,或在 Claude Code 会话中运行 /mcp 以交互方式浏览。
项目结构
static-apk-auditor/ # your folder can be named anything — this is just an example
├── server.py # the MCP server — single file, FastMCP-based
├── requirements.txt # just "mcp"
├── README.md # this file
├── prompts/
│ ├── security_audit.md # 16-point checklist, OWASP Mobile Top 10 mapping
│ └── mobsf_review.md # MobSF finding validation workflow
├── venv/ # created locally, not part of the repo
└── data/ # created automatically on first decode_apk call
# (this is APKTOOL_WORK_DIR — see Configuration below)运行时数据布局(自动创建)
你分析的每个 APK 都会在 APKTOOL_WORK_DIR 下获得自己的独立文件夹:
$APKTOOL_WORK_DIR/<apk_filename_without_extension>/
├── source/
│ └── <original>.apk # copy of the APK you pointed the tool at
├── decoded/
│ ├── AndroidManifest.xml
│ ├── smali/, smali_classes2/, ...
│ ├── res/, assets/, lib/
│ └── ... # apktool's decompiled output
├── reports/
│ ├── 20260706_175359_809_decode_apk.md
│ ├── 20260706_175412_112_analyze_manifest.md
│ ├── 20260706_175430_501_check_root_detection.md
│ └── ... # one markdown file per tool call, ever
└── final_reports/
├── 20260706_223500_123_security_audit.md
└── 20260706_224100_456_mobsf_review.md
# the finished, synthesized reports
# (Summary + Detailed Findings + Risk Table),
# saved explicitly via save_final_report每次工具调用——无论调用哪个工具,无论成功还是失败——都会在该 APK 的 reports/ 文件夹中写入一个带时间戳的 Markdown 文件。这不是可选的逐调用日志记录;它是一个装饰器(@logged_tool),应用于每个已注册的工具,因此任何调用此服务器的操作都不会被遗漏。每份报告包含工具名称、调用时使用的参数以及完整输出。
reports/ 和 final_reports/ 用途不同:reports/ 是原始调用日志(每次单独的工具调用,便于审计具体检查了什么以及何时检查),而 final_reports/ 只保存经过整理的、人类可读的总结报告——即你实际交付给开发人员或客户的内容。security_audit 和 mobsf_review 提示都以强制调用 save_final_report 结束,正是该调用填充了 final_reports/;如果没有该调用,综合报告只存在于聊天响应中,不会持久化到磁盘上的任何位置。
前置要求
1. Java JDK 8+(Apktool 需要)
# Ubuntu/Debian
sudo apt update && sudo apt install default-jdk
# macOS
brew install openjdk
java -version2. Apktool
# Ubuntu/Debian
sudo apt install apktool
# macOS
brew install apktool
apktool --version3. Python 3.10+
python3 --version4.(可选)aapt——用于在不先解码的情况下获取完整的 get_apk_info 元数据
brew install aapt # or: brew install --cask android-commandlinetools如果未安装 aapt,get_apk_info 会回退到解析已解码的 AndroidManifest.xml,而不是静默失败。
安装
git clone <your-repo-or-just-copy-the-files> static-apk-auditor
cd static-apk-auditor
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt健全性检查:
python3 server.py
# Should hang waiting for stdio input (that's normal) — Ctrl+C to stop.连接到 Claude Code
claude mcp add apktool-pro \
--env APKTOOL_WORK_DIR=/absolute/path/to/static-apk-auditor/data \
-- /absolute/path/to/static-apk-auditor/venv/bin/python3 /absolute/path/to/static-apk-auditor/server.py验证:
claude mcp list
claude mcp get apktool-pro # should show "✔ Connected"注意:claude mcp add 默认将服务器注册限定在当前目录范围内(local 作用域)。如果你想从任何项目中使用它,请添加 --scope user。
连接到 Claude Desktop(备选方案)
编辑你的配置文件(macOS:~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"apktool-pro": {
"command": "/absolute/path/to/static-apk-auditor/venv/bin/python3",
"args": ["/absolute/path/to/static-apk-auditor/server.py"],
"env": {
"APKTOOL_WORK_DIR": "/absolute/path/to/static-apk-auditor/data"
}
}
}
}保存后重启 Claude Desktop。
配置(环境变量)
变量 | 默认值 | 用途 |
|
| apktool 可执行文件的路径(如果不在 PATH 中) |
|
| aapt 的路径(如果不在 PATH 中) |
|
| 所有按 APK 划分的源码/解码/报告数据的根文件夹 |
工具
核心(反编译与清单)
工具 | 参数 | 描述 |
|
| 使用 apktool 反编译 APK。输出持久化在 |
|
| 基本元数据:包名、版本、SDK 级别、文件大小。如果可用则使用 aapt,否则回退到解析已解码的清单。 |
|
| 从(可能已修改的)解码目录重新构建 APK。输出未签名——请使用 |
|
| 安装系统框架 APK,以便 apktool 可以解码引用该框架的系统/OEM 应用。 |
|
| 通过 |
|
| 列出所有请求的权限,并标记哪些被 Android 权限模型归类为"危险"权限。 |
|
| 提取指定语言环境的字符串资源。 |
|
| 在所有反编译的 |
安全启发式规则
工具 | 参数 | 描述 |
|
| 列出 APK 中附带的 |
|
| 扫描可能破坏证书验证的自定义 |
|
| 查找 |
|
| 适用于 React Native / Expo 应用:在 |
|
| 扫描 root/模拟器检测和防篡改特征:su 二进制路径、RootBeer/RootTools、SafetyNet、Play Integrity、 |
业务逻辑侦察
工具 | 参数 | 描述 |
|
| 定位名称暗示敏感操作(支付、权益、角色、折扣、配额)的方法/类,并显示附近的 |
|
| 启发式规则:标记敏感关键词命中点,其中本地比较( |
MobSF 报告验证
工具 | 参数 | 描述 |
|
| 加载并规范化 MobSF 静态分析 JSON 报告( |
|
| 将一条 MobSF 发现与你自己的反编译输出(smali + 字符串资源)进行交叉核对,以捕获误报。返回证据供模型分类——已确认 / 误报 / 需人工审查——它本身不进行分类。 |
提示词(引导式工作流)
提示词在 Claude Code 中通过斜杠命令显式调用(/apktool-pro:<name>),与工具不同——工具由模型按需自行调用。
提示词 | 参数 | 作用 |
|
| 运行完整的 16 项检查清单(攻击面、权限、密钥、加密、WebView、存储、SSL 固定、任务劫持、Root 检测、导出的接收器/提供器、JS 包、原生库、日志、依赖版本、PendingIntent 可变性、业务逻辑),并输出:摘要 → 详细发现(含置信度评级 + adb PoC 步骤)→ 映射到 OWASP Mobile Top 10(M1–M10)的风险表。 |
|
| 加载 MobSF JSON 报告,将每条发现与实际反编译代码进行交叉验证,将每条分类为已确认/误报/需人工审查,独立于 MobSF 自身的评级重新评估严重性,并仅生成已确认发现的优先处理行动清单。 |
|
| 快速检查:导出的组件 + 危险权限 + 明显的硬编码密钥。适用于不需要完整审计的场景。 |
使用示例
Use decode_apk to decompile /path/to/app.apk/apktool-pro:security_audit apk_path="/path/to/app.apk"Use check_root_detection on the decompiled output/apktool-pro:mobsf_review apk_path="/path/to/app.apk" mobsf_report_path="/path/to/mobsf_report.json"要随时查看所有可用工具及其确切参数,请在 Claude Code 会话中运行 /mcp 并选择 apktool-pro。
获取 MobSF 报告
如果你在本地运行 MobSF:
# upload the APK, get back a hash
curl -F 'file=@/path/to/app.apk' http://localhost:8000/api/v1/upload \
-H "Authorization: <MOBSF_API_KEY>"
# fetch the JSON report using that hash
curl -X POST http://localhost:8000/api/v1/report_json \
-H "Authorization: <MOBSF_API_KEY>" \
--data "hash=<hash_from_upload>" -o mobsf_report.json已知限制
仅限静态分析。 此处不会执行应用或拦截真实流量。业务逻辑发现和某些"已确认"的静态发现仍需动态验证后才能视为已证实。
build_apk输出未签名。 在设备上安装前请使用apksigner签名。基于正则的启发式规则(
check_ssl_pinning、check_root_detection、map_sensitive_flows等)可能遗漏混淆/重命名的代码,也可能对不相关匹配产生误报——请将其输出视为待审查的候选清单,而非最终结论。install_framework仅在解码引用framework-res.apk的系统/OEM APK 时才需要;大多数第三方应用分析不需要它。
设计说明
始终遵循
APKTOOL_WORK_DIR——每个 APK 都会获得一个持久、自包含的文件夹(source/、decoded/、reports/、final_reports/);不会写入临时目录。如果未安装
aapt,get_apk_info会回退到解析已解码的 manifest,而不是返回无用的结果。每次工具调用都会自动记录日志(
reports/);完成后的综合报告通过save_final_report单独保存(final_reports/)。基于
FastMCP构建,便于直接注册工具/提示词。
法律 / 责任使用
仅分析你拥有或已获得明确书面许可进行测试的 APK。反编译的 APK 可能包含敏感用户数据——请妥善处理输出,如果 APKTOOL_WORK_DIR 包含客户数据,请在项目结束后清理。此工具本身不执行任何网络外传或主动利用;security_audit 输出中的 PoC 命令(例如 adb shell am start ...)旨在由你手动在你控制的设备/模拟器上运行。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that enables AI assistants to analyze Android APK and iOS IPA files for security issues through natural language conversation, including permission auditing, secret detection, and SDK enumeration.12144MIT
- AlicenseNot gradedqualityBmaintenanceEnables Android APK static analysis in Cursor/Claude via GDA CLI Server, supporting reconnaissance, attack surface scanning, and code decompilation through natural language.11GPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to perform autonomous Android security analysis, including static analysis, dynamic analysis, and Frida instrumentation, powered by MobSF.1MIT
- AlicenseNot gradedqualityBmaintenanceMCP 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.1GPL 3.0
Related MCP Connectors
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
MCP server for static security analysis of Android source code
Offline methodology engine for authorized penetration testing, CTF, and security research.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/1111laaaddaaa/static-apk-auditor'
If you have feedback or need assistance with the MCP directory API, please join our Discord server