Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
WECHAT_DEVTOOLS_DIRNoThe WeChat DevTools installation directory.C:\Program Files (x86)\Tencent\微信web开发者工具
WECHAT_DEVTOOLS_PROJECTNoThe default mini program project directory.
WECHAT_DEVTOOLS_CLI_TOKENNoThe token used when the CLI requires one (not passed via tool parameters).
WECHAT_DEVTOOLS_MCP_OUTPUT_DIRNoThe screenshot output directory.<repo>/output
WECHAT_DEVTOOLS_AUTOMATION_PORTNoThe automation port.9420
WECHAT_DEVTOOLS_MCP_ALLOW_UPLOADNoSet to `1` to allow the upload tool.
WECHAT_DEVTOOLS_NO_STALE_CLEANUPNoSet to `1` to disable cleaning up stale `.ide` port files left after the IDE exits.
WECHAT_DEVTOOLS_SKIP_SERVICE_PORT_CHECKNoSet to `1` to skip the pre-check.

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

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
wdt_statusA

检查开发者工具路径、服务端口开关、自动化连接状态与端口占用。开始任何操作前可先调用。

wdt_openA

调用官方 CLI 打开(或聚焦)一个小程序项目。需要服务端口开启;登录状态由 IDE 决定。

wdt_close_projectA

关闭指定项目窗口,不退出整个开发者工具。

wdt_quitA

退出整个微信开发者工具。会关闭所有项目窗口。

wdt_loginA

触发官方 CLI 登录,stdout 中通常包含二维码(终端字符画)。需要用户用微信扫码。

wdt_is_loginA

调用官方 CLI islogin,返回当前是否已登录。预览和上传前建议先检查。

wdt_previewB

调用官方 CLI 生成预览。qrFormat=image/base64 时可把二维码写入 qrOutput。需要已登录。

wdt_build_npmC

调用官方 CLI 执行 build-npm,构建项目依赖。

wdt_uploadA

调用官方 CLI 上传版本到微信后台。默认禁用;仅在 WECHAT_DEVTOOLS_MCP_ALLOW_UPLOAD=1 且 confirm=true 时执行。此操作会发布版本,不可撤销。

wdt_auto_startA

通过 CLI auto 打开项目并开启自动化端口,然后建立 WebSocket 连接。需要服务端口开启。后续 wdt_current_page / wdt_query / wdt_element / wdt_screenshot 等工具依赖此连接。

wdt_auto_connectB

不启动 IDE,直接连接一个已经用 auto 模式打开的自动化端口。

wdt_disconnectA

关闭 WebSocket 自动化连接;closeProject=true 时同时关闭项目窗口。不会退出开发者工具。

wdt_current_pageB

返回当前小程序页面的路径、query,以及页面栈路径。

wdt_navigateC

在当前小程序中跳转:navigateTo / redirectTo / reLaunch / switchTab / navigateBack。

wdt_queryB

用 CSS 选择器查询当前页面元素,返回 tagName、文本、id/class、value 等摘要。

wdt_elementC

对匹配 selector 的第 index 个元素执行动作:tap/longpress/input/text/value/attribute/property/style/wxml/outerWxml/size/offset/trigger/scrollTo/scrollWidth/scrollHeight/swipeTo/slideTo/callMethod/callContextMethod/setData/data。slideTo 会补发 change 事件;swipeTo 只改视觉索引。

wdt_waitA

等待 CSS 选择器出现(传字符串)或等待固定毫秒数(传数字),最长 60 秒。

wdt_page_dataC

action=get 读取 data(可选 path);action=set 调用 setData;action=call 调用页面方法。

wdt_screenshotA

截取当前小程序模拟器画面为 PNG。path 省略时写入 MCP output 目录并返回文件路径。

wdt_evaluateA

在 miniProgram.evaluate 中执行表达式或函数体,返回可序列化结果。默认把输入当表达式自动包成函数;mode=function 时原样传入函数声明。可通过 $args 访问 args 参数。仅用于本地调试,注意副作用。

wdt_wx_methodC

通过 miniProgram.callWxMethod 调用 wx 方法,并返回结果。例如 getSystemInfoSync、getStorageSync。

wdt_nativeC

执行原生层动作:goHome / navigateLeft / confirmModal / cancelModal / authorizeAllow / authorizeCancel / closePaymentDialog / shareCancel / shareConfirm / switchTab。

wdt_system_infoC

返回 miniProgram.systemInfo()。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.5/5.0

Scored across 23 tools

Disambiguation4/5

Most tools have clearly distinct purposes (build, login, preview, upload, navigate, screenshot, etc.), and the descriptions disambiguate overlapping pairs like wdt_open vs wdt_auto_start vs wdt_auto_connect and wdt_close_project vs wdt_quit vs wdt_disconnect. The remaining fuzziness is in the runtime-evaluation cluster: wdt_evaluate, wdt_wx_method, and wdt_page_data all execute things inside the mini program, and wdt_element is a mega-tool with ~20 actions that could be mistaken for wdt_page_data or wdt_native depending on the task.

Naming Consistency5/5

Every tool uses the same wdt_ prefix with snake_case descriptive names (wdt_build_npm, wdt_current_page, wdt_system_info), with no camelCase or style drift. The verb/noun ordering is predictable and readable throughout.

Tool Count4/5

23 tools is on the high side, but the surface splits into two real layers (official CLI control and automation-socket interaction), and nearly every tool maps to a distinct operation with no obvious filler. It is slightly heavy — a few tools like wdt_auto_connect/wdt_disconnect could be folded in — but not bloated.

Completeness4/5

Coverage of the domain is strong: project lifecycle, login/preview/upload, automation connect/disconnect, page navigation, element interaction, data access, screenshots, wx method calls, and waiting are all present. Notable gaps are console/log retrieval and network request interception/mocking, plus richer storage or performance tooling, which agents would need workarounds for.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues