Launch a WeChat mini program session
mp_launchLaunches WeChat DevTools for a Mini Program project through its automation CLI and attaches an automation session, enabling end-to-end testing.
Instructions
Start WeChat DevTools for a project through its automation CLI and attach to it. Launching takes 15-60 seconds and needs DevTools installed, signed in, and with its service port enabled (设置 → 安全设置 → 服务端口). Only one session can run at a time; launching the same project again reuses it. Call mp_close when finished so the DevTools window is closed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_path": "<project_path>"
},
"name": "mp_launch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Automation port for DevTools. Omit to pick the first free port from 9420. Fails if the given port is already in use. | |
| cli_path | No | Path to the WeChat DevTools CLI. Defaults to /Applications/wechatwebdevtools.app/Contents/MacOS/cli on macOS and the Tencent install path on Windows. | |
| timeout_ms | No | How long to wait for DevTools to come up. Defaults to 45000, kept under the 60s request budget most MCP clients apply. | |
| project_path | Yes | Absolute path of the mini program project directory (the one containing project.config.json). | |
| trust_project | No | Pass --trust-project so DevTools does not ask for confirmation. Only use for projects you trust. |