Skip to content
Back to search

android_proxy_mcp

基于 MCP 的 Android 抓包服务,让 AI 助手通过自然语言分析网络请求。

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/zhizhuodemao--android-proxy-mcp/badge.svg)](/listings/zhizhuodemao--android-proxy-mcp)

HTML

<a href="/listings/zhizhuodemao--android-proxy-mcp"><img src="/api/listings/zhizhuodemao--android-proxy-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# 克隆项目
git clone https://github.com/yourname/android-proxy-mcp.git
cd android-proxy-mcp

# 安装依赖
uv sync

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 275 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Android Proxy MCP
  2. 基于 MCP (Model Context Protocol) 的 Android 抓包服务,让 AI 助手能够帮你抓取和分析 HTTP/HTTPS 流量。
  3. ## 功能特点
  4. - **抓包**: 捕获 HTTP/HTTPS 流量,支持按域名、状态码、资源类型筛选
  5. - **智能搜索**: 搜索请求/响应内容,支持大响应分片读取
  6. - **AI 驱动**: 通过自然语言让 Claude 帮你分析网络请求
  7. ## 架构
  8. ```
  9. ┌─────────────────┐ SQLite ┌─────────────────┐
  10. │ 代理服务 │ ─────────────→ │ MCP 服务 │
  11. │ (终端手动启动) │ 流量数据共享 │ (Claude 调用) │
  12. │ mitmdump │ │ 查询/搜索/分析 │
  13. └─────────────────┘ └─────────────────┘
  14. ↑
  15. │ HTTP/HTTPS
  16. │
  17. ┌─────────┐
  18. │ 手机 │
  19. └─────────┘
  20. ```
  21. ## 快速开始
  22. ### 1. 环境要求
  23. - Python 3.11+
  24. - [uv](https://github.com/astral-sh/uv) (Python 包管理器)
  25. **安装 uv:**
  26. ```bash
  27. # macOS / Linux
  28. curl -LsSf https://astral.sh/uv/install.sh | sh
  29. # Windows (PowerShell)
  30. powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  31. # 或通过 pip
  32. pip install uv
  33. ```
  34. ### 2. 安装
  35. ```bash
  36. # 克隆项目
  37. git clone https://github.com/yourname/android-proxy-mcp.git
  38. cd android-proxy-mcp
  39. # 安装依赖
  40. uv sync
  41. ```
  42. ### 3. 配置 Claude Desktop
  43. 编辑 Claude Desktop 配置文件:
  44. **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
  45. **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
  46. ```json
  47. {
  48. "mcpServers": {
  49. "android-proxy": {
  50. "command": "uv",
  51. "args": ["--directory", "/path/to/android-proxy-mcp", "run", "android-proxy-mcp"]
  52. }
  53. }
  54. }
  55. ```
  56. > 将 `/path/to/android-proxy-mcp` 替换为实际项目路径
  57. ### 4. 重启 Claude Desktop
  58. 配置完成后,重启 Claude Desktop 使配置生效。
  59. ---
  60. ## 使用方法
  61. ### 第一步:启动代理
  62. **在终端中运行:**
  63. ```bash
  64. uv run android-proxy-start
  65. ```
  66. 你会看到如下输出:
  67. ```
  68. ╔════════════════════════════════════════════════════════════╗
  69. ║ 🚀 Android Proxy MCP 启动向导 ║
  70. ╚════════════════════════════════════════════════════════════╝
  71. ════════════════════════════════════════════════════════════
  72. 环境检测
  73. ════════════════════════════════════════════════════════════
  74. ✓ 端口 8288 可用
  75. ════════════════════════════════════════════════════════════
  76. 手机配置
  77. ════════════════════════════════════════════════════════════
  78. 手机 Wi-Fi 代理设置:
  79. ┌─────────────────────────────────┐
  80. │ 服务器: 192.168.1.100 │
  81. │ 端 口: 8288 │
  82. └─────────────────────────────────┘
  83. 证书安装: 手机浏览器访问 http://mitm.it
  84. ════════════════════════════════════════════════════════════
  85. 启动代理 (Ctrl+C 停止)
  86. ════════════════════════════════════════════════════════════
  87. ```
  88. > 保持这个终端窗口运行,不要关闭。
  89. ### 第二步:配置手机代理
  90. **确保手机和电脑在同一 Wi-Fi 网络下。**
  91. 1. 手机进入 **设置 → Wi-Fi**
  92. 2. 长按当前连接的 Wi-Fi → **修改网络**
  93. 3. 展开 **高级选项**
  94. 4. 代理设置选择 **手动**
  95. 5. 填写启动脚本显示的 IP 和端口
  96. 6. 保存
  97. ### 第三步:安装 CA 证书(抓 HTTPS 必须)
  98. 1. 手机浏览器访问 `http://mitm.it`(通过代理访问)
  99. 2. 选择 Android 图标下载证书
  100. 3. 设置 → 安全 → 加密与凭据 → 安装证书 → CA 证书
  101. 4. 选择下载的证书文件安装
  102. > ⚠️ **注意**: Android 7+ 用户证书默认不被 App 信任,只能抓取浏览器和部分应用的 HTTPS 流量。
  103. #### 安装系统证书(Root 用户)
  104. 如果你的设备已 Root(安装了 Magisk),可以将用户证书移动为系统证书:
  105. 1. 先按照上述步骤安装用户证书
  106. 2. 安装 `resources/MoveCertificate-v1.5.5.zip` Magisk 模块:
  107. - 打开 Magisk → 模块 → 从本地安装
  108. - 选择项目中的 `resources/MoveCertificate-v1.5.5.zip`
  109. - 重启设备
  110. 3. 重启后,用户证书会自动移动到系统证书目录
  111. ---
  112. ### 第四步:在 Claude 中查询流量
  113. 打开 **Claude Desktop**,用自然语言查询流量:
  114. **基础查询:**
  115. > "显示最近的网络请求"
  116. > "显示 api.example.com 的请求"
  117. > "显示所有失败的请求(状态码 4xx 或 5xx)"
  118. **搜索内容:**
  119. > "搜索响应中包含 '张三' 的请求"
  120. > "搜索 URL 中包含 search 的请求"
  121. > "搜索请求头中包含 X-Token 的请求"
  122. **查看大响应:**
  123. > "读取 req-5 的响应体"
  124. > "继续读取 req-5 响应体,从 4000 开始"
  125. **智能分析:**
  126. > "帮我找酷安 app 的搜索接口"
  127. > "分析这个 API 的请求参数"
  128. ### 第五步:停止抓包
  129. 在运行代理的终端窗口按 `Ctrl+C` 停止代理。
  130. 记得在手机 Wi-Fi 设置中关闭代理。
  131. ---
  132. ## MCP 工具列表
  133. | 工具 | 说明 |
  134. |-----|------|
  135. | `proxy_status` | 获取代理状态 |
  136. | `traffic_list` | 列出流量(支持域名/状态码/类型筛选)|
  137. | `traffic_search` | 搜索流量内容(URL/请求头/请求体/响应头/响应体)|
  138. | `traffic_get_detail` | 获取请求元数据(请求头、响应头等)|
  139. | `traffic_read_body` | 分片读取大响应体 |
  140. | `traffic_clear` | 清空流量记录 |
  141. | `get_cert_info` | 获取证书安装指南 |
  142. ---
  143. ## 常见问题
  144. ### Q: 手机配置代理后无法上网?
  145. 1. 确认电脑和手机在同一 Wi-Fi
  146. 2. 确认代理已启动(检查终端窗口)
  147. 3. 检查电脑防火墙是否允许 8288 端口
  148. 4. 尝试用电脑 IP(不是 localhost)
  149. ### Q: 能抓到 HTTP 但抓不到 HTTPS?
  150. 需要安装 CA 证书。手机浏览器访问 `http://mitm.it` 下载安装。
  151. ### Q: 安装了证书但某些 App 还是抓不到 HTTPS?
  152. - Android 7+ 用户证书默认不被 App 信任 → 需要安装系统证书(参考上方)
  153. - 部分 App 有 SSL Pinning(证书锁定)→ 参考下方绕过方案
  154. ### Q: 如何绕过 SSL Pinning?
  155. 推荐使用 **LSPosed + 禁用 SSL 验证插件**:
  156. 1. 安装 [Magisk](https://github.com/topjohnwu/Magisk)(需要 Root)
  157. 2. 安装 [LSPosed](https://github.com/LSPosed/LSPosed) 模块
  158. 3. 安装以下任一插件:
  159. - [TrustMeAlready](https://github.com/ViRb3/TrustMeAlready)
  160. - [JustTrustMe](https://github.com/Fuzion24/JustTrustMe)
  161. 4. 在 LSPosed 中启用插件,勾选目标 App
  162. 5. 重启目标 App
  163. ### Q: 响应太大,MCP 无法返回?
  164. 使用 `traffic_search` 搜索关键词定位,然后用 `traffic_read_body` 分片读取。
  165. ---
  166. ## 项目结构
  167. ```
  168. android-proxy-mcp/
  169. ├── README.md
  170. ├── pyproject.toml
  171. ├── src/
  172. │ └── android_proxy_mcp/
  173. │ ├── cli/ # 命令行工具
  174. │ │ └── start.py # 代理启动脚本
  175. │ ├── core/ # 核心模块
  176. │ │ └── sqlite_store.py # SQLite 流量存储
  177. │ ├── tools/ # MCP 工具
  178. │ └── server.py # MCP 服务入口
  179. ├── tests/
  180. ├── docs/ # 文档
  181. └── resources/ # 资源文件
  182. └── MoveCertificate-v1.5.5.zip # 证书移动模块
  183. ```
  184. ## 开发
  185. ```bash
  186. # 安装开发依赖
  187. uv sync --extra dev
  188. # 运行测试
  189. uv run pytest tests/ -v
  190. # 代码格式化
  191. uv run ruff format .
  192. ```
  193. ## 许可证
  194. MIT License

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.