feat(mcp): 🚀 消息推送配置工具 queryMessagePush/manageMessagePush(事件+消息类型订阅 · appid 多会话透传 · 幂等乐观锁) - #949
Merged
Conversation
…stFn 独立通道与 qbase URL 常量)
…equestFn 适配、全量快照还原)
- makeTicketUrl 加 _i={service}~{action} + test_env + clientversion(与微信开发者工具抓包一致,否则 42001)
- getCosAuth 同步传 service/action
- msg-push 测试组:传输层改注入 cloudBaseOptions.requestFn(#949 重构后工具不再读 pluginOptions.msgPush.requestFn),mock 用适配器包装、真实用 qbase 直连 CGI(不走 apihttpagent)
- 真实模式全量快照还原:subscribe 会 rebound 改绑已有回调 + 强制 enable=true,unsubscribe/setEnable 无法恢复,结束用测试前 config 快照覆盖写(先读当前 version 避免乐观锁冲突)
- 已实测:mock 全过;真实模式干净基线跑通且配置完全还原(enable=false + 原回调不变)
… prefer ret=80208 for VERSION_CONFLICT (dc0eaaf9) Co-authored-by: Cursor <cursoragent@cursor.com>
…/...) (dc0eaaf9) Co-authored-by: Cursor <cursoragent@cursor.com>
…nce (dc0eaaf9) Fold wxide-CLI-first message push and customer-service auto-reply guidance into miniprogram-development; mark cloud_msg_push_* and CLI logs as 9109db6b gaps. Co-authored-by: Cursor <cursoragent@cursor.com>
…c0eaaf9) Accept new miniprogram-development message-push-customer-service surfaces into compat-baseline after skill docs landing. Co-authored-by: Cursor <cursoragent@cursor.com>
…elopment skill (dc0eaaf9) Translate references to Chinese narrative while keeping API/command names in English; bilingual SKILL.md description; English body; refresh compat baseline. Co-authored-by: Cursor <cursoragent@cursor.com>
added 2 commits
August 24, 2026 20:01
# Conflicts: # config/.claude/skills/miniprogram-development/SKILL.md # config/source/skills/miniprogram-development/SKILL.md
…x 1024-char limit (dc0eaaf9)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
新增消息推送配置 MCP 工具
queryMessagePush/manageMessagePush(通用能力,虚拟支付 7 事件为默认场景),支持 事件类 与 消息类型 订阅的批量/幂等管理,Agent 可一次性完成任意合法事件的订阅、启停、移除。功能清单
核心工具
queryMessagePush:list(当前配置 + version 乐观锁)、listSupportedEvents(合法事件/消息类型约束)manageMessagePush:subscribe/unsubscribe/setEnable,写操作带confirm="yes"确认保护(未确认返回CONFIRM_REQUIRED摘要)订阅能力
msg_type="event"):任意合法事件(user_enter_tempsession、xpay_*虚拟支付 7 事件等),subscribe缺省时默认订阅虚拟支付 7 事件msg_type="text"|"image"|"voice"|"video"|"miniprogrampage",2026-08-24 新增):管理消息类型条目(event 固定空串),缺省"event"完全向后兼容NO_CHANGE不发起写请求传输与可靠性
cloudBaseOptions.requestFn(service/action/version/region/payload),与 databaseNoSQL/functions 同模式,包内零 URL、零微信细节ret=80208),errmsg 正则仅兜底pluginsEnabled手动启用测试
tsc --noEmit通过vitest run src/tools/msg-push.test.ts:40/40 通过(schema/幂等/version 冲突/rebound 保留 enable/appid 透传/消息类型订阅)mcp/scripts/test-with-ticket.cjs):mock + 真实微信 IDE ticket(azhi 环境)全过——subscribe 幂等 / setEnable / unsubscribe / appid 透传 / 全量快照还原(测试不污染线上配置)配套文档(skill)
config/source/skills/miniprogram-development/:新增references/message-push-customer-service.md(消息推送配置、客服自动回复、云函数接收推送、日志入口,wxide CLI 优先、不暴露底层),全部 references 分层中文化(SKILL.md description 双语、正文英文),版本 2.28.1 → 2.32.0config/.claude/skills/miniprogram-development/)同步变更文件
mcp/src/tools/msg-push.ts(新):queryMessagePush / manageMessagePush 实现(含 msg_type 消息类型支持)mcp/src/tools/msg-push.test.ts(新):40 个单测mcp/src/types.ts:CloudApiRequestFn 可选 appid 字段 + MsgPush 相关类型mcp/src/server.ts:AVAILABLE_PLUGINS 注册 msg-pushmcp/src/index.ts:类型导出mcp/scripts/test-with-ticket.cjs:消息推送 E2E 测试组(_i参数 / qbase 直连 CGI / 全量快照还原 / msg_type 用例)config/source/skills/miniprogram-development/**:skill 文档(沉淀 + 中文化)config/source/editor-config/compat-baseline.json:advisory 刷新后续(不在本 PR)
specs/virtual-payment-mcp/design.md§5/§6 已定):main 升级 @cloudbase/cloudbase-mcp 后经EXPOSED_TOOL_NAME暴露cloud_msg_push_query/cloud_msg_push_manage,验证旧工具无 break change 后提 PR 给微信侧参考(ATO 9109db6b)