WeChat Mini Program Dev MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| WEAPP_AUTOCLOSE | No | 设置为 true 时,每次工具调用后关闭开发者工具会话 | |
| WEAPP_WS_ENDPOINT | No | 【推荐】已运行的开发者工具 WebSocket 端点。设置后,服务器使用 connect 模式而不是启动新实例。示例:ws://localhost:9420 | |
| WEAPP_AUTO_ACCOUNT | No | 传递给 --auto-account 用于自动登录 | |
| WEAPP_DEVTOOLS_CWD | No | 传递给开发者工具进程的工作目录 | |
| WEAPP_DEVTOOLS_ARGS | No | 启动时的额外 CLI 参数(空格分隔) | |
| WEAPP_DEVTOOLS_PORT | No | 启动开发者工具时的首选端口(回退到可用端口) | |
| WEAPP_TRUST_PROJECT | No | 设置为 true 以在启动时包含 --trust-project | |
| WEAPP_AUTOMATOR_MODE | No | 强制使用 launch 或 connect 模式。除非提供了 WEAPP_WS_ENDPOINT,否则默认为 launch | |
| WEAPP_DEVTOOLS_TICKET | No | 启动时传递给 --ticket | |
| WEAPP_DEVTOOLS_TIMEOUT | No | 启动超时时间(毫秒,默认 30000) | 30000 |
| WECHAT_DEVTOOLS_CLI_PATH | No | 微信开发者工具 CLI 路径(如果默认路径有效则可选) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| logging | {} |
| prompts | {} |
| completions | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| mp_ensureConnectionA | 检查小程序自动化会话是否就绪。先调用这个工具,再调用 mp_screenshot、page_* 或 element_* 工具。若失败,优先用 reconnect=true 重试一次;若返回项目选择提示,则传 projectSelection。 |
| mp_navigateC | 在小程序内导航,支持 navigateTo、redirectTo、reLaunch、switchTab 和 navigateBack。 |
| mp_screenshotA | 截取当前小程序视口的截图。需要已有活动会话;若提示没有活动会话,请先调用 mp_ensureConnection。默认返回内联图片,或保存到文件路径。 |
| mp_callWxC | 调用微信小程序 API 方法,(如 |
| mp_getLogsC | 获取小程序控制台日志。可选择在获取后清空日志。 |
| mp_currentPageA | 获取当前页面的信息,包括路径、查询参数、尺寸和滚动位置。通常在 mp_ensureConnection 成功后立即调用,用于确认当前页面。withData 为 true 时额外返回页面数据。 |
| mp_listProjectsB | 列出微信开发者工具中的最近项目,方便在 mp_ensureConnection 返回项目选择提示后继续选择项目。 |
| mp_setDefaultProjectA | 设置默认的小程序项目路径,设置后下次连接会优先使用该项目。通常用于修复项目选择失败后的后续重试。 |
| page_getElementB | 通过选择器获取页面元素,相当于 page.$(selector)。返回每个元素的摘要信息(tagName、text、value、size、offset);设置 withWxml 为 true 可额外返回元素的完整 outerWxml。支持 [index=N] 语法选择第 N 个元素。 |
| page_getElementsA | 通过选择器获取页面元素数组,相当于 page.$$(selector)。返回每个元素的摘要信息(tagName、text、value、size、offset);设置 withWxml 为 true 可额外返回每个元素的完整 outerWxml。支持 [index=N] 语法选择第 N 个元素。 |
| page_waitElementC | 等待指定选择器的元素出现在页面上。支持 [index=N] 语法选择第 N 个元素。增强版:增加了超时和重试间隔参数。 |
| page_waitTimeoutC | 等待指定的毫秒数。 |
| page_getDataC | 获取当前页面的数据对象,可选择指定子数据路径。 |
| page_setDataC | 使用 setData 更新当前页面的数据。 |
| page_callMethodC | 调用当前页面实例上暴露的方法。参数可以作为数组提供。 |
| element_tapA | 通过 CSS 选择器模拟点击 WXML 元素。支持 [index=N] 语法选择第 N 个元素。如需点击自定义组件内部的元素,请使用 innerSelector 参数:selector 设为组件 ID 选择器(如 #my-component)或标签选择器,innerSelector 设为组件内部元素的选择器。 |
| element_inputC | 向指定元素输入文本。 |
| element_callMethodB | 调用组件实例指定方法,仅自定义组件可以使用。 |
| element_getDataC | 获取组件实例渲染数据,仅自定义组件可以使用。 |
| element_setDataB | 设置组件实例渲染数据,仅自定义组件可以使用。 |
| element_getInnerElementD | 在元素范围内获取元素,相当于 element.$(selector)。设置 withWxml 为 true 可额外返回每个元素的完整 outerWxml。 |
| element_getInnerElementsC | 在元素范围内获取元素数组,相当于 element.$$(selector)。设置 withWxml 为 true 可额外返回每个元素的完整 outerWxml。 |
| element_getWxmlC | 获取元素 WXML。默认获取内部 WXML(element.wxml()),设置 outer 为 true 可获取包含元素本身的 WXML(element.outerWxml())。 |
| element_getStylesC | 获取元素的样式值。names 为样式名数组(如 ['color', 'fontSize', 'backgroundColor'])。 |
| element_scrollToA | 滚动 scroll-view 组件到指定位置。仅适用于 scroll-view 组件。 |
| element_getAttributesC | 获取元素的特性值。names 为特性名数组(如 ['class', 'id', 'data-index'])。 |
| element_getBoundingClientRectA | 获取元素相对于视口的边界矩形信息(left、top、width、height、right、bottom)。此方法返回的是考虑 CSS transform 变换后的实际渲染尺寸和位置。支持跨组件查询:若需获取自定义组件内部元素,可将 selector 设为组件选择器,innerSelector 设为内部元素选择器。注意:目前仅支持 ID 选择器、类选择器。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| connect-and-inspect-home | Connect to the mini program, confirm the current page, then inspect the home page UI. |
| recover-connection | Recover a failed mini program connection using the MCP's expected retry order. |
| connect-and-screenshot | Connect first, then capture a screenshot from the active mini program page. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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/yfmeii/weapp-dev-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server