JADX-AI-MCP(Zin MCP套件的一部分)
⚡ 全自动MCP服务器+JADX插件,通过MCP与LLM通信,使用Claude等LLM分析Android APK——轻松发现漏洞、分析APK和逆向工程。
⭐ 贡献者
感谢这些了不起的人的贡献⭐
| [
ljt270864457](https://github.com/ljt270864457) | [
p0px](https://github.com/p0px) | [
bx33661](https://github.com/bx33661) | [
Haicaji](https://github.com/Haicaji) | [
ChineseAStar](https://github.com/ChineseAStar) | [
cyal1](https://github.com/cyal1r) | [
badmonkey7](https://github.com/badmonkey7) | [
tiann](https://github.com/tiann) | [
ZERO-A-ONE](https://github.com/ZERO-A-ONE) | [
neoz](https://github.com/neoz) | [
SamadiPour](https://github.com/SamadiPour) | [
wuseluosi](https://github.com/wuseluosi) | [
CainYzb](https://github.com/CainYzb) | [
tbodt](https://github.com/tbodt) | [
LilNick0101](https://github.com/LilNick0101) | [
lwsinclair](https://github.com/lwsinclair) | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
阅读文档
🤖 什么是JADX-AI-MCP?
JADX-AI-MCP 是一个插件 JADX反编译器 直接与 模型上下文协议(MCP) 提供 Claude等法学硕士提供实时逆向工程支持.
思考:“分解→ 上下文感知代码审查→ 人工智能建议”——所有这些都是实时的。
高级序列图
MERMAID``` 1 2 3 4 5 6 7 8 9sequenceDiagram 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/b65c3041-fde3-4803-8d99-45ca77dbe30a)
- **快速发现漏洞**
[https://github.com/user-attachments/assets/c184afae-3713-4bc0-a1d0-546c1f4eb57f](https://github.com/user-attachments/assets/c184afae-3713-4bc0-a1d0-546c1f4eb57f)
- **支持多个AI代理**
[https://github.com/user-attachments/assets/6342ea0f-fa8f-44e6-9b3a-4ceb8919a5b0](https://github.com/user-attachments/assets/6342ea0f-fa8f-44e6-9b3a-4ceb8919a5b0)
- **与您最喜欢的LLM客户端一起运行**
[https://github.com/user-attachments/assets/b4a6b280-5aa9-4e76-ac72-a0abec73b809](https://github.com/user-attachments/assets/b4a6b280-5aa9-4e76-ac72-a0abec73b809)
- **分析APK资源**
[https://github.com/user-attachments/assets/f42d8072-0e3e-4f03-93ea-121af4e66eb1](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](https://github.com/user-attachments/assets/2b0bd9b1-95c1-4f32-9b0c-38b864dd6aec)
它结合了两种工具:
1. JADX-AI-MCP
2. [JADX-MCP服务器](https://github.com/zinja-coder/jadx-mcp-server)
## 🤖 什么是JADX-MCP-SERVER?
**JADX MCP服务器** 是一个独立的Python服务器,与 `JADX-AI-MCP` 插件(参见: [jadx-ai-mcp](https://github.com/zinja-coder/jadx-ai-mcp))通过MCP(模型上下文协议)。它允许LLM与反编译的Android应用程序上下文实时通信。
---
## Zin MCP Suite中的其他项目
- **[APKTool MCP服务器](https://github.com/zinja-coder/apktool-mcp-server)**
- **[JADX MCP服务器](https://github.com/zinja-coder/jadx-mcp-server)**
- **[ZIN MCP客户端](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()` --把全班同学都叫来
- `get_main_activity_class()` --从AndroidManifest.xml文件中提到的jadx中获取主要活动。
- `get_main_application_classes_code()` --根据AndroidManifest.xml中定义的包名获取所有主要应用程序类的代码。
- `get_main_application_classes_names()` --根据AndroidManifest.xml中定义的包名获取所有主要应用程序类的名称。
- `get_android_manifest()` --检索并返回AndroidManifest.xml内容。
- `get_manifest_component` -检索特定的清单组件,而不是整个清单文件
- `get_strings()` :获取strings.xml文件
- `get_all_resource_file_names()` :检索应用程序中存在的所有资源文件名
- `get_resource_file()` :检索资源文件内容
- `rename_class()` :重命名类名
- `rename_method()` :重命名方法
- `rename_field()` :重命名字段
- `rename_package()` :重命名整个包
- `rename_variable()` :重命名方法中的变量
- `debug_get_stack_frames()` :从jaxx调试器获取堆栈帧
- `debug_get_threads()` :从jaxx调试器获取线程的见解
- `debug_get_variables()` :从jaxx调试器获取变量
- `xrefs_to_class()` :查找对类的所有引用(返回方法级和类级引用,支持分页)
- `xrefs_to_method()` :查找对方法的所有引用(包括重写相关方法,支持分页)
- `xrefs_to_field()` :查找对某个字段的所有引用(返回访问该字段的方法,支持分页)
---
## 🗒️ 示例提示
🔍 基本代码理解
1 2 3 4”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.”
🛡️ 漏洞检测
1 2 3 4”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?”
🛠️ 逆向工程助手
1 2 3 4”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?” “Tell me which classes contains code related to ‘encryption’?”
📦 静态分析
1 2 3”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代码修改
1 2 3”Refactor this method to improve readability.” “Add comments to this code explaining each step.” “Rewrite this Java method in Python for analysis.”
📄 文档和元数据
1 2 3”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.)?”
🐞 调试器助手
1 2 3 “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?”
---
## 🛠️ 入门指南
### 1.从发行版下载:[https://github.com/zinja-coder/jadx-ai-mcp/releases](https://github.com/zinja-coder/jadx-ai-mcp/releases)
> [!注意]
>
>
> 下载两者 `jadx-ai-mcp-<version>.jar` 和 `jadx-mcp-server-<version>.zip` 文件夹。
BASH```
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16# 0. Download the jadx-ai-mcp-<version>.jar and jadx-mcp-server-<version>.zip
https://github.com/zinja-coder/jadx-ai-mcp/releases
# 1.
unzip jadx-ai-mcp-<version>.zip
├jadx-mcp-server/
├── jadx_mcp.py
├── requirements.txt
├── README.md
├── LICENSE
├jadx-ai-mcp-<version>.jar
# 2. Install the plugin
# For this you can follow two approaches:
## 1. One liner - execute below command in your shell
jadx plugins --install "github:zinja-coder:jadx-ai-mcp"
## The above one line code will install the latest version of the plugin directly into the jadx, no need to download the jadx-ai-mcp's .jar file.
## 2. Or you can use JADX-GUI to install it by following images as shown below:
BASH``` 1## 3. GUI method, download the .jar file and follow below steps shown in images
BASH```
1
2
3
4
5
6
7
8
9
10
11# 3. Navigate to jadx-mcp-server directory
cd jadx-mcp-server
# 4. This project uses uv - https://github.com/astral-sh/uv instead of pip for dependency management.
## a. Install uv (if you dont have it yet)
curl -LsSf https://astral.sh/uv/install.sh | sh
## b. OPTIONAL, if for any reasons, you get dependecy errors in jadx-mcp-server, Set up the environment
uv venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
## c. OPTIONAL Install dependencies
uv pip install httpx fastmcp
# The setup for jadx-ai-mcp and jadx_mcp_server is done.
🤖 2.使用克劳德桌面
确保Claude Desktop在启用MCP的情况下运行。
例如,我在Kali Linux中使用了以下内容:https://github.com/aaddrick/claude-desktop-debian
配置MCP服务器并将其添加到LLM文件中:
BASH``` 1nano ~/.config/Claude/claude_desktop_config.json
适用于:
- 窗户: `%APPDATA%\Claude\claude_desktop_config.json`
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
其中包含以下内容:
JSON```
1
2
3
4
5
6
7
8
9
10
11
12
13{
"mcpServers": {
"jadx-mcp-server": {
"command": "/<path>/<to>/uv",
"args": [
"--directory",
"</PATH/TO/>jadx-mcp-server/",
"run",
"jadx_mcp_server.py"
]
}
}
}
替换:
path/to/uv与您的实际路径uv可执行path/to/jadx-mcp-server带有克隆此文件的绝对路径 仓库
然后,使用内置集成通过实时代码审查提示浏览代码并进行交互。
或
或者,您可以使用以下命令直接将jadx_mcp_server安装为可执行文件:
1uv tool install git+https://github.com/zinja-coder/jadx-mcp-server
然后你就可以提供 jadx_mcp_server 在 command mcp配置部分。
3.使用Cherry Studio
如果要在Cherry Studio中配置MCP工具,可以参考以下配置。
- 类型:stdio
- 命令:uv
- 论点:
BASH``` 1 2 3 4—directory path/to/jadx-mcp-server run jadx_mcp_server.py
- `path/to/jadx-mcp-server` 带有克隆此文件的绝对路径
仓库
## 4.使用LMStudio
您还可以通过配置LM Studio的MCP.json文件,将JADX AI MCP Server与LM Studio一起使用。这是视频指南。
[https://github.com/user-attachments/assets/b4a6b280-5aa9-4e76-ac72-a0abec73b809](https://github.com/user-attachments/assets/b4a6b280-5aa9-4e76-ac72-a0abec73b809)
## 5.在HTTP流模式下运行
您还可以在HTTP流模式下使用Jadx `--http` 选项与 `jadx_mcp_server.py` 如下图所示:
BASH```
1
2
3uv run jadx_mcp_server.py --http
OR
uv run jadx_mcp_server.py --http --port 9999
高级CLI选项——了解标志
有 两个独立的连接 每个都有自己的主机/端口:
1
2
3
4
5┌─────────────┐ --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 | off | 使用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——同一台机器上的所有内容(最常见):
BASH``` 1 2# Default: MCP server on localhost:8651, connects to JADX plugin on localhost:8650 uv run jadx_mcp_server.py —http
**场景2——Docker容器或WSL(可从主机网络访问的MCP服务器):**
BASH```
1
2
3# MCP server listens on ALL interfaces so the host can reach it
# JADX plugin is still on the same machine
uv run jadx_mcp_server.py --http --host 0.0.0.0
场景3-JADX-GUI在另一台机器上运行(例如远程VM):
BASH``` 1 2# MCP server runs locally, but connects to JADX plugin on a remote machine uv run jadx_mcp_server.py —http —jadx-host 192.168.1.100
**场景4——完全远程设置(所有内容都在不同的机器上):**
BASH```
1
2
3# MCP server listens on all interfaces on port 9999
# JADX plugin is on a different machine at 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
[!小心]
⚠️ 安全警告–远程绑定
使用时
--host 0.0.0.0(或任何非本地主机地址),MCP服务器绑定到 所有网络接口 结束 无身份验证的纯HTTP这意味着:
网络上的任何人 可以连接和调用所有MCP工具
有 无TLS加密 —交通可以被拦截
攻击者可以使用服务器 读取反编译代码, 重命名类/方法,以及 访问调试信息
缓解措施:
- 仅绑定到
0.0.0.0上 可信、隔离的网络 (例如,Docker桥、本地VM)- 使用一个 防火墙 限制对MCP端口的访问
- 考虑一个 SSH隧道 相反:
ssh -L 8651:127.0.0.1:8651 remote-host
标准模式兼容性
[!注意] 跑步时 标准 模式(默认,无
--http),所有人类可读的输出(横幅、健康检查)都写入 标准错误 保持 标准输出 为MCP JSON-RPC流保留。这确保了与Codex、Claude Desktop和其他基于stdio的MCP客户端的兼容性。
6.JADX AI MCP插件的自定义端口和主机配置
- 配置端口:配置JADX AI MCP插件将侦听的端口。
- 默认端口:还原更改并在默认端口上侦听。
- 重启服务器:强制重启JADX AI MCP插件服务器。
- 服务器状态:检查JADX AI MCP插件服务器的状态。
要连接在自定义端口上运行的JADX AI MCP插件 --jadx-port 选项将按如下所示使用:
1uv run jadx_mcp_server.py --jadx-port 8652
如果JADX AI MCP插件正在运行 不同的机器 (例如,远程VM上的JADX、本地主机上的MCP服务器),使用 --jadx-host 选项:
BASH``` 1 2# Connect to JADX plugin on a remote host uv run jadx_mcp_server.py —jadx-host 192.168.1.100 —jadx-port 8650
### CLI参考——了解标志
有 **两个独立的连接** 每个都有自己的主机/端口:
1 2 3 4 5┌─────────────┐ —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` | off | 使用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——同一台机器上的所有内容(最常见):**
BASH```
1
2# Default: MCP server on localhost:8651, connects to JADX plugin on localhost:8650
uv run jadx_mcp_server.py --http
场景2——Docker容器或WSL(可从主机网络访问的MCP服务器):
BASH``` 1 2 3# MCP server listens on ALL interfaces so the host can reach it
JADX plugin is still on the same machine
uv run jadx_mcp_server.py —http —host 0.0.0.0
**场景3-JADX-GUI在另一台机器上运行(例如远程VM):**
BASH```
1
2# MCP server runs locally, but connects to JADX plugin on a remote machine
uv run jadx_mcp_server.py --http --jadx-host 192.168.1.100
场景4——完全远程设置(所有内容都在不同的机器上):
BASH``` 1 2 3# MCP server listens on all interfaces on port 9999
JADX plugin is on a different machine at 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
claude的自定义jadx端口的MCP配置如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15{ “mcpServers”: { “jadx-mcp-server”: { “command”: “/path/to/uv”, “args”: [ “—directory”, “/path/to/jadx-mcp-server/”, “run”, “jadx_mcp_server.py”, “—jadx-port”, “8652” ] } } }
## 尝试一下
1. 运行jadx-gui并加载任何.apk文件
1. 开始克劳德-你必须看到锤子符号
1. 点击 `hammer` 符号,你应该看到以下内容:
1. 运行以下提示:
TEXT```
1fetch currently selected class and perform quick sast on it
-
出现提示时允许访问:
-
乱劈!
此插件允许完全控制GUI和内部项目模型,以支持更深入的LLM集成,包括:
- 将所选类导出到MCP
- 运行自动化克劳德分析
- 在线接收反馈建议
故障排除
投稿人须知
- 与JADX-AI-MCP相关的文件可以在这个仓库中找到。
- 与以下内容相关的文件 jadx-mcp服务器 可以找到 这里.
报告bug、问题、功能建议、性能问题、一般问题、文档问题。
- 请使用相应的模板打开一个问题。
- 在Claude Desktop Client上测试,很快将测试对其他AI的支持!
🙏 学分
该项目是JADX的插件,JADX是由创建和维护的一款出色的开源Android反编译器 @skylot所有核心反编译逻辑都属于它们。我只扩展了它来支持我的MCP服务器的AI功能。
jadx的原始README.md包含在此存储库中以供参考和引用。
这个MCP服务器得益于JADX-GUI的可扩展性和令人惊叹的Android逆向工程社区。
也非常感谢 @aaddrick 用于为基于Debian的linux开发Claude桌面。
最后感谢 @人类学 用于开发模型上下文协议和 @FastMCP 团队
除此之外,非常感谢所有作为该项目依赖项的开源项目,正是这些项目使这一切成为可能。
依赖项
这个项目使用了以下很棒的库。
-
插件-Java
-
贾瓦林-https://javalin.io/Apache 2.0许可证
-
org.w3c.dom-https://mvnrepository.com/artifact/org.w3c.dom-W3C软件和文档许可证
-
MCP服务器-Python
-
FastMCP-https://github.com/jlowin/fastmcpApache 2.0许可证
-
httpx-https://www.python-httpx.org-BSD-3条款(“BSD许可”)
📄 许可证
JADX-AI-MCP和所有相关项目继承了原始JADX存储库的Apache 2.0许可证。
⚖️ 法律警告
免责声明
工具 jadx-ai-mcp 和 jadx_mcp_server 严格用于教育、研究和道德安全评估目的。它们是“按原样”提供的,没有任何明示或暗示的保证。用户全权负责确保他们对这些工具的使用符合所有适用的法律、法规和道德准则。
通过使用 jadx-ai-mcp 或 jadx_mcp_server,您同意仅在您有权测试的环境中使用它们,例如您拥有或有明确权限分析的应用程序。严禁将这些工具用于未经授权的逆向工程、侵犯知识产权或恶意活动。
开发商 jadx-ai-mcp 和 jadx_mcp_server 对于因使用或误用这些工具而导致的任何损害、数据丢失、法律后果或其他后果,概不负责。用户对其行为及其使用造成的任何影响承担全部责任。
负责任地使用。尊重知识产权。遵循合乎道德的黑客行为。
🙌 贡献或支持
- 觉得有用吗?给它一个⭐️
- 有想法吗?打开一个 问题 或提交PR
- 在上面建东西?DM或提及我——我会将其添加到README中!
- 你喜欢我的工作并坚持下去吗?赞助这个项目。
内置于❤️ 面向逆向工程和人工智能社区。