About Weapp Dev MCP
Weapp Dev MCP is an MCP server published by yfmeii in the Communication category: fastMCP server for automating WeChat Mini Program developer tooling. Conduid read 30 tools from its source: element_callMethod, element_getAttributes, element_getBoundingClientRect, element_getData, element_getInnerElement, element_getInnerElements and 24 more. It is published to npm as @yfme/weapp-dev-mcp and starts with npx.
The repository has 176 stars and 25 forks, and its last commit was on 13 Jul 2026. The latest release is v0.2.5 (1 Jun 2026): 更新内容 新功能 ✨ 新增 mp_mockWxMethod 工具 - 当前有限支持 mock wx.request 成功响应,可通过 action: "mock" 设置规则,通过 action: "restore" 恢复原始 wx.request ✨ mp_mockWxMethod 支持多种请求匹配规则:contains、exact、r… It follows v0.2.4 (12 May 2026), and the 5 most recent releases go back to v0.2.0 (2 Apr 2026). It passes 2 of the 6 static checks Conduid ran on the repository; it does not pass License declared, Tests present, No dynamic code execution and Scoped permissions. Its topics include comms.
Install
claude mcp add weapp-dev-mcp -- npx -y @yfme/weapp-dev-mcpnpx -y @yfme/weapp-dev-mcpgit clone https://github.com/yfmeii/weapp-dev-mcpTools (30)
element_callMethod调用自定义组件实例的方法element_getAttributes获取元素的特性值,names 参数为特性名数组(如 `['class', 'id', 'data-index']`)element_getBoundingClientRect获取元素相对于视口的边界矩形信息(left、top、width、height、right、bottom),考虑 CSS transform 变换;选择器支持微信小程序 SelectorQuery 子集(ID、class、连续 class、子代、后代、跨自定义组件后代和并集选择器)element_getData获取自定义组件实例的渲染数据element_getInnerElement获取元素内的元素(相当于 `element.$(selector)`),返回元素摘要信息;设置 `withWxml: true` 可额外返回完整 outerWxmlelement_getInnerElements获取元素内的元素数组(相当于 `element.$$(selector)`),返回元素摘要信息;设置 `withWxml: true` 可额外返回每个元素的完整 outerWxmlelement_getStyles获取元素的 CSS 样式值,names 参数为样式名数组(如 `['color', 'fontSize']`)element_getWxml获取元素 WXML(内部或外部)element_input向元素输入文本(适用于 `input` 和 `textarea` 组件)element_scrollTo滚动 scroll-view 组件到指定位置(x, y)element_setData设置自定义组件实例的渲染数据element_tap通过 CSS 选择器模拟点击 WXML 元素;支持 [index=N] 语法选择第 N 个元素;支持 x/y 坐标偏移点击;增强稳定性:等待元素可交互状态,点击后自动验证页面路径是否变化mp_callWx调用微信小程序 API 方法(如 `wx.showToast`)mp_currentPage获取当前页面信息(路径、查询参数、尺寸、滚动位置),`withData` 为 true 时额外返回页面数据mp_ensureConnection确保自动化会话就绪;可选择强制重连或覆盖连接设置mp_getLogs获取小程序控制台日志,可选择获取后清除mp_listProjects列出微信开发者工具中的最近项目,方便选择项目目录mp_mockWxMethod有限 mock `wx` 方法能力;当前支持 `method: "request"`,通过 `action: "mock"` 设置 `wx.request` 规则,通过 `action: "restore"` 恢复原方法mp_navigate在小程序内导航,支持 `navigateTo`、`redirectTo`、`reLaunch`、`switchTab` 或 `navigateBack`mp_screenshot捕获屏幕截图并返回(或保存到磁盘);若微信开发者工具的自动化截图接口失败或超时,请改用客户端/系统提供的截图 API 截取开发者工具模拟器区域mp_setDefaultProject设置默认的小程序项目路径,设置后下次连接会自动使用该项目| Parameter | Type | Description |
|---|---|---|
| projectPath * | string |
page_callMethod调用当前页面实例上暴露的方法page_getData获取当前页面的数据对象,可指定路径(支持嵌套路径如 'user.name')page_getElement通过选择器获取页面元素,返回元素摘要信息(tagName、text、value、size、offset);设置 `withWxml: true` 可额外返回完整 outerWxml;支持 [index=N] 语法选择第 N 个元素page_getElementByXpath通过 XPath 获取页面第一个匹配元素,适合按文本、属性、层级关系、ancestor/following 等表达式定位;设置 `withWxml: true` 可额外返回完整 outerWxmlpage_getElements通过选择器获取页面元素数组,返回每个元素的摘要信息;设置 `withWxml: true` 可额外返回每个元素的完整 outerWxml;支持 [index=N] 语法page_getElementsByXpath通过 XPath 获取页面匹配元素数组,返回每个元素的摘要信息;设置 `withWxml: true` 可额外返回每个元素的完整 outerWxmlpage_setData使用 `setData` 更新当前页面的数据;增加 verify 选项,验证数据是否真正更新成功page_waitElement等待元素出现在页面上(⚠️ 不适用于自定义组件内部元素);支持 [index=N] 语法;增加超时和重试间隔参数page_waitTimeout等待指定的毫秒数Security checks
Static checks derived from the repository 11 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 936 words.
- !License declaredNo license file. Legally you have no right to use it in a product.
- !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
- ✓Dependencies pinnedDependency versions are pinned by package-lock.json.
- !No dynamic code executionScanned 9 source files and found 1 call to eval or shell execution, in src/tools/common.ts:275. Review how tool inputs reach them before granting credentials.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdiosrc/index.ts:31
- Starts other programs
- 1 callsrc/weappClient.ts:982
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- 6 callssrc/weappClient.ts:62, src/weappClient.ts:68, src/weappClient.ts:69
- Lockfile
- package-lock.json
Pattern matches on the source text of 9 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 936 words, fetched a month ago. The original in the repository is authoritative.
Read full README