Wx Mp MCP logo

Wx Mp MCP

Community
WhiteNightShadow

微信小程序逆向 MCP — 在线实时解包 + AI 静态分析还原接口签名/加密,产出本地 Node.js 直接能跑的脚本(零侵入,不碰微信进程)

PublisherWhiteNightShadow
Repositorywx-mp-mcp
LanguageJavaScript
Forks
37
Stars
225
Available tools
0
Transport typestdio, streamable-http
Categories
Links
  • Connect tools to AI workflows

    Wx Mp MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    225 stars and 37 forks from the linked repository.

wx-mp-mcp

微信小程序逆向 MCP

把小程序接口的签名 / 加密参数,还原成一个本地 Node.js 就能直接跑的脚本

MCP Node WeChat Platform NonInvasive

一个 MCP(Model Context Protocol)Server,装进你的 AI 编码工具(Claude Code / Cursor / Codex),让 AI 自动完成微信小程序的解包 → 抓包 → 签名分析 → 本地复现。


实时解包

Mac + Windows

直接读磁盘上的加密包(.wxapkg)离线解密成可读 js 源码,主包 / 分包 / 插件全解。微信开不开都行。

数据抓包

mitmproxy 拦截

HTTPS 代理拦下小程序真实请求,自动存成结构化样本——每条带 url、参数、sign 签名字段。

AI 离线分析

还原本地 Node 黑盒

AI 读 js 定位签名算法 → 穷举反推 / 沙箱实跑复现 → 导出脱离微信的独立签名脚本。

🛡️ 不碰微信进程:全程只做「读磁盘加密包 · 走代理被动抓流量 · Node 跑解包出的代码副本」三件事,不 attach 微信、不改内存、不开调试端口——不会让微信环境异常或触发风控。(传统 Frida / WMPFDebugger 要注入微信进程改内存,有封号风险,本工具刻意避开。)


多数无混淆小程序,mp_analyze 一步就能定位签名并生成复现代码(走得出 → 直接导出);只有签名被运行时加密 / JSVMP 混淆、静态读不出时,才走 抓包 → 破解 / 沙箱 那条支线。


1. 安装

方式一(推荐) —— 直接对你的 AI 编码工具说:

帮我安装下这个 mcp 工具:wx-mp-mcp
项目地址:https://github.com/WhiteNightShadow/wx-mp-mcp

AI 会自动克隆、装依赖、构建、写好 MCP 配置。

方式二 —— 手动:

bash
git clone https://github.com/WhiteNightShadow/wx-mp-mcp.git
cd wx-mp-mcp && npm install && npm run build

2. 配置到客户端

json
{
  "mcpServers": {
    "wx-mp-mcp": {
      "command": "node",
      "args": ["/绝对路径/wx-mp-mcp/dist/index.js"]
    }
  }
}
bash
claude mcp add wx-mp-mcp -- node /绝对路径/wx-mp-mcp/dist/index.js

抓包额外准备:抓包属于可选能力,需在本机安装 mitmproxy(pip install mitmproxy 或 brew install mitmproxy)。代理接入与证书配置由用户根据自己的采集环境完成;其余工具无额外外部依赖。

⚠️ macOS 提示「容器目录受权限保护」/ 找不到缓存 / 解包阻塞:微信缓存在沙盒容器里,受 macOS TCC 保护。MCP 是被你的 AI 工具拉起的 node 子进程,继承上层程序的权限。若报「受保护」「找不到缓存」,二选一:

  • 推荐:系统设置 → 隐私与安全性 → 完全磁盘访问权限 → 添加运行 MCP 的程序(Terminal / iTerm / Cursor / Claude)→ 完全退出再重开。
  • 兜底:用访达把 .../radium/Applet/packages 复制到项目下的 wxapkg-cache/(或 ~/Desktop/wxapkg-cache),会被自动发现;也可复制到任意目录后设 WXAPKG_ROOT 指向它。

多账号 / 不同微信版本下缓存可能落在 .../radium/users/<账号哈希>/... 等层级,现已自动递归探测并合并,无需手配。

Windows:新版微信 4.0(xwechat) 的小程序包在 %APPDATA%\Tencent\xwechat\radium\Applet,旧版 3.x 在 Documents\WeChat Files\Applet,两者均自动探测。注意 Documents\xwechat_files\ 是聊天文件存储、通常不含 wxapkg。

3. 上手示例

把目标告诉 AI,它会自动走上面的工作流:

分析小程序 wxXXXXXXXXXXXXXXXX 的接口 POST https://api.xxx.com/order/create,定位其 sign 签名算法,导出一个本地可独立运行的 Node 签名脚本。

完成后你本地:

bash
node signer.mjs '{"ts":"1719000000","orderId":"123"}'
# → 输出 sign,脱离微信直接复现接口请求

工具作用
解包分析
mp_list_apps列出本机微信缓存的所有小程序(appid / 版本 / 包数量)
mp_decrypt解密提取单个 .wxapkg(传 appid 自动找最新,或传文件路径)
mp_analyze一键分析:解密解包(主包+分包+插件) → 签名/加密定位 → API 抽取 → 复现代码生成 → 报告(含 crackHint:候选密钥+算法+参数序)
mp_analyze_all批量分析本机全部缓存小程序
抓包
mp_capture_start启动 mitmproxy 代理抓包,请求自动存成结构化 JSONL(默认 :8080,可按 URL 过滤)
mp_capture_list查看抓到的请求,自动标出 sign / token 等签名字段
mp_capture_stop停止抓包,返回文件路径与请求数
mp_capture_import导入已有抓包 → 归一成 JSONL(HAR / cURL / JSON 体 / JSONL,自己抓的包直接用,免走代理)
签名破解
mp_sign_crack签名穷举:抓包样本 → 枚举参数子集 × 算法(HMAC/MD5/SHA/AES/DES/3DES) → 反推精确公式并生成复现代码(传 report 直接吃 mp_analyze 的候选密钥+算法,免手动搬运)
离线沙箱
mp_sandbox_modules列出 bundle 里的所有模块,定位 SDK 签名模块位置
mp_sandbox_run在离线 Node 沙箱加载 app-service.js,执行任意 js(直调签名函数验证)
mp_sandbox_export导出独立签名脚本:追踪依赖、提取最小模块子集,生成不依赖 sandbox / bundle 的自包含 .mjs

分析产物(落在 static/out/<appid>/):可读源码树 app/、报告 report.json + REPORT.md、复现代码 repro.node.mjs + repro.python.py、独立签名脚本 signer.mjs。


使用中遇到问题、想反馈 bug、或交流逆向思路,欢迎加微信:

微信号:han8888v8888(加好友请备注「wx-mp-mcp」)


v0.1.3 — 缓存探测兼容性 + macOS 权限诊断

  • 缓存目录递归自动探测:不再写死单一路径,从微信缓存锚点递归发现所有含 <appid>/<版本>/*.wxapkg 的「包根」。修复多账号 / 不同微信版本下缓存落在 .../radium/users/<账号哈希>/... 等非默认层级时 mp_list_apps 返回 0、mp_analyze 报「未找到缓存包」的问题;多账号自动合并去重。
  • Windows 新版微信 4.0(xwechat) 支持:补 %APPDATA%\Tencent\xwechat\radium\Applet 路径(旧版 WeChat Files\Applet 仍兼容);递归时跳过聊天/媒体/缓存等重目录,避免扫 xwechat_files 的大体积归档拖慢。
  • macOS 权限保护可诊断:扫描遇到 TCC 容器保护(EPERM/EACCES)时不再静默吞掉,明确提示「授予完全磁盘访问权限」或「复制副本」两条解法;副本放进 wxapkg-cache/ 等位置自动发现。WXAPKG_ROOT 支持多路径(: / ;)覆盖。
  • mp_decrypt 传裸 appid 可自动定位最新缓存,输出落到项目内安全目录而非受保护容器。

v0.1.2 — 沙箱通用加固(实战打磨)

  • realm 自洽:沙箱不再注入外层内建,[].push === Array.prototype.push,JSVMP/字节码解释器不再崩。
  • webpack 惰性取模块:覆盖全局 jsonp 与内嵌 {id:fn} 两种形态,只实例化目标模块子树、不引导 app。
  • 多 bundle 协同:分包签名 SDK 依赖主包 runtime 时,bundle_paths 拼接单次载入。
  • JSVMP 友好:runInContext(code, ms) 带超时执行(同步死循环可中断)、调用后清退心跳定时器;补齐 wx.getRandomValues/getLogManager、performance/atob/btoa、可配 UA。
  • 网关签名检测:识别 hmac-auth / x-hmac-digest / mtgsig / wsgsig / __NS_sig 等签名协议,消除「重度签名却报无签名」假阴性。
  • 解包↔沙箱路径统一 + 报错清噪(不再回吐整包源码/命令行)。

v0.1.1

  • 新增 mp_capture_import:已有抓包(HAR / cURL / JSON 体 / JSONL)一键归一,自己抓的包直接喂破解,免走代理。
  • analyze→crack 自动桥:mp_analyze 报告多吐 crackHint(候选密钥 + 算法 + 参数序),mp_sign_crack 传 report 直接消费,少一次人工搬运。

v0.1.0

  • 11 个工具打通完整链路:实时解包 → mitmproxy 抓包 → AI 离线分析 → 导出本地 Node 黑盒脚本,经 MCP 暴露给任意 AI Agent。
  • Mac + Windows 缓存目录自动探测(WXAPKG_ROOT 可手动指定)。
  • 不碰微信进程:磁盘加密包离线解密(V1MMWX)+ 被动抓包 + Node vm 沙箱,无内存改写、无进程注入。
  • 签名多信号判定:拦截器 / 安全 SDK / 签名头 / 响应解密联合判定,避免「误报无签名」。

⚠️ 仅用于对自有 / 已授权小程序的安全分析与接口对接。不得用于未授权访问、绕过他人系统安全机制或违反服务条款的行为。

Installation

TypingMind
{
  "mcpServers": {
    "wx-mp-mcp": {
      "command": "node",
      "args": [
        "dist/index.js"
      ]
    }
  }
}

Use Wx Mp MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Wx Mp MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Wx Mp MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Wx Mp MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "wx-mp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "wx-mp-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Wx Mp MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Wx Mp MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Wx Mp MCP to help me with this task?
Wx Mp MCP
Sure. I read it.
Here is what I found using Wx Mp MCP.

Option 2: Add an MCP server URL

Use this when Wx Mp MCP is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for Wx Mp MCP.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Wx Mp MCP connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Wx Mp MCP tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Wx Mp MCP tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Wx Mp MCP to help me with this task?
Wx Mp MCP
Sure. I read it.
Here is what I found using Wx Mp MCP.

Frequently asked questions

What is the Wx Mp MCP MCP server used for?

Wx Mp MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Wx Mp MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Wx Mp MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Wx Mp MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Wx Mp MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Wx Mp MCP MCP to TypingMind?

Wx Mp MCP can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Wx Mp MCP MCP provide in TypingMind?

Wx Mp MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Wx Mp MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Wx Mp MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇