Miniapp Cdp

Browser automation

微信小程序逆向工程 MCP 服务器,让你的 AI 编码助手(如 Claude、Cursor、Antigravity)能够直接通过 Chrome DevTools Protocol (CDP) 调试和分析微信小程序(包括微信开发者工具或 PC 端微信小程序)中的 JavaScript 代码。.

Your AI app calls the Miniapp Cdp MCP server, which does the browser automation work and sends the result back to the chat.

About Miniapp Cdp

Miniapp Cdp is a community MCP server from zhizhuodemao, filed in our directory under browser automation. 微信小程序逆向工程 MCP 服务器,让你的 AI 编码助手(如 Claude、Cursor、Antigravity)能够直接通过 Chrome DevTools Protocol (CDP) 调试和分析微信小程序(包括微信开发者工具或 PC 端微信小程序)中的 JavaScript 代码。.

At a glance

Publisher
zhizhuodemao (community)
Runs
See the README for setup
Written in
Python
License
MIT
GitHub stars
275

How to set up Miniapp Cdp

  1. Follow the install steps in the Miniapp Cdp README; it is written in Python, so have that toolchain ready.
  2. Check the Miniapp Cdp README for keys or settings; the registry lists none that Miniapp Cdp requires.
  3. Add Miniapp Cdp to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Miniapp Cdp tools to confirm the connection.
  5. Run one read-only task with Miniapp Cdp first, and keep your app asking before each tool call until the results look right.

Miniapp Cdp compared with similar servers

  • G Search by jae-jae has fewer GitHub stars than Miniapp Cdp (274 against 275); both are community servers, and both run locally.
  • Clearcote Browser by clearcotelabs has more GitHub stars than Miniapp Cdp (290 against 275); both are community servers, and both run locally.
  • dnSpy Extension MCP by KernelErr has fewer GitHub stars than Miniapp Cdp (271 against 275); both are community servers, and both run locally.

Before you connect Miniapp Cdp

  • Give Miniapp Cdp its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Miniapp Cdp tool call until you trust what it does with them.
  • Treat text that Miniapp Cdp fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Miniapp Cdp on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Miniapp Cdp

How marketing and sales teams put Miniapp Cdp to work, by company size. Pick the size closest to yours and start Miniapp Cdp on one use case.

Small business

  • A small business can use Miniapp Cdp to check its own site after every change: forms submit, links work and checkout still loads.
  • Owners can have Miniapp Cdp collect competitor prices or offers from public pages once a week, instead of doing it by hand.
  • Miniapp Cdp runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can run Miniapp Cdp to test landing pages and signup flows on every release, catching a broken form before paid traffic hits it.
  • Growth teams can use Miniapp Cdp to capture screenshots of ads and pages across markets for reviews and audits.
  • Start Miniapp Cdp on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can run Miniapp Cdp in isolated environments with allow-listed sites, so browsing agents never reach internal or unknown pages.
  • Large web teams can use Miniapp Cdp for regression checks across many locales and devices, feeding results into release gates.
  • Miniapp Cdp is a community server, so have security review the code and pin a version before Miniapp Cdp touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Miniapp Cdp README

From zhizhuodemao/miniapp-cdp-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

MiniApp CDP MCP

English | 中文

微信小程序逆向工程 MCP 服务器,让你的 AI 编码助手(如 Claude、Cursor、Antigravity)能够直接通过 Chrome DevTools Protocol (CDP) 调试和分析微信小程序(包括微信开发者工具或 PC 端微信小程序)中的 JavaScript 代码。

功能特点

  • 多目标调试: 支持在 AppService(逻辑层)和 WebView(渲染层)目标之间无缝切换
  • 网络拦截: 捕获、监控和过滤由小程序发起的 XHR/Fetch 请求
  • 断点调试: 设置/移除代码断点和 XHR 断点,支持在压缩混淆代码中精确定位
  • 执行控制: 暂停/恢复执行,单步调试(over/into/out)并返回源码上下文
  • 脚本分析: 列出所有加载的 JS 脚本,搜索代码,获取/保存源码
  • 运行时检查: 在断点处求值表达式,检查调用栈和作用域变量
  • WebSocket 分析: 监控 WebSocket 连接和消息模式

系统要求

  • Python 3.11 或更新版本
  • uv (必需,超快的 Python 包和环境管理器)
  • 运行中的微信开发者工具(需开启调试端口)或 PC 版微信小程序(开启远程调试机制)

前置准备 1:开启小程序调试端口

在使用本 MCP 之前,你需要先通过注入工具将微信小程序的 CDP 调试端口暴露出来。你可以根据你的操作系统和微信版本,选择以下开源工具之一来完成 Hook 和端口暴露(通常暴露于 62000 端口):

前置准备 2:安装 uv

本项目通过 uvx 实现零配置的“开箱即用”。如果你还没安装 uv,请先根据你的系统执行以下命令安装:

macOS / Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

快速开始(uvx 零安装)

无需把代码克隆到本地,你可以直接利用 uv 的能力,在 AI 助手的 MCP 配置文件中添加:

{
  "mcpServers": {
    "miniapp-cdp": {
      "command": "uvx",
      "args": ["--from", "miniapp-cdp", "miniapp-cdp-mcp"]
    }
  }
}
Claude Desktop

修改 ~/Library/Application Support/Claude/claude_desktop_config.json,加入上述配置。

Cursor

进入 Cursor Settings -> Features -> MCP -> Add new MCP server:

  • Type: command
  • Name: miniapp-cdp
  • Command: uvx --from miniapp-cdp miniapp-cdp-mcp

本地安装(可选)

如果你想在本地修改或开发:

git clone https://github.com/yourusername/miniapp-cdp-py.git
cd miniapp-cdp-py
uv sync

然后在 MCP 配置中使用本地运行方式:

{
  "mcpServers": {
    "miniapp-cdp": {
      "command": "uv",
      "args": ["run", "run_mcp_server.py"],
      "cwd": "/你的路径/miniapp-cdp-py"
    }
  }
}

工具列表

目标与上下文管理
工具 描述
list_targets 列出调试器中所有可用的目标(AppService 线程、WebView 线程等)
switch_target 切换 CDP 连接到不同的目标线程进行调试上下文切换
网络与 WebSocket
工具 描述
list_network_requests 列出小程序网络请求(支持分页),或获取单条详情
get_request_initiator 获取发起网络请求的 JavaScript 调用栈
get_response_body 获取网络请求的完整响应体
get_websocket_messages 列出 WebSocket 连接或获取特定连接的消息详情
脚本分析
工具 描述
list_scripts 列出当前页面加载的所有 JavaScript 脚本
get_script_source 获取脚本源码片段,支持行范围或字符偏移
save_script_source 保存完整脚本源码到本地文件(适用于提取整包或核心风控代码)
search_in_sources 在所有脚本中搜索字符串或正则表达式
断点与执行控制
工具 描述
set_breakpoint_on_text 通过搜索代码文本自动设置断点(切勿直接对匿名函数声明下断点)
break_on_xhr 按 URL 模式设置 XHR/Fetch 断点
remove_breakpoints 移除指定的断点,或通过 clear_all=True 瞬间清空所有断点环境
list_breakpoints 列出所有活动断点
get_paused_info 获取暂停状态、调用栈和作用域变量
resume_execution 释放断点,恢复代码执行
step 单步调试(over/into/out),返回位置和源码上下文
检查工具
工具 描述
evaluate_script 在当前上下文中执行 JavaScript 表达式(支持在断点暂停时执行)

使用示例

小程序逆向工程基本流程
  1. 连接与目标切换
列出所有小程序目标,并切换到 AppService (逻辑层) 线程
  1. 查找目标函数与代码
在所有脚本中搜索包含 "encrypt" 的代码,并获取相关脚本的上下文源码
  1. 设置断点
在加密函数的具体执行语句(如 return 处)设置断点
  1. 触发并分析
在小程序上点击触发网络请求,断点命中后,检查参数、调用栈以及密钥的生成逻辑
拦截并分析网络请求
抓取最新发出的网络请求列表,并找出特定的加密请求(如带有 mina_edata 参数的请求),
随后获取该请求的发起者调用栈 (Initiator) 定位加密入口。

实战案例

在项目的 examples/ 目录下,包含了一些利用本工具逆向得出的实战脚本(例如 vipshop_decrypt_demo.py),展示了如何通过 MCP 分析出小程序的复杂多层加密算法并在 Python 中完美还原。

安全提示

此工具会将小程序的底层运行上下文暴露给 MCP 客户端,允许检查、调试和修改应用内存中的任何数据。请勿将此工具用于非法用途,仅限于个人学习、安全研究与合法授权的逆向分析。

致谢

本项目构建在 cdp-use 之上。cdp-use 提供了一个面向 Agent 场景进行高度优化和抽象的底层 WebSocket 交互层,极大地简化了原始 CDP 协议的通信复杂性。

许可证

MIT License

Questions about Miniapp Cdp

What is the Miniapp Cdp MCP server?

微信小程序逆向工程 MCP 服务器,让你的 AI 编码助手(如 Claude、Cursor、Antigravity)能够直接通过 Chrome DevTools Protocol (CDP) 调试和分析微信小程序(包括微信开发者工具或 PC 端微信小程序)中的 JavaScript 代码。. Miniapp Cdp is maintained by zhizhuodemao on GitHub at zhizhuodemao/miniapp-cdp-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Miniapp Cdp MCP server?

Miniapp Cdp doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (zhizhuodemao/miniapp-cdp-mcp). Like most servers, Miniapp Cdp ends with a command or URL you paste into your AI app's MCP config.

Does Miniapp Cdp need an API key?

The registry lists no required keys for Miniapp Cdp. Check the Miniapp Cdp README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Miniapp Cdp an official MCP server?

No. Miniapp Cdp is a community server maintained by zhizhuodemao. Community servers can be excellent; read the code and the open issues before you give Miniapp Cdp access to company data.

What license is Miniapp Cdp under?

Miniapp Cdp is released under the MIT license, according to its GitHub repository. The license covers the code of Miniapp Cdp; the service it connects to has its own terms.