Weapp MCP Server

Agent-first MCP server for WeChat Mini Program debugging & automation via WeChat DevTools.

Local serverstdio

What is the Weapp MCP Server?

Agent-first MCP server for WeChat Mini Program debugging & automation via WeChat DevTools.

What you get

如果你已经在用 Claude Code / Cursor / Codex 等 agent 写小程序,传统的 miniprogram-automator 脚本式调用不够顺手 — 你得让 agent 写 node 脚本、跑、读输出、再调整。本项目把自动化能力直接暴露成 agent 工具调用,让 agent 在对话中可以:

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
mp_diagnoseConnection只诊断当前连接目标,不启动 IDE、不修改项目状态
mp_ensureConnection确保自动化会话就绪,是连接链路默认入口;失败后再按返回指引诊断或恢复
mp_navigate在小程序内导航,支持 navigateTo、redirectTo、reLaunch、switchTab 或 navigateBack
mp_screenshot捕获屏幕截图并返回(或保存到磁盘)
mp_callWx调用微信小程序 API 方法(如 wx.showToast)
mp_evaluate向小程序 AppService 注入并执行函数代码,适合做显式运行时读取
mp_pollUntil轮询 AppService 条件,命中后可执行动作并采集前后状态快照
mp_getLogs获取小程序控制台日志,支持按 type、contains、since、limit 过滤,并返回日志监听状态(如 listenerAttached、lastLogAt、sessionId)
mp_runScenario按顺序执行一组最小测试步骤,当前支持 navigate、tap、input、waitRoute、expect*、snapshot、getLogs、screenshot
mp_generateScenarioReport执行 scenario 并输出 markdown 报告;可选写入 outputPath,适合产出轻量回归测试记录,并可引用截图路径
mp_currentPage获取当前页面信息(路径、查询参数、尺寸和滚动位置),withData 为 true 时额外返回页面数据
mp_healthCheck聚合连接、页面、项目路径和日志监听状态,判断当前是否健康、是否需要恢复
mp_recoverConnection按标准顺序执行恢复,并返回恢复动作、恢复前后状态与最新 health
mp_listProjects列出微信开发者工具中的最近项目,方便选择项目目录

How to install the Weapp MCP Server

{
  "mcpServers": {
    "weapp-agent-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@chaixueyuan/weapp-agent-mcp"
      ],
      "env": {
        "WEAPP_WS_ENDPOINT": "ws://localhost:9420"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
WEAPP_WS_ENDPOINTConfiguration value read at startup.Optional
WEAPP_AUTOMATOR_MODEConfiguration value read at startup.Optional
WEAPP_PROJECT_PATHFilesystem location the server is allowed to use.Optional
WECHAT_DEVTOOLS_CLI_PATHFilesystem location the server is allowed to use.Optional
WEAPP_DEVTOOLS_PORTConfiguration value read at startup.Optional
WEAPP_AUTOLAUNCHConfiguration value read at startup.Optional

Example prompts to try

  • “Use Weapp to mp diagnoseConnection.”
  • “Use Weapp to mp ensureConnection.”
  • “Use Weapp to mp navigate.”

Frequently asked questions

Agent-first MCP server for WeChat Mini Program debugging & automation via WeChat DevTools. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.