Skip to main content
Glama
HWC Growth Center MCP Extension

HWC Growth Center MCP Extension

by Dwight2458

HWC Growth Center MCP Extension

华为云开发者成长中心 MCP 扩展 — 通过 Chrome 扩展 + Node.js Bridge 架构,为 CLI 和 MCP Client 提供签到、积分查询、任务列表等能力。已验证多账号全自动签到流程。

能力边界

能做的

能力

说明

对应工具

每日签到

自动检测签到状态,未签到则执行签到

hwc_sign

签到状态查询

查询今日是否已签到、连续天数、累计次数

hwc_get_sign_status

积分查询

查询当前可用积分 (beans)

hwc_get_points

积分明细

查询积分获取/消耗记录

hwc_get_points_detail

任务列表

查询成长中心全部任务及完成状态

hwc_get_tasks

积分兑换

兑换奖品

hwc_exchange

不能做的

  • 自动完成成长任务(如创建云开发环境、发布博客、参加赛事等)— 这些需要在浏览器中手动操作

  • 自动登录 — 需要用户在浏览器中手动登录华为云账号

  • 无浏览器运行 — Chrome 扩展必须在浏览器中运行,关闭浏览器则无法调用 API

前置条件

  • Chrome 浏览器已打开且已登录 developer.huaweicloud.com

  • Chrome 扩展已加载且 Service Worker 处于活跃状态

  • accountName 自动从页面 DOM 提取并存入 chrome.storage,无需手动指定

Related MCP server: Huawei MCP Server

架构

MCP Client (CLI / Agent / Claude)  ←stdio→  Bridge [Node.js]  ←WebSocket→  Chrome Extension
                                                                          ↓
                                                                fetch (浏览器上下文,携带 Cookie)
                                                                          ↓
                                                              https://devdata.huaweicloud.com

Chrome 扩展 Service Worker 无法创建 WebSocket 服务器,因此引入 Node.js Bridge 中继。Bridge 仅监听 127.0.0.1,扩展必须使用配对令牌认证,且只允许一个活动扩展连接:

  1. stdio — Bridge 与 MCP Client 通信(标准 MCP 传输)

  2. WebSocket (127.0.0.1:9876) — Bridge 与扩展进行已认证通信

  3. Bridge 在两者间转发 JSON-RPC 消息,扩展未连接时自动排队请求

项目结构

developer-grow-mcp-extension/
├── manifest.json              # Chrome 扩展配置 (Manifest V3)
├── background.js              # Service Worker — WebSocket 客户端,连接 Bridge
├── content.js                 # Content Script — accountName 自动提取
├── options.html / options.js  # Bridge 配对令牌设置页
├── cli.mjs                    # CLI 入口 — 子命令分发 (hwc-grow)
├── agent.mjs                  # MCP 客户端 — 自动编排签到流程
├── package.json               # npm 包定义 (bin: hwc-grow)
├── bridge/
│   ├── server.js              # Node.js Bridge (stdio ↔ WebSocket 中继)
├── lib/
│   ├── api-client.js          # API 调用封装 (含日志 + accountName 自动获取)
│   ├── csrf-manager.js        # CSRF Token 管理 (自动刷新)
│   └── debug-log.js           # API 调用日志收集器
├── tools/
│   ├── index.js               # 工具注册表
│   ├── sign.js                # 签到 (POST, account_name 自动获取)
│   ├── sign-status.js         # 签到状态 (GET)
│   ├── tasks.js               # 任务列表 (POST, page_no/page_size)
│   ├── points.js              # 积分查询 (GET, beans)
│   ├── points-detail.js       # 积分明细 (POST)
│   └── exchange.js            # 积分兑换 (POST)
└── protocol/
    └── mcp.js                 # MCP 协议实现 (JSON-RPC 2.0)

安装

1. 安装依赖

# 在仓库根目录 developer-grow-mcp-extension/ 下执行
npm install

2. 加载 Chrome 扩展

  1. 打开 chrome://extensions/

  2. 开启右上角「开发者模式」

  3. 点击「加载已解压的扩展程序」→ 选择 developer-grow-mcp-extension 目录

  4. 确认扩展已加载,Service Worker 状态为「活跃」

  5. 打开扩展「详情」→「扩展程序选项」,进入 Bridge 配对 页面

  6. 点击「生成令牌」,在令牌输入框中按 Ctrl+A、Ctrl+C 复制,再点击「保存」

如果管理页没有显示「扩展程序选项」,请在扩展卡片或详情页复制扩展 ID,然后直接访问:

chrome-extension://<扩展ID>/options.html

例如,当前开发环境中的地址是:

chrome-extension://dagglekhpkdmhdigehamipnnmeananja/options.html

解压加载的扩展 ID 可能因机器或安装方式不同而变化。上面的固定地址仅作为示例;其他开发者应使用自己在 chrome://extensions/ 中看到的扩展 ID。

3. 配置 Bridge 配对令牌

将扩展设置页生成的同一令牌配置为 MCP_BRIDGE_TOKEN。令牌至少 32 个字符,不要提交到仓库:

# Linux / macOS
export MCP_BRIDGE_TOKEN="扩展设置页中的令牌"
# PowerShell(当前终端)
$env:MCP_BRIDGE_TOKEN = "扩展设置页中的令牌"

4. 登录华为云

  1. 在浏览器中访问 https://developer.huaweicloud.com/grow

  2. 使用华为云账号登录(扫码或账号密码)

  3. 扩展自动继承浏览器 Cookie,content.js 自动提取 accountName 存入 chrome.storage

切换账号:在浏览器中重新登录另一个华为云账号,然后删除扩展并重新加载(Chrome 会缓存旧的 Service Worker 代码)

5. 安装 CLI(可选)

# 在仓库根目录 developer-grow-mcp-extension/ 下执行
npm install -g .

安装后可直接使用 hwc-grow 命令。未全局安装也可用 node cli.mjs 代替。

使用方式

CLI 工具

# 一键完整流程(查状态 → 签到 → 查积分 → 查任务)
hwc-grow agent

# 单独签到(accountName 自动获取,无需传参)
hwc-grow sign

# 查签到状态
hwc-grow status

# 查积分
hwc-grow points

# 查任务列表(默认全部)
hwc-grow tasks
hwc-grow tasks --status=pending     # 仅待完成

# MCP Server 模式(供 OpenCode / Claude Desktop 调用)
hwc-grow serve

# 帮助
hwc-grow help

直接运行 agent.mjs

node agent.mjs              # 完整自动签到流程
node agent.mjs --status-only    # 仅查询签到状态
node agent.mjs --points         # 仅查询积分
node agent.mjs --tasks          # 查询任务列表
node agent.mjs --verbose        # 打印 JSON-RPC 原始通信

agent.mjs 和 hwc-grow 都会自动启动 Bridge,无需手动运行 bridge/server.js。

自动签到流程

1. hwc_get_sign_status  → 检查 sign_flag 是否已签到
2. 若未签到 → hwc_sign  → POST {account_name: "自动从DOM获取"}
3. hwc_get_points       → 查询 beans 确认积分变化
4. hwc_get_tasks        → 查看待完成任务列表

成功输出示例

🚀  启动 HWC Growth Center MCP Agent
📦  启动 Bridge...
🔗  初始化 MCP 连接...
✅  已连接: hwc-growth-mcp v1.0.0
🔍  查询签到状态...
📊  签到状态: 今日未签到 ✗
💰  当前积分: 5
📅  连续签到: 0 天
✍️  执行签到...
🎉  签到成功! 签到成功
📅  连续签到: 1 天
💰  查询最新积分...
✅  当前积分: 55
📋  查询待完成任务...
📝  待完成任务 (11):
   ✗ 首次开通华为云码道(CodeArts) (+50) [码道]
   ✗ 使用智能问答 (+30) [码道]
   ✗ 体验开发者空间 (+20) [开发者空间]
   ...
✅  自动签到流程完成

MCP Client 集成

OpenCode

在 ~/.config/opencode/opencode.json 中添加:

{
  "mcp": {
    "hwc-growth": {
      "type": "local",
      "command": ["hwc-grow", "serve"]
    }
  }
}

Claude Desktop

在 claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "hwc-growth": {
      "command": "hwc-grow",
      "args": ["serve"]
    }
  }
}

Bridge 的 WebSocket 端口只用于已配对的 Chrome 扩展。MCP Client 应通过 stdio 调用 hwc-grow serve,不会直接连接 WebSocket。

工具列表

工具名

描述

参数

API 字段映射

hwc_sign

签到

accountName (可选,自动获取)

account_name → POST body

hwc_get_sign_status

签到状态

无

sign_flag→signed, bonus→points, sign_continuity_count→continuousDays, sign_count→signCount

hwc_get_tasks

任务列表

status: all/completed/pending, pageNo, pageSize

QueryMissionDtoList→tasks, is_finish→完成状态, bonus→积分

hwc_get_points

当前积分

无

beans→points

hwc_get_points_detail

积分明细

pageNo, pageSize

records, total

hwc_exchange

积分兑换

prizeId, count

id→orderId

API 端点

操作

方法

路径

关键字段

CSRF 获取

GET

developer.huaweicloud.com/api/get-ainfo

响应头 csrf 字段

签到状态

GET

.../growth/sign

sign_flag, sign_continuity_count, sign_count

执行签到

POST

.../growth/sign

body: {account_name}

积分查询

GET

.../growth/bonus-beans

beans

任务列表

POST

.../growth/mission/query-mission-list-by-condition

body: {status, page_no, page_size} + query string

所有业务 API 前缀: https://devdata.huaweicloud.com/rest/developer/fwdu

注意:任务列表 API 的分页参数使用 snake_case (page_no, page_size),且需同时放在 query string 和 JSON body 中。

故障排查

问题

原因

解决方案

Bridge 报 EADDRINUSE

旧进程占用端口

杀掉旧 node 进程,或设 MCP_BRIDGE_PORT 换端口

扩展未连接

Bridge 未运行或扩展未加载

先加载扩展,再运行 CLI

CSRF fetch failed: 404

CSRF URL 域名错误

确认指向 developer.huaweicloud.com(非 devdata)

CSRF is nil (403)

CSRF Token 过期

正常现象,自动刷新重试

SESSION_EXPIRED

浏览器 Cookie 过期

重新登录 developer.huaweicloud.com

修改代码后无效

Chrome 缓存 Service Worker

chrome://extensions/ → 删除扩展 → 重新加载

ERR_NETWORK_IO_SUSPENDED

Service Worker 被挂起

正常现象,chrome.alarms 会自动重连

pageNo不能为null

任务列表参数格式错误

使用 page_no/page_size(snake_case)+ query string

签到返回 user_id=null

未登录或 Cookie 过期

重新登录华为云

技术细节

  • CSRF Token: 从 developer.huaweicloud.com/api/get-ainfo 响应头获取,有效期约 15 分钟,过期自动刷新

  • accountName 自动获取: content.js 从页面 DOM 提取 → 存入 chrome.storage.local → sign.js 调用时自动读取,无需手动传参

  • Service Worker 保活: chrome.alarms 每 30 秒唤醒,检查并重连 Bridge

  • 请求排队: 扩展未连接时 Bridge 缓存请求,扩展连接后自动发送

  • 最小化诊断: 默认工具响应不包含原始后端响应、请求体、响应头或跨请求 API 日志;--verbose 仅显示 MCP JSON-RPC 通信

  • Bridge 安全边界: 仅监听 loopback,要求至少 32 字符配对令牌,并校验响应对应待处理请求

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Nextcloud MCP server for ChatGPT, Claude and any AI agent: upload file, share file, create calendar event, add contact, create Deck card and search files in your own Nextcloud account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Nextcloud yourself; Cotlet does not store your password and you need no Nextcloud API key. About the official Nextcloud API: Yes. Every Nextcloud instance has WebDAV for files, CalDAV for calendars, CardDAV for contacts, an OCS Share API and a Deck API, and they accept an app password (checked 16 Oct 2026). Setup and FAQ: https://cotlet.dev/integrations/nextcloud-api-mcp-server

    • Hacker News MCP server for ChatGPT, Claude and any AI agent: list upvoted items, list hidden items, list favorites, list my comment threads, get an item with its comments, favorite an item and hide an item in your own Hacker News account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Hacker News yourself; Cotlet does not store your password and you need no Hacker News API key. About the official Hacker News API: Hacker News has an official API, but it is read-only and public (checked 28 Oct 2026). It returns items, users and the story lists. Setup and FAQ: https://cotlet.dev/integrations/hacker-news-api-mcp-server

    • Zotero MCP server for ChatGPT, Claude and any AI agent: add item by DOI, search library, add to collection, get annotations, create note and export citations in your own Zotero account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Zotero yourself; Cotlet does not store your password and you need no Zotero API key. About the official Zotero API: Zotero has a public Web API v3 with read and write access (checked 16 Oct 2026). You create a key in your zotero.org account settings and send it with each request. Setup and FAQ: https://cotlet.dev/integrations/zotero-api-mcp-server

      https://cotlet.dev/mcp/v1/zotero
    • Buildertrend MCP server for ChatGPT, Claude and any AI agent: get schedule, create daily log, create change order and list selections in your own Buildertrend account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Buildertrend yourself; Cotlet does not store your password and you need no Buildertrend API key. About the official Buildertrend API: Buildertrend publishes no API docs or self-serve keys for customers; it connects through its Marketplace integrations (checked 11 Oct 2026). Setup and FAQ: https://cotlet.dev/integrations/buildertrend-api-mcp-server

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables AI assistants to operate Huawei Cloud resources (ECS, OBS, GaussDB, etc.) through conversational workflows via the Model Context Protocol.
      36 PyPI
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Local MCP server and Chrome/Edge extension that let AI assistants use your existing signed-in browser sessions on Reddit and Zhihu. Provides 54 site operations through three stable MCP tools, with on-demand operation discovery, compact structured results, and pagination; requires Node.js 22+ and the companion extension on the same computer.
      3
      1
      MIT