Skip to content

Releases

v0.9.25 — 工具入参 schema 不再带 $ref

Choose a tag to compare

@WaterTian WaterTian released this 01 Dec 03:53

Highlights

  • 工具入参 schema 不再带 $ref:7 个工具的 inputSchema 此前形如 {"properties": {"params": {"$ref": "#/$defs/WechatIdeInput"}}, "$defs": {...}}。这是合法的 JSON Schema,但不解析本地引用的客户端渲染不出参数表单——Glama Inspector 实测报 Unresolved $ref "#/$defs/WechatIdeInput",工具无法执行。现在注册工具后把引用就地展开,tools/list 返回的 schema 不含 $ref 与 $defs。
  • 调用方式不变:仍是 {"params": {...}},字段、枚举、默认值、说明都保留;入参校验不受影响。

Tests

  • pytest 326 → 337 passed(mcp SDK 1.x 与 2.x 下均通过)
  • stdio 协议实测:tools/list 返回 7 个工具,$ref 与 $defs 均为 0 处;tools/call 正常

Install

uvx wechat-devtools-mcp            # 或 uv tool install wechat-devtools-mcp==0.9.25

Skill 本版只更新版本号,SOP 无变化。

完整说明见 CHANGELOG.md / CHANGELOG_EN.md。

v0.9.24 — 截图去除机框边线 + README 重排

Choose a tag to compare

@WaterTian WaterTian released this 01 Dec 02:56

Highlights

  • 截图去除机框边线:开发者工具 2.x 截到的模拟器机框经缩放后,最外一圈 1px 是页面与 IDE 窗口的混色,在深色或带蒙层的页面上是一条明显的细线。现在确认是机框截图后,用内侧相邻的一条线盖掉四条边最外 1px,长图每个分段都处理;没有圆角机框的截图不受影响。
  • README 重排(中英):顺序改为「能做什么 → 快速开始 → 工具 → 与官方内建 MCP 的关系」;配置示例拆成 macOS / Windows 两份可直接复制的 JSON;各编辑器的配置位置改为折叠列表(原表格在 GitHub 上横向溢出);新增「给 AI agent」一节。

Tests

  • pytest 326 passed
  • JS:test_screenshot_corners.js 48 → 56
  • macOS 真机(Stable 2.02.2609250):原图左 / 右 / 上三条边分别有 724 / 616 / 302 个像素与内侧相邻像素不同,处理后为 0

Install

uvx wechat-devtools-mcp            # 或 uv tool install wechat-devtools-mcp==0.9.24

Skill 同步更新,已安装的项目请重跑 npx -y skills add WaterTian/wechat-devtools-mcp/.agents/skills/wechat-devtools。

完整说明见 CHANGELOG.md / CHANGELOG_EN.md。

v0.9.23 — 长图接缝修复 + 截图四角涂黑

Choose a tag to compare

@WaterTian WaterTian released this 01 Dec 02:36

Highlights

  • 长图接缝修复:状态栏、胶囊按钮、导航栏不再在每个接缝处重复出现,tabBar 上方的悬浮按钮不再被拦腰切开。固定头尾识别改为先找「原地没动、且按滚动位移对不上」的像素块,纯色行与只占一行一小段的固定元素不再把固定区判短。
  • 弹层占满视口时不硬拼:弹窗 / 蒙层 / 半屏面板盖住视口时只出当前视口,返回 viewport_covered: true,message 带 ⚠。
  • 懒加载列表拍到底:滚到「当时的底部」不再被当成到底,分段上限跟着剩余内容走;「加载中…」占位在下一页出来后原地重拍,不留在长图里。
  • 截图四角涂黑:开发者工具 2.x 截到的是带圆角的模拟器机框,圆角外原先是 IDE 窗口的杂色。现在成图四角的圆角外统一涂黑(抗锯齿),长图只涂最外面四个角,返回 frame_corner_radius;没有圆角机框的截图不受影响。

Tests

  • pytest 326 passed
  • JS:新增 test_screenshot_corners.js(48 断言)、test_screenshot_stitch.js(32 断言,成图与期望逐像素比对),test_screenshot_detect.js 13 → 23
  • macOS 真机(Stable 2.02.2609250):生产小程序 7 个页面复测,含自定义导航、悬浮按钮、弹层、20 段懒加载列表

Install

uvx wechat-devtools-mcp            # 或 uv tool install wechat-devtools-mcp==0.9.23

Skill 同步更新,已安装的项目请重跑 npx -y skills add WaterTian/wechat-devtools-mcp/.agents/skills/wechat-devtools。

完整说明见 CHANGELOG.md / CHANGELOG_EN.md。

v0.9.22 — 截图 wait_for_selector + build 工具描述补全

Choose a tag to compare

@WaterTian WaterTian released this 18 Nov 05:49

Highlights

  • wechat_screenshot 新增 wait_for_selector(配 wait_timeout_ms,默认 5000):数据异步加载的页面,先等指定元素出现,再量页面高度、再截图,避免拍到骨架屏。
  • 等不到不判失败:超时照常出图,返回 selector_found: false 与 selector_waited_ms,message 以 ⚠ 明示图里可能是加载中或空状态。
  • wechat_build 工具描述补全:逐 action 写明行为与副作用(compile 返回什么并自动重连 automator、upload 属生产操作、build_npm 何时必须跑、cache_clean 的 all 慎用)。

Tests

  • pytest 322 passed
  • macOS 真机冒烟 21/21(Stable 2.02.2609250)

Install

uvx wechat-devtools-mcp            # 或 uv tool install wechat-devtools-mcp==0.9.22

Skill 同步更新,已安装的项目请重跑 npx -y skills add WaterTian/wechat-devtools-mcp/.agents/skills/wechat-devtools。

完整说明见 CHANGELOG.md / CHANGELOG_EN.md。

v0.9.21 — CDP_PORT_OCCUPIED 错误码 + 官方 MCP Token 提醒 + Stable 2609250 回归

Choose a tag to compare

@WaterTian WaterTian released this 09 Nov 05:28

Highlights

  • CDP_PORT_OCCUPIED:wechat_ide(open) 与 wechat_inspector(cdp) 在 CDP 端口被别的浏览器(典型是常驻 Chrome 的 9222)占着时返回专属错误码,调用方不必再解析 message 分流;compile / navigate 原有的「跳过采集 + ⚠」降级不变。
  • 官方内建 MCP 强制 Token 提醒:开发者工具 Stable 2.02.2609240 起官方 MCP 需到「设置 → 安全」重新复制配置取 Token;status.official_mcp.available: true 只表示服务在跑。本项目不经过该接口,不受影响。README 中英与 SKILL 已写明,官方工具数更新为 49。
  • Stable 2.02.2609250 真机回归:tests/manual/smoke_ide.py 19/19,open / compile / quit 耗时与 2608060 同参数基线持平;经典 CLI 入口文件逐字节未变。

Tests

  • pytest 316 passed
  • macOS 真机冒烟 19/19(Stable 2.02.2609250)

Install

uvx wechat-devtools-mcp            # 或 uv tool install wechat-devtools-mcp==0.9.21

完整说明见 CHANGELOG.md / CHANGELOG_EN.md。

v0.9.20 — Synchronous wx API calls and documentation audit

Choose a tag to compare

@WaterTian WaterTian released this 26 Oct 10:01

Highlights

  • call_wx now routes synchronous wx APIs (*Sync, create*, *Manager, and info getters such as getSystemSetting / getAppBaseInfo / getWindowInfo / getDeviceInfo / canIUse) through evaluate in the logic layer and returns sync: true. Previously the automator's callWxMethod waited for a success callback that never comes and timed out after a fixed 10s. Verified live: the three sync APIs went from 10.0s timeouts to 0.0s; async APIs are unchanged. For sync APIs outside the list, a timeout now carries a hint pointing to evaluate.
  • Documentation audited field by field against the code: README (prerequisites including Node.js ≥ 18, separate install and upgrade commands, a self-check step, FAQ in current terms), MCP_DOC (screenshot parameters, navigate project_path, expected_path, return fields of status / open / compile / screenshot / navigate), SKILL (self-check rows, recovery guidance). Schema descriptions for cdp_port and project_path now match behaviour. The Node.js floor message goes from 8 to 18.
  • A 10-minute idle observation with no clients attached showed a stable project window and zero close events on DevTools 2.x; window closes always have an external cause.

Tests

  • 316 pytest cases pass; the 5 standalone JS scripts pass (61 assertions).
  • Verified live on WeChat DevTools 2.02.2608060 (macOS).

Install

uv tool install wechat-devtools-mcp --force --refresh

PyPI: https://pypi.org/project/wechat-devtools-mcp/0.9.20/

v0.9.19 — Automator recovery and CDP port guard

Choose a tag to compare

@WaterTian WaterTian released this 26 Oct 09:03

Highlights

  • start now waits for automator readiness with a deadline (45s by default, ready_timeout parameter, WECHAT_AUTOMATOR_READY_TIMEOUT), re-runs cli auto after 15s of silence, and returns ready_after_ms. This fixes the long-standing "TCP listening but WebSocket handshake incomplete" failures: on DevTools 2.02.2608060 the IDE answers currentPage about 7s after the socket opens, which the old 10s budget missed under load.
  • Automatic recovery: automator actions, navigate and screenshot run start once and retry after a connection-class failure, reported as auto_recovered. Actions with side effects retry only when the failure happened before the action ran.
  • CDP port guard: open refuses to launch when another browser holds cdp_port (cdp_port_occupant) instead of killing the IDE and reporting that browser's errors as startup errors. The port sticks for the session, WECHAT_CDP_PORT sets the default, and inspector / navigate / compile no longer capture a foreign browser's logs.
  • status reports cdp_port_occupant, project_window_open and the project's skill_version (with a hint when it differs from mcp_version).
  • Daemon health check polls at 1.5s/0.5s; the post-compile reconnect is deadline-based; node_bridge forwards handler code on failure.

Tests

  • 313 pytest cases pass; the 4 standalone JS scripts pass (46 assertions).
  • Verified live on WeChat DevTools 2.02.2608060 (macOS): cold start after closing the project window succeeds on the first probe, page_data self-recovers after the window is closed, and open on a Chrome-held port fails fast without touching the IDE.

Install

uv tool install wechat-devtools-mcp --force --refresh

PyPI: https://pypi.org/project/wechat-devtools-mcp/0.9.19/

v0.9.18 — Windows 2.x verified on a real machine, robustness fixes

Choose a tag to compare

@WaterTian WaterTian released this 04 Sep 08:25

Highlights

  • Windows 2.x verified end-to-end on a real machine (Windows 11, DevTools Stable 2.02.2608060): four smoke rounds at 19/19 plus the full pytest suite. The installer was also unpacked statically to confirm the layout; see docs/windows-internals.md.
  • State-file directory on Windows 2.x: the IDE keeps .ide / .cli / .ide-status under %LOCALAPPDATA%\微信开发者工具\User Data\<hash>\Default\. ide_state now probes each candidate root with and without the User Data layer.
  • open readiness on Windows Electron: the stale .ide port is no longer a readiness criterion. Readiness is "CDP listening + an IDE shell target in /json/list", and open proceeds even if that port never listens, deferring to the actual cli open result. open also returns miniprogram_targets_ready; when no mini-program target appears on the CDP port within 8s the message carries a warning (single-instance-lock race probe) without failing.
  • Noise filters: the startup health check ignores the 2.x extension-injected inspectee MPPage errors and access_token expired; the compile warning filter matches the --trace-deprecation hint by content instead of executable name (it is 微信开发者工具 on Windows).
  • quit / kill on Windows now poll tasklist /FO CSV until the process is gone, independent of the console code page; quit returns exited.
  • Tooling: new cross-platform real-machine smoke script tests/manual/smoke_ide.py (JSON report with checkpoints); two Windows unit tests decoupled from the real install directory.

Tests

  • 266 Python tests passed (pytest tests/ -q), on macOS and Windows 11
  • 4 Node scripts, 46 assertions passed

Install

uv tool install "wechat-devtools-mcp==0.9.18" --force --refresh

PyPI: https://pypi.org/project/wechat-devtools-mcp/0.9.18/

v0.9.17 — DevTools 2.x Stable support, function-style evaluate, faster open

Choose a tag to compare

@WaterTian WaterTian released this 04 Sep 03:57

Highlights

  • DevTools 2.x is now the official Stable channel (since 2026-08-18; 1.06 withdrawn from the download page). This release passed a full real-machine regression on Stable 2.02.2608060, covering every action of all 7 tools.
  • fn_source for evaluate: pass full function source plus args_json, mirroring the official automation_evaluate. Root-cause fix for multi-statement expression silently running only the first statement; the response now reports mode.
  • Windows 1.x/2.x dual-runtime detection using the same probes as the official installer (code\package.nw vs resources\app.asar.unpacked); Electron uses the two-step open. Not yet verified on a Windows machine.
  • status reports official_mcp: a read-only heartbeat probe of the MCP server built into IDE 2.x. When reachable, basic operations can go to the official tools while this project focuses on stitched long-page screenshots, structured CDP logs and task-level SOPs.
  • Speed-ups: open and compile wait on readiness signals instead of fixed sleeps. Real-machine open went from about 28s to 7.6s.
  • Robustness fixes: open falls back to WECHAT_PROJECT_PATH when project_path is omitted; compile filters the new CLI's Node punycode deprecation noise; start re-runs cli auto up to 3 rounds when the port does not come up; quit waits for the process to exit and returns exited; automator connection failures carry a recovery hint; call_method errors include the page path.
  • Docs: README trimmed to 167 lines with history moved to CHANGELOG; SKILL and tool reference verified field-by-field against the code (15 corrections). Config examples now register the server as wechat-devtools-mcp to avoid clashing with the wechat-devtools name that DevTools 2.x uses for its own built-in bridge.

Tests

  • 250 Python tests passed (pytest tests/ -q)
  • 4 Node scripts, 46 assertions passed

Install

uv tool install "wechat-devtools-mcp==0.9.17" --force --refresh

PyPI: https://pypi.org/project/wechat-devtools-mcp/0.9.17/

v0.9.16 — 长页面截图全面修复 + 源码开源

Choose a tag to compare

@WaterTian WaterTian released this 27 Aug 01:22

Highlights

长页面截图全面修复

固定区域识别重写:从「找没变的」改为「找会动的」

旧判据逐行比对两张截图、「没变」即判为固定区,这要求固定元素像素级稳定。但半透明/毛玻璃导航栏会透出下方滚动内容、滚动时加阴影、状态栏还带跳变的时钟 —— 任一情况都从第 0 行判负并返回 0,导航栏被当作内容拼进每一段。

新判据利用两张图之间已知的滚动距离:能按 delta 找到对应行的即滚动内容。这是滚动内容的定义性特征,与它长什么样无关,因此不再依赖固定元素稳定。旧版为兼容而堆的 MAX_GAP、SAFE_AREA_SKIP 两个补丁一并删除 —— 它们各自绑死了一种设备/设计假设。

同组合成输入对比(期望 / 旧 / 新):

场景 期望 旧 新
不透明固定头 120 120 120
半透明头部 130 0 130
头部含跳变时钟 140 20 140
纯色内容 100 200 100

最后一项是此前未知的丢数据缺陷:纯色内容逐行「没变」,被误判为固定区而整块吞掉,不会出现在成图里。

其余三处

  • 长图停在前两屏:waitForScrollComplete 旧实现连续两次读数相同即返回,pageScrollTo 尚未生效时两次读到的都是滚动前的位置,调用方据此判定「已到底部」直接停止
  • 首屏与第二屏之间的缺口:改为首步用保守步长起步,测出固定区域后再放宽(步长偏小只多些重叠、会被裁掉;偏大则造成无法追补的缺口,代价不对等)
  • 懒加载列表的截断误报:分段上限改按实际步长计算,并每段重读页面高度跟随增长

拍不全 / 测不准不再静默

is_scroll_view_page、truncated、content_gaps、detection_confident 此前要么被 Math.max(0,...) 夹掉、要么在 Python 侧 _ok() 中被丢弃(与 v0.9.15 那个「CDP 恒返回 0 条」同一类缺陷:JS 产出了数据、Python 读不到)。现全部透传并在 message 中以 ⚠ 明示。node_bridge 失败分支同时保留 handler 给的 hint。

源码开源

本项目源码已并入本仓库(#11):src/、测试套件、Node 脚本,并新增 CONTRIBUTING.md。同时移除自 v0.9.5 起就未注册的 wechat_cloud 死代码。

Tests

  • pytest 214 项全通过
  • JS 23 项断言全通过(固定区域检测 13 + 滚动等待 10,均直接 require 线上实现)
  • 真机验证(开发者工具 2.x / Electron):
    • 帮助页 fixed_header 0 → 166,接缝导航栏重复消失;旧版在接缝丢了一条内容
    • 某列表页 3 段 3184px → 7 段 6815px
    • 6 个页面用整条带匹配验证:顶栏、底栏各只出现 1 次

Install

uv tool install wechat-devtools-mcp --force --refresh

PyPI: https://pypi.org/project/wechat-devtools-mcp/0.9.16/