harmony-mcp
An MCP server that enables AI assistants to interact with WeChat Mini Programs, allowing developers to publish versions, analyze package size, diagnose compilation errors, and manage projects via natural language.
README
harmony-mcp
对 AI 说"帮我发个版本",然后喝口水,完事了。
小程序开发者的 AI 副驾驶 —— 不只是命令代理,而是能理解你的项目、帮你一键发版的 MCP Server。
30 秒看懂
你:帮我看看这个项目的情况
AI:📋 AppID: wx1234...,3 个页面,2 个分包,基础库 3.6.0,ES6 已开启...
你:改完了,帮我发个版本,描述是修复了购物车 bug
AI:📖 读取项目信息... ✅
🔨 构建 npm... ✅
🚀 上传代码 v1.2.4... ✅
🎉 发版完成!去微信后台提交审核吧
不需要云开发,不需要密钥,不需要白名单。装上就能用。
安装
在你的 AI 工具(Kiro、Claude Desktop、Cursor 等)的 MCP 配置中添加:
{
"mcpServers": {
"harmony-mcp": {
"command": "npx",
"args": ["-y", "harmony-mcp"],
"env": {
"WECHAT_DEVTOOLS_CLI": "你的微信开发者工具cli.bat路径"
}
}
}
}
前置条件
- Node.js >= 18
- 微信开发者工具已安装
- 开发者工具「设置 → 安全 → 服务端口」已开启
💡 如果微信开发者工具安装在默认路径,
WECHAT_DEVTOOLS_CLI环境变量可以不设,会自动检测。
能做什么
🔍 了解项目
"帮我看看这个项目的基本信息"
AI 会读取你的 project.config.json 和 app.json,告诉你:
- AppID、项目名称、基础库版本
- 页面列表和分包结构
- 编译配置(ES6、压缩、SourceMap 等)
- TabBar 和窗口配置
� 包体积分析
"包体积快超了,帮我看看哪些文件占空间大"
AI 自动完成:
- 扫描所有文件,按大小排序
- 按目录统计占比
- 对比微信 2MB 限制,给出警告
- 智能优化建议(图片压缩、分包策略、大文件处理)
🔧 编译诊断
"编译报错了帮我看看什么问题"
AI 自动完成:
- 触发编译,捕获错误
- 解析错误位置(文件、行号)
- 识别错误类型(语法、模块缺失、WXML 等)
- 给出修复建议
�🚀 一键发版
"帮我发个版本,描述是修复了支付流程"
AI 自动完成:
- 读取当前版本号
- 自动递增(支持 patch/minor/major)
- 构建 npm 依赖
- 上传代码到微信后台
一句话搞定原来 3-4 步的手动操作。
📱 日常操作
| 你说 | AI 做 |
|---|---|
| "帮我登录微信开发者工具" | 弹出二维码,扫码登录 |
| "预览一下这个项目" | 生成预览二维码 |
| "上传代码,版本 1.2.0" | 上传到微信后台 |
| "构建一下 npm" | 构建 npm 依赖 |
| "打开/关闭项目" | 操控开发者工具 |
与其他方案的区别
| harmony-mcp | cloudbase-mcp | miniprogram-ci | |
|---|---|---|---|
| 需要云开发 | ❌ 不需要 | ✅ 必须 | ❌ 不需要 |
| 需要密钥/白名单 | ❌ 不需要 | ✅ 需要 | ✅ 需要 |
| AI 可直接调用 | ✅ | ✅ | ❌ |
| 能看懂项目 | ✅ | ❌ | ❌ |
| 一键发版 | ✅ | ❌ | ❌ |
| 零配置使用 | ✅ | ❌ | ❌ |
harmony-mcp 面向不用云开发的 70% 普通小程序开发者。
全部工具
| 工具 | 功能 |
|---|---|
wechat_cli_login |
登录开发者工具 |
wechat_preview |
预览小程序 |
wechat_upload |
上传代码 |
wechat_build_npm |
构建 npm |
wechat_open_project |
打开项目 |
wechat_close_project |
关闭项目 |
wechat_reset_fileutils |
重置文件监听 |
wechat_project_info |
读取项目信息 |
wechat_publish |
一键发版 |
wechat_package_size |
包体积分析 |
wechat_diagnose |
编译诊断 |
技术栈
- TypeScript
- @modelcontextprotocol/sdk(最新 registerTool API)
- stdio 传输模式
- Node.js >= 18
开发状态
- ✅ 基础操作层(7 个 CLI 工具)
- ✅ 项目理解(读取分析项目配置)
- ✅ 一键发版(版本递增 + 构建 + 上传)
- ✅ 包体积分析(文件扫描 + 大小统计 + 优化建议)
- ✅ 编译诊断(触发编译 + 错误解析 + 修复建议)
- ⬜ 鸿蒙 + 多平台扩展
文档
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.