MCP server by Leezgion
WeApp Pilot MCP
WeApp Pilot MCP is a staged implementation of a local MCP server for LLM-driven smoke testing of WeChat Mini Programs.
The current scope is intentionally narrow:
- Taro-first project detection and build orchestration
- local-machine WeChat DevTools sessions
miniprogram-automatorbacked page actions- MCP tools for session, interaction, assertion, and artifact flows
Packages
@weapp-pilot/shared: contracts, error model, and tool schemas@weapp-pilot/weapp-core: local core logic, build orchestration, runtime actions, assertions, and run artifacts@weapp-pilot/mcp-server: stdio MCP server and tool registry
Tool Surface
The current MCP server exposes four groups of tools:
- Session:
project_detect,project_routes,route_search,build_start,build_status,ide_open,ide_status,automator_connect,runtime_disconnect - Interaction:
navigate,current_page,page_stack,tap,input,page_data,page_snapshot,call_wx,screenshot - Assertion:
assert_route,assert_text,assert_visible,assert_page_data - Artifact:
console_logs,network_logs,run_summary - Scenario:
smoke_run
project_routes reads the compiled app.json route catalog and now enriches each route with origin and discovered page titles from compiled page JSON files. route_search ranks candidate routes by route segments and page titles so Agents can resolve targets before calling smoke_run. page_snapshot compresses the current page into route, page stack, visible texts, data paths, and auth signals. console_logs persists runtime console and exception events, and network_logs now records patched wx.request / uploadFile / downloadFile activity after the runtime session connects.
ide_open can now infer miniProgramRoot from project detection when callers only provide projectRoot. Route assertions and smoke_run also normalize leading slashes, so /pages/foo/index and pages/foo/index are treated as the same runtime route.
Runtime log artifacts are persisted in a default-safe form: network_logs and console text redact common secrets such as tokens, cookies, passwords, verification codes, and phone values while preserving host/path/status metadata for debugging.
Quick Start
pnpm install
pnpm build
pnpm test
pnpm smoke:fixture
pnpm smoke:fixture runs the end-to-end fake smoke validation around packages/weapp-core/test/fixtures/taro-smoke-demo, including route navigation, interaction, assertions, screenshot capture, and run summary persistence.
MCP Server
Start the stdio server with:
pnpm mcp:start
Typical MCP client wiring looks like:
{
"mcpServers": {
"weapp-pilot": {
"command": "pnpm",
"args": ["mcp:start"],
"cwd": "C:/Users/admin/Documents/GITHUB/WeApp-Pilot"
}
}
}
Local Validation
Real-machine validation still requires a prepared WeChat DevTools environment:
- a logged-in WeChat DevTools installation
- the DevTools service port enabled
- a resolvable DevTools CLI path
- a Taro project that builds to a Mini Program output directory
The step-by-step setup and validation flow is documented in docs/local-setup.md.