Wmpf MCP Bridge logo

Wmpf MCP Bridge

Community
an7ln

ai渗透测试小程序

Publisheran7ln
Repositorywmpf-mcp-bridge
LanguageTypeScript
Forks
19
Stars
125
Available tools
0
Transport typestdio
LicenseMIT
Links
  • Connect tools to AI workflows

    Wmpf MCP Bridge 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

    125 stars and 19 forks from the linked repository.

wmpf-mcp-bridge

本项目是一个本地 Streamable HTTP MCP Server,用于把 WMPFDebugger 暴露的裸 Chrome DevTools Protocol WebSocket 包装成 MCP 工具,辅助 Codex / Cursor / VS Code Agent 对已授权调试的微信小程序进行安全评估、证据采集和报告整理。

使用边界

  • 仅用于已获得授权的小程序、本机调试环境和当前 WMPFDebugger 会话。
  • MCP HTTP 服务只监听 127.0.0.1。
  • 默认只连接 ws://127.0.0.1:62000,CDP URL 只允许 127.0.0.1 或 localhost。
  • /mcp 必须携带启动时输出的 token。
  • 主动请求修改/重放能力未实现;当前工具只做被动采集、单次页面交互观察和人工验证计划生成。
  • 点击类工具会拦截支付、提交订单、删除、注销、退款、提现、确认支付等危险文本,默认不执行,必须显式 requireConfirm=true。

安装与启动

powershell
npm install
npm run dev

也可以指定固定 token:

powershell
$env:MCP_TOKEN="your-local-token"
npm run dev

启动后访问根路径查看当前 MCP URL:

text
http://127.0.0.1:43827/

默认 MCP URL:

text
http://127.0.0.1:43827/mcp?token=wmpf-local-token

Codex 配置

toml
[mcp_servers.wmpf]
enabled = true
url = "http://127.0.0.1:43827/mcp?token=wmpf-local-token"
startup_timeout_sec = 20
tool_timeout_sec = 60

建议测试提示词

text
使用 wmpf MCP,先调用 wmpf_start。它会连接 ws://127.0.0.1:62000、选择 appservice context,并安装 wx.request/fetch/XHR 被动 hook。
随后打开当前小程序页面并操作关键业务流程。
再调用 dump_runtime_snapshot、get_all_requests、get_api_inventory、analyze_auth_surface、find_idor_candidates、find_sensitive_data_exposure、find_upload_surfaces、find_payment_and_order_surfaces、find_sign_related_requests。
请基于证据生成 generate_security_notes,只输出发现线索和人工验证建议,不直接下漏洞结论。

Agent 工具发现

MCP 初始化响应包含 server-wide instructions。Codex 看到 wmpf、wmpf-mcp、WMPFDebugger、微信小程序调试/逆向/安全评估时,应直接调用 wmpf_start,不需要先手工枚举 CDP Target 或逐个查找底层工具。

wmpf_start 是稳定的单入口,会完成:

  1. 连接本地 CDP WebSocket。
  2. 启用 Runtime 和 Network。
  3. 自动选择 appservice execution context。
  4. 注入 wx.request、fetch 和 XHR 被动 hook。
  5. 返回页面快照和推荐的下一步工具。

如果客户端把部分 MCP 工具延迟加载,Agent 应使用 tool search 查询 wmpf <任务>。核心工作流不再依赖 Agent 自己猜测入口。

工具列表

基础连接与 CDP

  • wmpf_start:首选单入口。遇到 wmpf 相关任务时优先调用,自动连接、选择 appservice、安装 hook,并返回下一步建议。
  • status:查看 MCP 和 CDP 连接状态。
  • connect_wmpf:连接本机 WMPFDebugger CDP WebSocket,并启用 Runtime/Network。
  • select_appservice_context:自动枚举 Target、flatten attach,并选择包含 wx.request / require / getCurrentPages 的 appservice Runtime context。
  • cdp_call:调用任意 CDP 方法,支持传入 flatten sessionId。
  • cdp_call_target:对指定 targetId 自动 Target.attachToTarget({ flatten: true }) 后在子 session 中调用 CDP。
  • runtime_eval:在当前 Runtime 执行 JS。
  • runtime_eval_appservice:在自动选择的 appservice Runtime context 中执行 JS。
  • network_enable:启用 CDP Network。
  • get_recent_requests:读取最近 CDP Network 请求,支持 domain、pathPrefix、keyword、excludeStatic、compact 过滤。
  • get_response_body:尝试读取 CDP 响应体。
  • get_recent_console:读取 console 和 exception 事件。

运行时与页面探索

  • dump_runtime_snapshot:采集页面运行时快照、storage 摘要、可见文本、可交互元素、疑似框架对象。
  • get_basic_page_info:兼容旧版页面信息工具。
  • get_document_html:读取 document HTML 前缀。
  • query_selector_text:读取指定元素文本和 HTML。
  • list_interactive_elements:列出按钮、输入框、链接及高风险关键词元素。
  • safe_click_and_observe:单次点击并观察 URL、文本、storage、请求和 console 变化。
  • input_text_and_observe:输入文本并观察变化。
  • inspect_window_keys:检索 window keys。
  • search_global_string:搜索页面、脚本、window keys 中的单个关键词。

网络采集与接口资产

  • hook_wx_request:自动选择 appservice context 后注入非破坏性 wx.request hook。
  • hook_fetch_and_xhr:注入非破坏性 fetch/XHR hook,记录响应和调用栈。
  • get_hooked_requests:读取 fetch/XHR hook 记录。
  • get_all_requests:汇总 CDP、wx.request、fetch/XHR 请求,并统一格式。
  • get_request_detail:查询单个请求详情,CDP 请求会尝试读取响应体。
  • get_api_inventory:按 method + path 生成接口资产清单。

漏洞线索识别

  • analyze_auth_surface:分析认证字段、token 位置、query token、缺失认证和重放线索。
  • find_idor_candidates:查找越权候选接口,只给人工验证建议。
  • find_sensitive_data_exposure:查找敏感字段并默认脱敏。
  • find_upload_surfaces:识别上传、文件、图片、头像、媒体接口。
  • find_payment_and_order_surfaces:识别支付、订单、优惠券、钱包、积分接口。
  • find_debug_admin_surfaces:识别 debug/test/admin/internal/dev/staging/mock 线索。
  • find_sign_related_requests:识别 sign/signature/timestamp/nonce 请求。

主动验证辅助但默认安全

  • build_replay_plan:根据请求生成 Burp Repeater 人工重放计划,不发送请求。
  • compare_two_requests:对比两个请求的 URL、header、body、auth 和 response 差异。
  • passive_param_fuzz_suggestions:生成参数 fuzz 建议,不发送请求,并标注需要授权环境人工验证。

源码与签名逻辑分析

  • inspect_wx_config:读取 __wxConfig、__wxAppCode__、__wxRoute、__wxAppData__ 摘要和关键词命中。
  • search_runtime_keywords:搜索 window keys、document HTML、script 文本、storage 和已抓请求。
  • trace_request_callstack:从 hook 记录中提取发起请求的 JS 调用栈。

状态篡改/复原辅助

  • inspect_vuex_store:在 appservice context 中查找 Vuex-like store,保存原始 state 快照,并返回 state/mutations/actions 摘要。
  • patch_vuex_state:按 path 修改 state 或调用 mutation。默认 dryRun=true,只有 dryRun=false 且 requireConfirm=true 才会修改本地 Runtime 状态。
  • restore_vuex_state:从 inspect_vuex_store 保存的快照恢复 state。默认 dryRun=true,只有 dryRun=false 且 requireConfirm=true 才会恢复。

报告与证据

  • export_session:导出当前会话 JSON 到 reports/session-*.json。
  • generate_security_notes:生成 Markdown 安全评估笔记,只写发现线索和验证建议。
  • generate_api_table_markdown:生成接口清单 Markdown 表格。

推荐工作流

  1. 启动 WMPFDebugger 并确认 DevTools 可连接 ws=127.0.0.1:62000。
  2. 启动本项目并把启动输出的 MCP URL 配入 Codex。
  3. 调用 connect_wmpf。
  4. 调用 select_appservice_context,确认选中的 context 包含 wx.request / require。
  5. 调用 hook_wx_request 和 hook_fetch_and_xhr。
  6. 在小程序中人工操作登录、搜索、下单前流程、个人中心、地址、优惠券、上传等页面。
  7. 使用 get_recent_requests 的 excludeStatic=true、domain、pathPrefix 过滤图片、字体、data URI 等噪声。
  8. 调用 get_api_inventory 和各类 find_* 工具生成线索。
  9. 对候选接口使用 build_replay_plan、compare_two_requests、passive_param_fuzz_suggestions 制定人工验证步骤。
  10. 如需验证前端状态授权绕过,先调用 inspect_vuex_store 保存快照,再用 patch_vuex_state dry-run 预览;确认后才设置 dryRun=false 和 requireConfirm=true。结束后用 restore_vuex_state 复原。
  11. 调用 export_session 和 generate_security_notes 保存证据与笔记。

构建

powershell
npm run build
npm start

License

MIT

Use Wmpf MCP Bridge MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Wmpf MCP Bridge is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to 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 Wmpf MCP Bridge 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 Wmpf MCP Bridge 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": {
    "wmpf-mcp-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Wmpf MCP Bridge 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 Wmpf MCP Bridge 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 Wmpf MCP Bridge to help me with this task?
Wmpf MCP Bridge
Sure. I read it.
Here is what I found using Wmpf MCP Bridge.

Frequently asked questions

What is the Wmpf MCP Bridge MCP server used for?

Wmpf MCP Bridge 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 Wmpf MCP Bridge MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Wmpf MCP Bridge 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 Wmpf MCP Bridge 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 Wmpf MCP Bridge connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Wmpf MCP Bridge MCP to TypingMind?

Wmpf MCP Bridge runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Wmpf MCP Bridge MCP provide in TypingMind?

Wmpf MCP Bridge 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 Wmpf MCP Bridge MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Wmpf MCP Bridge 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 👇