MiniApp CDP MCP
The MiniApp CDP MCP server enables AI coding assistants to debug and reverse-engineer WeChat Mini Programs via the Chrome DevTools Protocol (CDP).
Target Management: List and switch between debugging targets (AppService logic layer / WebView rendering layer).
Network Monitoring: List, filter, and paginate XHR/Fetch requests; retrieve full response bodies and the JavaScript call stack that initiated each request.
WebSocket Analysis: Monitor WebSocket connections and inspect messages with pagination and direction filtering.
Script Management: List all loaded scripts, retrieve source code by URL/script ID (with line range or character offset support), and save full sources to local files.
Code Search: Search for strings or regex patterns across all loaded JavaScript sources, with options for case sensitivity, minified file exclusion, and result limits.
Breakpoint Debugging: Set breakpoints by text search or XHR/Fetch URL pattern, list all active breakpoints, and remove specific or all breakpoints.
Execution Control: Pause/resume execution and step through code (over/into/out).
Runtime Inspection: Evaluate JavaScript expressions in the current or paused context, inspect call stacks, and examine scope variables at breakpoints.
Provides debugging and analysis tools for WeChat Mini Programs, enabling AI assistants to inspect JavaScript code, intercept network requests, set breakpoints, and analyze runtime behavior through Chrome DevTools Protocol.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MiniApp CDP MCPlist all network requests from the last 5 minutes and show me the ones with encrypted parameters"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MiniApp CDP MCP
English | Chinese
WeChat MiniApp reverse engineering MCP server, allowing your AI coding assistant (such as Claude, Cursor, Antigravity) to directly debug and analyze JavaScript code in WeChat MiniApps (including WeChat DevTools or PC WeChat MiniApps) via the Chrome DevTools Protocol (CDP).
Features
Multi-target Debugging: Seamlessly switch between
AppService(logic layer) andWebView(rendering layer) targets.Network Interception: Capture, monitor, and filter XHR/Fetch requests initiated by the MiniApp.
Breakpoint Debugging: Set/remove code breakpoints and XHR breakpoints, with support for precise positioning in minified/obfuscated code.
Execution Control: Pause/resume execution, step debugging (over/into/out), and return source code context.
Script Analysis: List all loaded JS scripts, search code, and retrieve/save source code.
Runtime Inspection: Evaluate expressions at breakpoints, and inspect call stacks and scope variables.
WebSocket Analysis: Monitor WebSocket connections and message patterns.
Related MCP server: MCP JS Debugger
System Requirements
Python 3.11 or newer
uv (Required, ultra-fast Python package and environment manager)
Running WeChat DevTools (with debug port enabled) or PC WeChat MiniApp (with remote debugging mechanism enabled)
Prerequisite 1: Enable MiniApp Debug Port
Before using this MCP, you need to expose the WeChat MiniApp's CDP debug port using an injection tool. Depending on your OS and WeChat version, you can choose one of the following open-source tools to perform the Hook and port exposure (usually exposed on port 62000):
WMPFDebugger-arm (For macOS ARM architecture)
Prerequisite 2: Install uv
This project achieves zero-configuration "out-of-the-box" usage via uvx. If you haven't installed uv yet, please execute the following command based on your system:
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Quick Start (uvx zero-install)
No need to clone the code locally; you can directly leverage uv's capabilities by adding the following to your AI assistant's MCP configuration file:
{
"mcpServers": {
"miniapp-cdp": {
"command": "uvx",
"args": ["--from", "miniapp-cdp", "miniapp-cdp-mcp"]
}
}
}Claude Desktop
Modify ~/Library/Application Support/Claude/claude_desktop_config.json and add the configuration above.
Cursor
Go to Cursor Settings -> Features -> MCP -> Add new MCP server:
Type:
commandName:
miniapp-cdpCommand:
uvx --from miniapp-cdp miniapp-cdp-mcp
Local Installation (Optional)
If you want to modify or develop locally:
git clone https://github.com/yourusername/miniapp-cdp-py.git
cd miniapp-cdp-py
uv syncThen use the local execution method in your MCP configuration:
{
"mcpServers": {
"miniapp-cdp": {
"command": "uv",
"args": ["run", "run_mcp_server.py"],
"cwd": "/你的路径/miniapp-cdp-py"
}
}
}Tool List
Target and Context Management
Tool | Description |
| List all available targets in the debugger (AppService thread, WebView thread, etc.) |
| Switch CDP connection to a different target thread for debugging context switching |
Network and WebSocket
Tool | Description |
| List MiniApp network requests (supports pagination), or get details for a single request |
| Get the JavaScript call stack that initiated the network request |
| Get the full response body of a network request |
| List WebSocket connections or get message details for a specific connection |
Script Analysis
Tool | Description |
| List all JavaScript scripts loaded in the current page |
| Get script source code snippets, supports line ranges or character offsets |
| Save the full script source code to a local file (suitable for extracting full packages or core risk control code) |
| Search for strings or regular expressions across all scripts |
Breakpoints and Execution Control
Tool | Description |
| Automatically set breakpoints by searching code text (do not set breakpoints directly on anonymous function declarations) |
| Set XHR/Fetch breakpoints by URL pattern |
| Remove specified breakpoints, or clear all breakpoint environments instantly with |
| List all active breakpoints |
| Get pause status, call stack, and scope variables |
| Release breakpoints and resume code execution |
| Step debugging (over/into/out), returns position and source code context |
Inspection Tools
Tool | Description |
| Execute JavaScript expressions in the current context (supported while paused at a breakpoint) |
Usage Examples
Basic MiniApp Reverse Engineering Workflow
Connection and Target Switching
列出所有小程序目标,并切换到 AppService (逻辑层) 线程Finding Target Functions and Code
在所有脚本中搜索包含 "encrypt" 的代码,并获取相关脚本的上下文源码Setting Breakpoints
在加密函数的具体执行语句(如 return 处)设置断点Triggering and Analysis
在小程序上点击触发网络请求,断点命中后,检查参数、调用栈以及密钥的生成逻辑Intercepting and Analyzing Network Requests
抓取最新发出的网络请求列表,并找出特定的加密请求(如带有 mina_edata 参数的请求),
随后获取该请求的发起者调用栈 (Initiator) 定位加密入口。Practical Cases
The examples/ directory in the project contains some practical scripts derived from reverse engineering using this tool (e.g., vipshop_decrypt_demo.py), demonstrating how to analyze complex multi-layer encryption algorithms of MiniApps via MCP and perfectly restore them in Python.
Security Notice
This tool exposes the underlying runtime context of the MiniApp to the MCP client, allowing for the inspection, debugging, and modification of any data in the application's memory. Do not use this tool for illegal purposes; it is intended solely for personal learning, security research, and legally authorized reverse engineering analysis.
Acknowledgments
This project is built on cdp-use. cdp-use provides a low-level WebSocket interaction layer that is highly optimized and abstracted for Agent scenarios, greatly simplifying the communication complexity of the raw CDP protocol.
License
MIT License
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
- Alicense-qualityDmaintenanceEnables AI assistants to debug Node.js applications using Chrome DevTools Protocol. Provides comprehensive debugging capabilities including breakpoints, stepping, variable inspection, expression evaluation, and console monitoring.180348MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to debug JavaScript and TypeScript applications by connecting to Chrome DevTools Protocol-compatible debuggers, allowing them to set breakpoints, step through code, inspect variables, and evaluate expressions with full source map support.18142Apache 2.0
- AlicenseAqualityAmaintenanceEnables AI coding assistants to debug and analyze JavaScript code in web pages through breakpoint debugging, function hooking, network analysis, and runtime inspection of scripts including minified code.249462,461Apache 2.0
- AlicenseBqualityCmaintenanceEnables AI agents to debug code and automate browsers using Chrome DevTools Protocol, supporting breakpoints, variable inspection, and replayable interaction recording.3586016MIT
Related MCP Connectors
Live browser debugging for AI assistants — DOM, console, network via MCP.
A paid remote MCP for AI agent browser DevTools MCP, built to return verdicts, receipts, usage logs,
Reasoning, code, anti-deception, memory harness MCP tools. Stdio or HTTPS api.ejentum.com/mcp
Appeared in Searches
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/zhizhuodemao/miniapp-cdp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server