zinja-coder/jadx-mcp-server
GitHub: zinja-coder/jadx-mcp-server
通过 MCP 协议连接 Claude 等 LLM 与 JADX 反编译器,让 AI 实时参与 Android APK 的逆向分析与漏洞检测。
Stars: 363 | Forks: 59
# JADX-MCP-SERVER (Zin 逆向工程 MCP 套件的一部分)
⚡ 全自动化的 MCP 服务器,旨在与 JADX-AI-MCP 插件通信,使用 Claude 等 LLM 分析 Android APK —— 轻松发现漏洞、解析 Manifest 并进行逆向工程。







[](http://www.apache.org/licenses/LICENSE-2.0.html)
#### ReadTheDocs:
- 我们现已在 Read The Docs 上线:
#### 立即下载:https://github.com/zinja-coder/jadx-ai-mcp/releases
## 🤖 什么是 JADX-MCP-SERVER?
**JADX MCP Server** 是一个独立的 Python 服务器,通过 MCP(Model Context Protocol)与修改版的 `jadx-gui` 交互(参见:[jadx-ai-mcp](https://github.com/zinja-coder/jadx-ai-mcp))。它允许 LLM 与反编译的 Android 应用上下文进行实时通信。
## 🤖 什么是 JADX-AI-MCP?
**JADX-AI-MCP** 是 [JADX decompiler](https://github.com/skylot/jadx) 的一个插件,直接集成了 [Model Context Protocol (MCP)](https://github.com/anthropic/mcp),以提供**通过 Claude 等 LLM 提供实时的逆向工程支持**。
可以这样理解:“反编译 → 上下文感知的代码审查 → AI 建议” —— 全部实时进行。
#### 高层时序图
```
sequenceDiagram
LLM CLIENT->>JADX MCP SERVER: INVOKE MCP TOOL
JADX MCP SERVER->>JADX AI MCP PLUGIN: INVOKE HTTP REQUEST
JADX AI MCP PLUGIN->>REQUEST HANDLERS: INVOKE HTTP REQUEST HANDLER
REQUEST HANDLERS->>JADX GUI: PERFORM ACTION/GATHER DATA
JADX GUI->>REQUEST HANDLERS: ACTION PERFORMED/DATA GATHERED
REQUEST HANDLERS->>JADX AI MCP PLUGIN: CRAFT HTTP RESPONSE
JADX AI MCP PLUGIN->>JADX MCP SERVER:HTTP RESPONSE
JADX MCP SERVER->>LLM CLIENT: MCP TOOL RESULT
```
观看演示!
- **执行快速分析**
https://github.com/user-attachments/assets/b65c3041-fde3-4803-8d99-45ca77dbe30a
- **快速发现漏洞**
https://github.com/user-attachments/assets/c184afae-3713-4bc0-a1d0-546c1f4eb57f
- **多 AI Agent 支持**
https://github.com/user-attachments/assets/6342ea0f-fa8f-44e6-9b3a-4ceb8919a5b0
- **分析 APK 资源**
https://github.com/user-attachments/assets/f42d8072-0e3e-4f03-93ea-121af4e66eb1
- **使用 JADX 调试 APK 时的 AI 助手**
https://github.com/user-attachments/assets/2b0bd9b1-95c1-4f32-9b0c-38b864dd6aec
它是两个工具的结合:
1. [JADX-AI-MCP](https://github.com/zinja-coder/jadx-ai-mcp)
2. JADX MCP SERVER
# Zin MCP 套件
- **[APKTool-MCP-Server](https://github.com/zinja-coder/apktool-mcp-server)**
- **[JAD-AI-MCP-Plugin](https://github.com/zinja-coder/jadx-ai-mcp)**
- **[ZIN-MCP-Client](https://github.com/zinja-coder/zin-mcp-client)**
## 当前 MCP 工具
以下 MCP 工具可用:
- `fetch_current_class()` — 获取所选类的类名和完整源代码
- `get_selected_text()` — 获取当前选定的文本
- `get_all_classes()` — 列出项目中的所有类
- `get_class_source()` — 获取给定类的完整源代码
- `get_method_by_name()` — 获取某个方法的源代码
- `search_method_by_name()` — 跨类搜索方法
- `search_classes_by_keyword()` — 搜索其源代码包含特定关键字的类(支持分页)
- `get_methods_of_class()` — 列出类中的方法
- `get_fields_of_class()` — 列出类中的字段
- `get_smali_of_class()` — 获取类的 smali 代码
- `get_main_activity_class()` — 从 AndroidManifest.xml 文件中获取 JADX 提及的主 Activity。
- `get_main_application_classes_code()` — 根据 AndroidManifest.xml 中定义的包名获取所有主应用程序类的代码。
- `get_main_application_classes_names()` — 根据 AndroidManifest.xml 中定义的包名获取所有主应用程序类的名称。
- `get_android_manifest()` — 检索并返回 AndroidManifest.xml 的内容。
- `get_manifest_component` - 检索特定的 Manifest 组件,而不是整个 Manifest 文件
- `get_strings()` : 获取 strings.xml 文件
- `get_all_resource_file_names()` : 检索应用程序中存在的所有资源文件名
- `get_resource_file()` : 检索资源文件内容
- `rename_variable()` : 重命名方法内的变量
- `debug_get_stack_frames()` : 从 JADX 调试器获取堆栈帧
- `debug_get_threads()` : 从 JADX 调试器获取线程洞察
- `debug_get_variables()` : 从 JADX 调试器获取变量
- `xrefs_to_class()` : 查找对某个类的所有引用(返回方法级别和类级别的引用,支持分页)
- `xrefs_to_method()` : 查找对某个方法的所有引用(包括与重写相关的方法,支持分页)
- `xrefs_to_field()` : 查找对某个字段的所有引用(返回访问该字段的方法,支持分页)
#### 注意:已在 Claude Desktop 上测试。未来可能会测试对其他 LLM 的支持。
## 🗒️ 示例提示词
🔍 基础代码理解
```
"Explain what this class does in one paragraph."
"Summarize the responsibilities of this method."
"Is there any obfuscation in this class?"
"List all Android permissions this class might require."
```
🛡️ 漏洞检测
```
"Are there any insecure API usages in this method?"
"Check this class for hardcoded secrets or credentials."
"Does this method sanitize user input before using it?"
"What security vulnerabilities might be introduced by this code?"
```
🛠️ 逆向工程助手
```
"Deobfuscate and rename the classes and methods to something readable."
"Can you infer the original purpose of this smali method?"
"What libraries or SDKs does this class appear to be part of?"
```
📦 静态分析
```
"List all network-related API calls in this class."
"Identify file I/O operations and their potential risks."
"Does this method leak device info or PII?"
```
🤖 AI 代码修改
```
"Refactor this method to improve readability."
"Add comments to this code explaining each step."
"Rewrite this Java method in Python for analysis."
```
📄 文档与元数据
```
"Generate Javadoc-style comments for all methods."
"What package or app component does this class likely belong to?"
"Can you identify the Android component type (Activity, Service, etc.)?"
```
🐞 调试助手
```
"Fetch stack frames, varirables and threads from debugger and provide summary"
"Based the stack frames from debugger, explain the execution flow of the application"
"Based on the state of variables, is there security threat?"
```
## 🛠️ 入门指南
[在此阅读](https://github.com/zinja-coder/jadx-ai-mcp?tab=readme-ov-file#%EF%B8%8F-getting-started)
演示:**在本地执行代码审查以查找漏洞**
https://github.com/user-attachments/assets/4cd26715-b5e6-4b4b-95e4-054de6789f42
### 高级 CLI 选项 —— 了解相关标志
有**两个独立的连接**,每个都有自己的主机/端口:
```
┌─────────────┐ --host / --port ┌──────────────────┐ --jadx-host / --jadx-port ┌──────────────────┐
│ LLM Client │ ◄──────────────────► │ jadx-mcp-server │ ──────────────────────────► │ JADX-GUI Plugin │
│ (Claude, │ Where the MCP server │ │ Where the MCP server looks │ (jadx-ai-mcp) │
│ Codex..) │ LISTENS for clients │ │ for the JADX plugin │ │
└─────────────┘ └──────────────────┘ └──────────────────┘
```
| 标志 | 默认值 | 控制 |
|------|---------|----------|
| `--http` | 关闭 | 使用 HTTP 传输代替 stdio |
| `--host` | `127.0.0.1` | **MCP 服务器监听位置**(绑定供 LLM 客户端访问的地址) |
| `--port` | `8651` | **MCP 服务器监听的端口** |
| `--jadx-host` | `127.0.0.1` | **查找 JADX 插件的位置**(目标 JADX-GUI 所在机器) |
| `--jadx-port` | `8650` | **JADX 插件所在的端口** |
### 使用示例
**场景 1 —— 所有内容在同一台机器上(最常见):**
```
# 默认:localhost:8651 上的 MCP server,连接到 localhost:8650 上的 JADX plugin
uv run jadx_mcp_server.py --http
```
**场景 2 —— Docker 容器或 WSL(MCP 服务器可从主机网络访问):**
```
# MCP server 监听所有接口,以便 host 能够访问它
# JADX plugin 仍然在同一台机器上
uv run jadx_mcp_server.py --http --host 0.0.0.0
```
**场景 3 —— JADX-GUI 运行在不同的机器上(例如,远程虚拟机):**
```
# MCP server 在本地运行,但连接到远程机器上的 JADX plugin
uv run jadx_mcp_server.py --http --jadx-host 192.168.1.100
```
**场景 4 —— 完全远程设置(所有内容都在不同的机器上):**
```
# MCP server 监听端口 9999 上的所有接口
# JADX plugin 位于不同的机器,地址为 192.168.1.100:8652
uv run jadx_mcp_server.py --http --host 0.0.0.0 --port 9999 --jadx-host 192.168.1.100 --jadx-port 8652
```
## 🛣️ 未来路线图
- [x] 增加对 apktool 的支持
- [ ] 增加对 hermes 代码的支持(ReactNative 应用程序)
- [ ] 增加 Docker 支持
- [x] 增加更多有用的 MCP 工具
- [x] 使 LLM 能够修改 JADX 上的代码
- [x] 增加提示词模板,让 LLM 以资源的形式访问 Android APK 文件
- [ ] ~~构建 MCP 客户端以支持本地 LLM~~
- [ ] **最终目标** :使所有 Android 逆向工程和 APK 修改工具连接到单个 MCP 服务器,让纯粹通过直觉逆向工程 APK 文件变得尽可能简单。
## 贡献者须知
- 与 JADX-AI-MCP 相关的文件可以在[这里](https://github.com/zinja-coder/jadx-ai-mcp)找到
- 与 **jadx-mcp-server** 相关的文件仅在此仓库中提供。
## 🙏 致谢
本项目是 JADX 的一个插件,JADX 是一个由 [@skylot](https://github.com/skylot) 创建和维护的出色的开源 Android 反编译器。所有核心反编译逻辑均归其所有。我只是对其进行了扩展,以支持我具有 AI 功能的 MCP 服务器。
[📎 原始 README (JADX)](https://github.com/skylot/jadx)
来自 JADX 的原始 README.md 包含在此仓库中,以供参考和致敬。
这个 MCP 服务器之所以能够实现,得益于 JADX-GUI 的可扩展性以及出色的 Android 逆向工程社区。
同时非常感谢 [@aaddrick](https://github.com/aaddrick) 为基于 Debian 的 Linux 开发了 Claude 桌面版。
最后,感谢 [@anthropics](https://github.com/anthropics) 开发了 Model Context Protocol,以及 [@FastMCP](https://github.com/modelcontextprotocol/python-sdk) 团队。
并感谢所有使此类项目成为可能的开源维护者和贡献者及其所维护的库与依赖。
## 已审计并获得评估徽章
[](https://mseep.ai/app/zinja-coder-jadx-mcp-server)
感谢 Mseep.net 的审计和提供评估徽章。
### 依赖项
本项目使用了以下出色的库。
- 插件 - Java
- Javalin - https://javalin.io/ - Apache 2.0 License
- SLF4J - https://slf4j.org/ - MIT License
- org.w3c.dom - https://mvnrepository.com/artifact/org.w3c.dom - W3C Software and Document License
- MCP Server - Python
- FastMCP - https://github.com/jlowin/fastmcp - Apache 2.0 License
- httpx - https://www.python-httpx.org - BSD-3-Clause (“BSD licensed”)
## 📄 许可证
本插件沿用了原 JADX 仓库的 Apache 2.0 许可证。
## ⚖️ 法律警告
**免责声明**
`jadx-ai-mcp` 和 `jadx_mcp_server` 工具仅用于教育、研究和道德安全评估目的。它们按“原样”提供,不提供任何明示或暗示的保证。用户需自行负责确保其对这些工具的使用符合所有适用的法律、法规和道德准则。
通过使用 `jadx-ai-mcp` 或 `jadx_mcp_server`,您同意仅在您被授权测试的环境中使用它们,例如您拥有或已获得明确许可进行分析的应用程序。严禁将这些工具用于未经授权的逆向工程、侵犯知识产权或恶意活动等任何不当行为。
`jadx-ai-mcp` 和 `jadx_mcp_server` 的开发者对因使用或滥用这些工具而造成的任何损害、数据丢失、法律后果或其他后果概不负责。用户需对其行为及使用所造成的任何影响承担全部责任。
请负责任地使用。尊重知识产权。遵循道德黑客实践。
## 🙌 贡献或支持
- 觉得有用?给它点个 ⭐️
- 有想法?提交一个 [issue](https://github.com/zinja-coder/jadx-mcp-server/issues) 或发起 PR
- 基于此构建了新内容?私信我或提及我 —— 我会把它加到 README 里!
为逆向工程和 AI 社区倾注 ❤️ 构建。
标签:Android应用安全, Android逆向分析, APK反编译, Claude, CVE检测, DLL 劫持, JADX, JS文件枚举, LLM集成, MCP Server, MCP客户端, Python, Zinja逆向工程套件, 人工智能, 大语言模型, 安全测试, 安卓Manifest解析, 插件开发, 攻击性安全, 无后门, 模型上下文协议, 用户模式Hook绕过, 目录枚举, 移动安全, 自动化逆向, 运行时操纵, 逆向工具