agc-connect-mcp
This MCP server lets AI assistants manage Huawei AppGallery Connect (apps, uploads, reviews, reports, arbitrary Connect APIs) and search official HarmonyOS developer documentation.
HarmonyOS docs: search and fetch official Huawei HarmonyOS documentation (no AGC credentials needed)
AGC API catalog: search ~200 Connect API endpoints and read full API parameter docs
Credential/status check: verify Service Account / API client configuration and site
Apps & projects: list projects/apps, get appId from package name, view app details, audit comments, phased release info
File & package management: upload files (APK/AAB/APP/screenshots/videos), attach software packages, check parse status
Publishing: submit apps for review with timed or phased release options
Reviews & ratings: list reviews, reply publicly, view rating summaries and breakdowns
Reports: export download/install/failure/user/payment reports, download and preview them
Generic API calls: call any Connect API (PMS, provisioning, testing, domain, qualification, agreements) with auto-selected auth
Intents Kit: share or revoke intent events to Xiaoyi (requires app-level credentials)
Safety controls: read-only mode and confirmation prompts for externally visible actions
Provides tools for interacting with AppGallery Connect to manage apps, upload packages, submit releases, reply to reviews, view ratings, export reports, and call the full Connect API for HarmonyOS and Android apps.
Provides search and full-text retrieval of official HarmonyOS developer documentation, including API references, development guides, best practices, FAQs, and publishing guidelines.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agc-connect-mcp Search HarmonyOS docs for upload API and check my app's latest review status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agc-connect-mcp
English | 中文
面向华为鸿蒙开发者的 MCP(Model Context Protocol)服务。装这一个,就能在 Claude Code、Cursor、VS Code、Codex、Gemini CLI、Trae、DevEco Studio 等 AI 工具里:
操作 AppGallery Connect:查询应用和审核状态、上传软件包、提交发布、查看并回复评论、查评分、导出报表,以及调用其余全部 Connect API(PMS 商品、证书 / Profile / 设备、测试版本、域名、资质审核、协议管理等)。
查询鸿蒙官方文档:内置华为官方「鸿蒙开发者知识 MCP」,可检索 API 参考、开发指南、最佳实践、FAQ、上架规范等(与官网准实时同步),无需再单独配置。
本项目为社区开源项目,与华为公司无关,也未获其背书。AppGallery Connect、HarmonyOS 为华为技术有限公司的商标。
功能
工具 | 作用 | 需要 AGC 凭据 |
| 检索鸿蒙官方文档、获取全文 | 否 |
| 搜索内置的 Connect API 目录(约 200 个接口、450 篇文档),在线读取接口参数文档 | 否 |
| 检查凭据与站点配置 | — |
| 列出所有项目与应用;包名 → appId | 是 |
| 应用详情(基本信息、多语言、审核意见、分阶段发布) | 是 |
| 上传本地文件(软件包、图标、截图、视频、资质材料),返回 objectId | 是 |
| 上传并关联软件包(HarmonyOS | 是 |
| 查询软件包解析状态 | 是 |
| 提交审核发布(支持定时上架、分阶段发布) | 是 |
| 评论查询与回复、评分统计 | 是 |
| 导出下载安装、安装失败、用户分析、付费等报表,可下载到本地并预览 | 是 |
| 以当前凭据调用任意 Connect API,覆盖所有没有专用工具的接口 | 是 |
| 意图框架(Intents Kit)意图共享、事件撤销:向小艺推送或撤回事件提醒 | 需应用凭据(见下文) |
大多数工具有 platform 参数:harmonyos 表示 HarmonyOS 5 及以上的应用和元服务,android 表示 Android 以及 HarmonyOS 4 及以下。
Related MCP server: asc-mcp
安装
需要 Node.js 20.11 或以上。
各客户端的配置都是同一套「命令 + 参数 + 环境变量」:
command: npx
args: -y github:chen2he/agc-connect-mcp
env: AGC_SERVICE_ACCOUNT_FILE=/path/to/service-account.json
AGC_CLIENT_FILE=/path/to/api-client.jsonnpx 会直接从 GitHub 下载本项目并自动编译(仅首次运行需要,之后使用缓存)。两个 env 都可以省略:不配置 AGC 凭据时,文档检索类工具照常可用。凭据的获取方法见配置 AGC 凭据。
git clone https://github.com/chen2he/agc-connect-mcp.git
cd agc-connect-mcp
npm install # 会自动编译到 dist/然后把下文各配置中的 npx -y github:chen2he/agc-connect-mcp 换成 node /绝对路径/agc-connect-mcp/dist/index.js。
Claude Code
claude mcp add agc -s user \
-e AGC_SERVICE_ACCOUNT_FILE=/path/to/service-account.json \
-e AGC_CLIENT_FILE=/path/to/api-client.json \
-- npx -y github:chen2he/agc-connect-mcpCodex CLI
codex mcp add agc \
--env AGC_SERVICE_ACCOUNT_FILE=/path/to/service-account.json \
--env AGC_CLIENT_FILE=/path/to/api-client.json \
-- npx -y github:chen2he/agc-connect-mcp也可以直接编辑 ~/.codex/config.toml:
[mcp_servers.agc]
command = "npx"
args = ["-y", "github:chen2he/agc-connect-mcp"]
env = { AGC_SERVICE_ACCOUNT_FILE = "/path/to/service-account.json", AGC_CLIENT_FILE = "/path/to/api-client.json" }使用 mcpServers JSON 的客户端
Claude Desktop、Cursor、Windsurf、Cline / Roo Code、Gemini CLI、Trae、DevEco Studio(CodeGenie)、Cherry Studio 等都用下面这种格式:
{
"mcpServers": {
"agc": {
"command": "npx",
"args": ["-y", "github:chen2he/agc-connect-mcp"],
"env": {
"AGC_SERVICE_ACCOUNT_FILE": "/path/to/service-account.json",
"AGC_CLIENT_FILE": "/path/to/api-client.json"
}
}
}
}客户端 | 配置文件位置 |
Claude Desktop | macOS: |
Cursor | 全局 |
Windsurf |
|
Gemini CLI |
|
Cline / Roo Code | 插件面板 → MCP Servers → 编辑配置 |
Trae / DevEco Studio / Cherry Studio 等 | 在各自的 MCP 设置里添加上面的 JSON |
VS Code(GitHub Copilot Agent 模式)
.vscode/mcp.json,或者用户设置里的 MCP 配置:
{
"servers": {
"agc": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:chen2he/agc-connect-mcp"],
"env": { "AGC_SERVICE_ACCOUNT_FILE": "/path/to/service-account.json" }
}
}
}Windows 用户:少数客户端无法直接启动
npx,可以把命令改成"command": "cmd", "args": ["/c", "npx", "-y", "github:chen2he/agc-connect-mcp"]。
配置 AGC 凭据
在 AppGallery Connect 打开「用户与访问 → API 密钥 → Connect API」创建凭据。两种凭据可以同时配置,服务会按每个接口文档所支持的鉴权方式自动选用,两种都支持时优先用 Service Account。
凭据 | 创建方式 | 环境变量 |
Service Account | 「Service Account」页签 → 创建,类型选开发者级,会自动下载 |
|
API 客户端 | 「API 客户端」页签 → 创建,项目保持 N/A,下载凭据 JSON |
|
根据官方文档,两种凭据能调用的接口有差别,建议两种都配上:
接口 | Service Account | API 客户端 |
HarmonyOS 发布 / 上传 / 测试 / 证书 Profile / 域名 | ✅ | ✅ |
大部分报表、包名查 appId、项目与应用列表 | ✅ | ✅ |
评论与评分、PMS 商品、Android 发布(v2 接口) | ❌ | ✅ |
团队列表、应用简略信息、证书指纹查询 / 添加 | ❌ | ❌(仅 OAuth 客户端,面向平台类开发者) |
凭据的角色决定能调用哪些接口,例如发布需要「APP 管理员」及以上,报表需要「运营」。配置好后,在 AI 工具里让它调用 agc_auth_status 就能验证。
意图框架(Intents Kit)的应用凭据
intents_* 工具调用的是 hag.cloud.huawei.com 上的意图框架服务端接口,用的是每个应用自己的 Client ID / Client Secret(AGC「项目设置 → 应用」里查看),不是上面的 Connect API 凭据。可以用一个 JSON 文件配置多个应用:
{
"my-app": { "client_id": "应用的 Client ID", "client_secret": "应用的 Client Secret" }
}然后设置 AGC_APP_CLIENTS_FILE=/path/to/app-clients.json,调用时用 app 参数指定别名(只配了一个应用时可以省略)。只有一个应用时,也可以直接用 AGC_APP_CLIENT_ID + AGC_APP_CLIENT_SECRET。
意图注册、特性配置、配置检查与提交审核都在小艺开放平台的网页端完成,华为没有开放这部分的管理接口。小艺开放平台对开发者开放的服务端接口只有意图共享 / 事件撤销(已支持)和账号绑定 / 解绑通知。
其他环境变量
变量 | 说明 |
|
|
| 设为 |
| 设为 |
| 自定义知识库 MCP 地址(默认为华为官方地址) |
| Connect API 文档缓存目录,默认 |
| 单次请求超时,默认 120000 |
使用示例
「ArkUI 的 Navigation 怎么跨包路由?给我官方示例。」
「列出我在 AGC 上的所有应用和它们的审核状态。」
「把
build/outputs/default/entry-default-signed.app上传到 com.example.app,解析完成后提交发布,备注写‘修复若干问题’。」「导出过去 30 天按国家分组的下载安装报表,告诉我哪几个国家增长最快。」
「看看最近一个月的 1~2 星差评,帮我起草回复。」(提交回复前会先请你确认)
「用 PMS API 创建一个 6 元的消耗型商品。」(会先查接口文档,再通过
agc_request调用)
注意事项
评论与评分只对已正式上架的应用有数据。审核中或未发布的应用会返回
50010028(“应用不属于该开发者”)。PMS 接口要把
appId放在请求头里(agc_request的headers参数)。agc_get_api_doc会列出这类需要自行传入的请求头。报表返回的下载地址约 5 分钟后失效,需要报表内容时直接用
downloadTo参数下载。意图共享的
intentEntityInfo字段因意图而异,可以先用harmonyos_search_docs查「<意图名> 意图 Schema」;推送的是面向真实用户的提醒,务必确认openId/sid正确。提交发布、回复评论、推送意图事件、下架、删除等会对外生效的操作,工具说明里要求 AI 先向你确认;也可以设置
AGC_READ_ONLY=true,从根本上禁止写操作。
安全
Service Account 的 JWT 在本地用 PS256 签名,私钥不会发送到任何地方;带凭据的请求只会发往
*.huawei.com。建议通过文件路径(
AGC_SERVICE_ACCOUNT_FILE/AGC_CLIENT_FILE)提供凭据,不要把密钥直接写进客户端的配置 JSON,凭据文件的权限建议设为600。本仓库不包含任何华为文档正文,只有接口元数据(方法、路径、标题、鉴权方式);文档正文在运行时从华为开发者文档中心拉取。
开发
npm install
npm test # 编译并运行端到端测试(本地模拟服务器,不需要网络和真实凭据)
npm run update-catalog # 从华为文档中心重新生成 data/ 下的接口目录;加 -- --refresh 忽略本地缓存目录结构:
src/
index.ts MCP 服务入口
tools.ts 全部工具定义
client.ts Connect API 请求、上传、下载
auth.ts Service Account JWT / API 客户端 token
catalog.ts 接口目录检索、按接口选择鉴权方式
portal.ts 华为文档中心接口与文档缓存
html2md.ts 文档 HTML → Markdown
knowledge.ts 鸿蒙开发者知识 MCP 代理
hag.ts 意图框架(Intents Kit)服务端接口与应用级 token
update-catalog.ts 维护脚本:生成 data/
data/ 接口目录(元数据)
test/ 端到端测试许可证
Available Tools
17 toolsagc_auth_status检查 AGC 鉴权配置ARead-only
显示已配置的凭据(Service Account / API 客户端)、站点、只读模式,并逐一验证:API 客户端会向华为换取 token;Service Account 会本地签发 JWT 并调用一次查询接口确认可用。
Inputs: no named parameters.
agc_get_api_doc查看 AGC API 文档ARead-only
读取某个 Connect API 文档的完整内容(Markdown,含接口 URL、Header/Query/Body 参数表、响应字段、示例)。正文从华为开发者文档中心实时拉取并在本地缓存 7 天。docId 来自 agc_search_api 的 doc 字段;也可传文档标题(精确)或 docId 片段。
Inputs: docId (required), includeExamples.
agc_get_app_id按包名查询应用 IDARead-only
根据应用包名(最多 50 个,逗号分隔)查询 AGC 应用 ID(appId)。
Inputs: packageNames (required).
agc_get_app_info查询应用详细信息BRead-only
查询应用基本信息、各语言描述、审核意见、分阶段发布信息等。
Inputs: appId (required), platform (required), lang, versionId, +1 more.
agc_get_package_compile_status查询软件包编译/解析状态CRead-only
查询软件包解析状态。successStatus:0 正常 / 1 解析中 / 2 失败。
Inputs: appId (required), pkgIds (required), platform (required).
agc_get_ratings查询应用评分ARead-only
查询应用评分汇总(平均分、各星级数量)和评分明细。仅已上架应用有数据;时间跨度不超过 6 个月。需要 API 客户端凭据。
Inputs: end (required), appId (required), begin (required), platform (required), +2 more.
agc_get_report导出 AGC 报表ARead-only
导出运营报表(CSV/Excel),返回文件下载地址(有效期约 5 分钟,需要内容时直接传 downloadTo);可选下载到本地并预览前若干行。时间跨度一般不超过 180 天。可用报表:
harmony-download:HarmonyOS 应用下载安装(harmonyos)
harmony-install-failed:HarmonyOS 应用安装失败(harmonyos)
harmony-user-analysis:HarmonyOS 应用/元服务用户分析(harmonyos)
harmony-atomic-distribute:HarmonyOS 元服务分发分析(harmonyos)
download:下载安装(android)
install-failed:安装失败(android)
new-and-retention:新增和留存(android)
iap:应用内付费(android)
paid-download:付费下载(android)
paid-download-detail:付费下载明细(android)
game-reservation:预约(android)
activity-award:指定用户群发奖(android)
coupon:优惠券活动(android)
atomic-distribute:元服务分发分析(旧版)(android)
atomic-user:元服务新增留存(旧版)(android)
atomic-widget:元服务卡片分析(旧版)(android)
Inputs: appId (required), report (required), endDate (required), startDate (required), +8 more.
agc_list_apps列出项目与应用ARead-only
列出当前团队的所有 AGC 项目及每个项目下的应用(appId、名称、包名、设备类型)。(官方的“获取团队列表 / 应用简略信息”接口只对 OAuth 客户端开放,本工具改用项目管理接口实现。)
Inputs: projectId.
agc_list_reviews查询应用评论ARead-only
查询应用评论列表(时间跨度不超过 6 个月,一次只能查询同一站点内的国家)。需要 API 客户端凭据(评论接口不支持 Service Account);站点(site)需与所查国家所在站点一致。
Inputs: end (required), appId (required), begin (required), platform (required), +10 more.
agc_reply_review回复用户评论A
以开发者身份公开回复用户评论(或回复用户的追加回复)。回复会对所有用户可见,调用前请与用户确认回复内容。
Inputs: lang (required), appId (required), content (required), platform (required), +5 more.
agc_request调用任意 AGC Connect APIADestructive
以当前凭据调用任意 Connect API 端点(自动添加鉴权头、按站点选择域名)。适用于没有专用工具的接口,如 PMS 商品管理、Provisioning 证书/Profile、Testing 测试版本、Domain、资质审核、协议管理等。调用前请先用 agc_get_api_doc 确认方法、路径和参数。返回 HTTP 状态与原始 JSON。
Inputs: path (required), method (required), auth, body, +3 more.
agc_search_api搜索 AGC API 目录ARead-only
在内置的 AppGallery Connect Connect API 目录(约 200 个端点、450 篇文档,含数据模型、错误码、附录)中按关键词搜索。关键词可用中文或英文,空格分隔表示同时匹配。找到端点后用 agc_get_api_doc 查看参数,再用专用工具或 agc_request 调用。
Inputs: query (required), group, limit, platform.
agc_submit_app提交应用发布审核ADestructive
提交应用审核发布(上架)。调用前应确认应用信息完整、软件包已解析成功。这是对外生效的操作,调用前请与用户确认。HarmonyOS 走 POST /api/publish/v3/app-submit;Android 走 POST /api/publish/v2/app-submit。
Inputs: appId (required), platform (required), phased, remark, +1 more.
agc_update_app_package上传并关联应用软件包ADestructive
上传软件包并写入应用当前草稿版本:HarmonyOS 走 PUT /api/publish/v3/app-package-info(返回 packageId),Android 走 PUT /api/publish/v2/app-file-info(fileType=5,返回 pkgVersion)。可以传本地 filePath(自动上传),也可以传已上传的 objectId + fileName。软件包需异步解析,约 2 分钟后再提交发布,可用 agc_get_package_compile_status 查询。
Inputs: appId (required), platform (required), fileName, filePath, +4 more.
agc_upload_file上传文件到 AGCA
把本地文件(软件包 .app/.apk/.aab/.rpk、图标、截图、视频、PDF、资质 zip 等)上传到 AGC 文件服务器,返回 objectId。得到 objectId 后需调用相应接口(如 agc_update_app_package,或通过 agc_request 调用更新应用文件信息接口)把文件关联到应用。
Inputs: appId (required), filePath (required), fileName, releaseType, +1 more.
harmonyos_get_docs获取鸿蒙开发者文档全文ARead-only
按文档标识批量获取 HarmonyOS 官方文档全文(Markdown,一次最多 10 篇)。标识来自 harmonyos_search_docs 结果的 parent 字段。
Inputs: names (required).
harmonyos_search_docs搜索鸿蒙开发者文档ARead-only
通过华为官方“鸿蒙开发者知识 MCP”检索最新的 HarmonyOS 官方文档:版本说明、API 参考、开发指南、最佳实践、FAQ、DevEco Studio 指南、UX 设计、应用上架与分发等(与官网准实时同步)。返回匹配的文本片段及文档标识 parent;片段不够时用 harmonyos_get_docs 取全文。Connect API 接口参数请优先用 agc_search_api / agc_get_api_doc。
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools target distinct resources and actions, and the agc_/harmonyos_ prefixes clearly separate API catalog docs from HarmonyOS docs. The main ambiguity is agc_request as a generic fallback that conceptually overlaps with all specialized tools, and agc_upload_file vs agc_update_app_package share upload behavior, but descriptions draw clear boundaries.
The vast majority follow a consistent agc_verb_noun pattern, and the two harmonyos_ tools are internally consistent. Minor deviations like agc_auth_status (no verb) and agc_request (not verb_noun) plus the mixed prefixes keep it from a perfect score.
17 tools is slightly above the ideal 3-15 range, but the broad AppGallery Connect domain justifies the count. Each tool covers a meaningful workflow area, and the generic agc_request tool prevents the surface from becoming bloated with dozens of endpoint-specific tools.
The specialized tools cover the core app publishing lifecycle: discovery, auth, package upload, compile status, submission, reviews, ratings, and reports. The generic agc_request tool plus search/get documentation tools ensures any remaining Connect API endpoint can be reached, so there are no obvious dead ends.
Maintenance
Related MCP Connectors
App Store Connect operator for AI agents: icons, TestFlight builds, listings, IAP, rejection fixes.
AI-agent operations for App Store Connect and Google Play, with approval before live publishing.
AI-agent operations for App Store Connect and Google Play, with approval before live publishing.
Deploy apps from GitHub, read build/runtime logs, and manage your app's users from your AI agent.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage Apple App Store Connect through the official API, including apps, metadata, reviews, TestFlight, provisioning, users, and reports.MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to manage App Store Connect apps, including registering bundle IDs, uploading metadata and screenshots, setting age ratings, managing TestFlight groups and testers, and submitting apps for review.MIT
- AlicenseCqualityDmaintenanceEnables publishing Android apps to Samsung Galaxy Store and Huawei AppGallery directly from AI agents, with tools for uploading binaries, updating listings, submitting apps, and verifying Samsung IAP receipts.11MIT
- AlicenseAqualityBmaintenanceEnables AI agents to search Aurora OS app store, inspect app and release information, and manage developer applications including RPM upload, metadata editing, and publication scheduling.17MIT