
Haplane
io.github.LeonTing1010Published by GitHub account LeonTing1010v0.4.1Updated Oct 25, 2026
鸿蒙 HAP 签名部署 MCP:面向鸿蒙应用开发者,真机调试一键签装,也走华为邀测/上架。中性工具+可订阅源,本地 stdio。
Overview
A local stdio MCP server that lets an AI assistant sign, install and verify HarmonyOS HAP packages on connected devices and search subscribed HAP sources.
- What you can do
- Sign, install and verify HAP packages, including a one-step deploy that connects to a device, reads the UDID and bundle name, signs, installs and verifies, with automatic uninstall-and-reinstall or permission downgrade on known errors. List connected devices and read device UDIDs. Search subscribed registry sources for HAP resources and deploy them from upstream with checksum verification. Generate local OpenHarmony self-signing material and rename a bundle name before signing. Check the toolchain and signing material, and query AGC app status or a read-only provisioning plan.
- When to use it
- Useful for HarmonyOS app developers who want an assistant to drive the signing and on-device debug install loop, or to pull and install HAPs from subscribed sources, instead of assembling hvigorw, hap-sign-tool and hdc commands by hand.
- Requirements
- Runs locally via npx or node (Node 18 or later). Needs the Huawei SDK tools hdc, hap-sign-tool, java and hvigorw, plus a Huawei developer account and AGC for real-device or store signing. Configuration and passwords come from a config file pointed to by HAP_DEPLOY_CONFIG and a .env file; AGC access uses AGC_CLIENT_ID and AGC_CLIENT_SECRET or AGC_TOKEN. A device with developer mode and USB or wireless debugging is needed for installs.
Installation
In SourceWeft
- Open Haplane in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
HapLane
鸿蒙 HAP 一键签名 · 调试 · 部署 —— CLI + MCP,agent 可驱动。 封装华为官方工具链(
hvigorw/hap-sign-tool/hdc),把散在文档里的命令拼成一条可脚本、可--dry-run、可让 AI 调用的链。零运行时依赖(纯 Node stdlib)。开源 MIT · 不破解 · 不逆向 · 签名走你自己的 AGC 凭据。
- 官网:https://leonting1010.github.io/haplane/
- npm:
haplane· Gitee:https://gitee.com/LeonTing1010/hap-deploy · GitHub:https://github.com/LeonTing1010/hap-deploy-cli
装
接入 MCP(挂进你的 AI)
HapLane 是标准 stdio MCP server(JSON-RPC 2.0,协议 2024-11-05)。粘一段配置就接上,支持 Claude Code / Cursor / Cline / DevEco Code 等任意 MCP 客户端。
国内网络拉不动 npm 时,下载 haplane-mcp.mjs 放本地,改成 "command": "node", "args": ["/你的路径/haplane-mcp.mjs"]。
接上后在 AI 里直接说:「把 ./app.hap 签名装到我手机上」——agent 自己调 deploy_to_device,撞 system 权限自动降级重装,装完验签。
13 个 MCP 工具
HapLane 是中性工具,自身不内嵌任何应用内容。 可搜可装的条目来自你订阅的源(registry index.json,apt/sources.list 模型);默认订阅官方源、可退订。工具指向上游权利人官方发布位,不托管/不转存二进制。详见 分发合规边界。
配置与密码走 HAP_DEPLOY_CONFIG 指向的配置文件 + .env(自动加载),不入 MCP 参数;stdout 只出协议 JSON,日志走 stderr。
也能命令行直接用
全局:--config <path> · --dry-run(只打印命令不真跑,无真机也能看全链)· --verbose · --in <hap> · --target <设备>
配置与密码
复制 hap-deploy.config.example.json 为 hap-deploy.config.json,填 SDK 路径 + 签名材料路径。密码只从环境变量读,绝不入配置 / 日志:
认证:三条路,选最白那档
给 AGC 打交道有三种方式,推荐机器密钥:
- 🟢
client_credentials机器密钥(推荐):AGC 控制台铸client_id/secret→ 换 Bearer token。无交互登录、可吊销、可审计。凭据走 envAGC_CLIENT_ID+AGC_CLIENT_SECRET(或直接AGC_TOKEN)。 - 🟡
deveco login的 cookie 会话:只连 DevEco AI 助手,根本不碰 AGC,与签名无关。 - 🔴 寄生会话(抓登录 session 冒充调网页 API):不可审计,本工具不用。
关键坑:请求头
client_id必须匹配 token 的sub,否则 401。
老实说:它不做什么 · 前提
不做
- 不破解、不绕过签名——只帮你把该走的流程走顺
- 只处理你自己或已授权的设备 / 账号
- 不碰纯血鸿蒙真机的商用根:真机走你自己的 AGC 材料
前提
- 华为开发者账号 + AGC(真机 / 上架签名要)
- 华为 SDK:
hdc/hap-sign-tool/java(各平台官方版都有,几 G,华为官网装) - Node ≥ 18;macOS / Windows / Linux 都行
签名的物理约束(必须知道)
- 纯血鸿蒙真机的信任只有 AGC 能发:证书 / Profile 须链到华为商用根。本工具是「接你 AGC 材料 + 自动化签装验」的适配器,不凭空造信任。
- 模拟器 / OpenHarmony 设备可用 SDK 自带的 OpenHarmony 测试证书本地自签(
OpenHarmony.p12公开密码123456)——但只对模拟器 / OpenHarmony 有效,纯血真机拒(9568332 sign info inconsistent)。verify成功不等于真机能装。 - debug 签名要先 hdc 连真机取 UDID(profile 绑该机 UDID);手机需开发者模式 + USB / 无线调试并弹窗授权。
- 同包名换签名覆盖装会撞
9568332→ 先hdc uninstall再装(deploy_to_device已自动处理)。 - 包名被占(如装已上架 app 撞
205339064)→rename_bundle改名再签(⚠️ 改名破坏应用身份,仅侧载 / 自测用)。
已验证
DevEco HarmonyOS 模拟器上,MCP deploy_to_device 五步全绿:
签名走本地 OpenHarmony 自签;纯血真机换 AGC 材料填进同一 config.signing 即走真机路。
License
MIT
Source: README.md at commit bf7da41
Tools
0Version history
1- v0.4.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts