@cloudbase/cloudbase-mcp 2.32.1 → 2.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -73039,10 +73039,16 @@ function registerMsgPushTools(server) {
73039
73039
  return buildTransportUnavailablePayload("queryMessagePush", action);
73040
73040
  }
73041
73041
  if (action === "list") {
73042
- const [state, container] = await Promise.all([
73042
+ const [state, containerRaw] = await Promise.all([
73043
73043
  readCallbackConfig(server, appid),
73044
- readContainerConfig(server, appid),
73044
+ // 兼容性降级:微信侧 apihttpagent 通道不支持 getcontainercallbackconfig
73045
+ // (ret=-9991)时,容器配置读取失败不阻断 list(pushMode 默认 cloudfunction)
73046
+ readContainerConfig(server, appid).catch((e) => {
73047
+ console.warn(`[msg-push] 读取云托管容器配置失败,降级为云函数模式推断: ${e instanceof Error ? e.message : String(e)}`);
73048
+ return null;
73049
+ }),
73045
73050
  ]);
73051
+ const container = containerRaw;
73046
73052
  const pushMode = resolvePushMode(container);
73047
73053
  const callbacks = env
73048
73054
  ? state.list.filter((c) => c.env === env)
@@ -149409,7 +149415,7 @@ class TelemetryReporter {
149409
149415
  const arch = os_1.default.arch(); // 系统架构
149410
149416
  // Build-time injected version; guard for vitest / non-webpack runtimes.
149411
149417
  const mcpVersion = process.env.npm_package_version ||
149412
- ( true ? "2.32.1" : 0);
149418
+ ( true ? "2.32.2" : 0);
149413
149419
  return {
149414
149420
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
149415
149421
  deviceId: this.deviceId,
@@ -222687,7 +222693,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
222687
222693
  exports.CloudBaseContext = void 0;
222688
222694
  const constant_1 = __webpack_require__(40762);
222689
222695
  class CloudBaseContext {
222690
- constructor({ secretId = '', secretKey = '', token = '', proxy = '', region = '', envType = '', useInternalEndpoint = undefined, internalEndpointRegion = undefined }) {
222696
+ constructor({ secretId = '', secretKey = '', token = '', proxy = '', region = '', envType = '', useInternalEndpoint = undefined, internalEndpointRegion = undefined, requestFn = undefined }) {
222691
222697
  this.secretId = secretId;
222692
222698
  this.secretKey = secretKey;
222693
222699
  this.token = token;
@@ -222696,6 +222702,7 @@ class CloudBaseContext {
222696
222702
  this.envType = envType;
222697
222703
  this.useInternalEndpoint = useInternalEndpoint;
222698
222704
  this.internalEndpointRegion = internalEndpointRegion;
222705
+ this.requestFn = requestFn;
222699
222706
  }
222700
222707
  isInternalEndpoint() {
222701
222708
  return this.useInternalEndpoint !== undefined ? this.useInternalEndpoint : constant_1.USE_INTERNAL_ENDPOINT;
@@ -233180,7 +233187,7 @@ ${envIdSection}
233180
233187
  ## 环境信息
233181
233188
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
233182
233189
  - Node.js版本: ${process.version}
233183
- - MCP 版本:${process.env.npm_package_version || ( true ? "2.32.1" : 0)}
233190
+ - MCP 版本:${process.env.npm_package_version || ( true ? "2.32.2" : 0)}
233184
233191
  - 系统架构: ${os_1.default.arch()}
233185
233192
  - 时间: ${new Date().toISOString()}
233186
233193
  - 请求ID: ${requestId}
@@ -233261,7 +233268,7 @@ function createWrappedHandler(name, handler, server) {
233261
233268
  requestId: (typeof error === 'object' && error && 'requestId' in error) ? error.requestId : '',
233262
233269
  ide: server.ide || process.env.INTEGRATION_IDE || ''
233263
233270
  });
233264
- const mcpVersion = true ? "2.32.1" : 0;
233271
+ const mcpVersion = true ? "2.32.2" : 0;
233265
233272
  const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
233266
233273
  const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
233267
233274
  // 创建新的错误对象,保持原有的错误类型但更新消息
@@ -252650,7 +252657,7 @@ function registerSetupTools(server) {
252650
252657
  server.registerTool("downloadTemplate", {
252651
252658
  title: "下载项目模板",
252652
252659
  description: `自动下载并部署CloudBase项目模板。
252653
- **Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.32.1" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
252660
+ **Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.32.2" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
252654
252661
  inputSchema: {
252655
252662
  template: zod_1.z
252656
252663
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
@@ -270513,12 +270520,13 @@ function getDate(timestamp) {
270513
270520
  }
270514
270521
  class CloudService {
270515
270522
  /* eslint-disable-next-line */
270516
- constructor(context, service, version, baseParams) {
270523
+ constructor(context, service, version, baseParams, requestFn) {
270517
270524
  this.service = service;
270518
270525
  this.version = version;
270519
270526
  this.timeout = 60000;
270520
270527
  this.baseParams = baseParams || {};
270521
270528
  this.cloudBaseContext = context;
270529
+ this.requestFn = requestFn !== null && requestFn !== void 0 ? requestFn : context === null || context === void 0 ? void 0 : context.requestFn;
270522
270530
  }
270523
270531
  get baseUrl() {
270524
270532
  const internalEndpoint = this.cloudBaseContext.isInternalEndpoint();
@@ -270550,9 +270558,32 @@ class CloudService {
270550
270558
  }
270551
270559
  }
270552
270560
  async request(action, data = {}, method = 'POST') {
270561
+ var _a;
270553
270562
  this.action = action;
270554
- this.data = deepRemoveVoid(Object.assign(Object.assign({}, data), this.baseParams));
270555
270563
  this.method = method;
270564
+ this.data = deepRemoveVoid(Object.assign(Object.assign({}, data), this.baseParams));
270565
+ // 如果注入了 requestFn,直接委托,跳过 TC3 签名逻辑
270566
+ if (this.requestFn) {
270567
+ try {
270568
+ const result = await this.requestFn({
270569
+ service: this.service,
270570
+ action,
270571
+ version: this.version,
270572
+ region: (_a = this.cloudBaseContext.region) !== null && _a !== void 0 ? _a : '',
270573
+ payload: this.data,
270574
+ });
270575
+ return result;
270576
+ }
270577
+ catch (e) {
270578
+ if (e.name === 'CloudBaseError') {
270579
+ throw e;
270580
+ }
270581
+ throw new error_1.CloudBaseError(e.message, {
270582
+ action,
270583
+ code: e.code
270584
+ });
270585
+ }
270586
+ }
270556
270587
  this.url = this.baseUrl;
270557
270588
  let { secretId, secretKey, token } = this.cloudBaseContext;
270558
270589
  // 当在云函数环境下执行时,可init时不传入密钥,取环境变量中密钥使用
@@ -315767,9 +315798,9 @@ class CloudBase {
315767
315798
  }
315768
315799
  constructor(config = {}) {
315769
315800
  this.cloudBaseConfig = {};
315770
- let { secretId, secretKey, token, envId, proxy, region, envType, useInternalEndpoint, internalEndpointRegion } = config;
315771
- // config 中传入的 secretId secretkey 必须同时存在
315772
- if ((secretId && !secretKey) || (!secretId && secretKey)) {
315801
+ let { secretId, secretKey, token, envId, proxy, region, envType, useInternalEndpoint, internalEndpointRegion, requestFn } = config;
315802
+ // config 中传入的 secretId secretkey 必须同时存在(有 requestFn 时可以不传)
315803
+ if (!requestFn && ((secretId && !secretKey) || (!secretId && secretKey))) {
315773
315804
  throw new Error('secretId and secretKey must be a pair');
315774
315805
  }
315775
315806
  this.cloudBaseConfig = {
@@ -315782,6 +315813,7 @@ class CloudBase {
315782
315813
  region,
315783
315814
  useInternalEndpoint,
315784
315815
  internalEndpointRegion,
315816
+ requestFn,
315785
315817
  };
315786
315818
  // 初始化 context
315787
315819
  this.context = new context_1.CloudBaseContext(this.cloudBaseConfig);
package/dist/index.js CHANGED
@@ -3474,7 +3474,7 @@ ${envIdSection}
3474
3474
  ## 环境信息
3475
3475
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
3476
3476
  - Node.js版本: ${process.version}
3477
- - MCP 版本:${process.env.npm_package_version || ( true ? "2.32.1" : 0)}
3477
+ - MCP 版本:${process.env.npm_package_version || ( true ? "2.32.2" : 0)}
3478
3478
  - 系统架构: ${os_1.default.arch()}
3479
3479
  - 时间: ${new Date().toISOString()}
3480
3480
  - 请求ID: ${requestId}
@@ -3555,7 +3555,7 @@ function createWrappedHandler(name, handler, server) {
3555
3555
  requestId: (typeof error === 'object' && error && 'requestId' in error) ? error.requestId : '',
3556
3556
  ide: server.ide || process.env.INTEGRATION_IDE || ''
3557
3557
  });
3558
- const mcpVersion = true ? "2.32.1" : 0;
3558
+ const mcpVersion = true ? "2.32.2" : 0;
3559
3559
  const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
3560
3560
  const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
3561
3561
  // 创建新的错误对象,保持原有的错误类型但更新消息
@@ -13752,7 +13752,7 @@ class TelemetryReporter {
13752
13752
  const arch = os_1.default.arch(); // 系统架构
13753
13753
  // Build-time injected version; guard for vitest / non-webpack runtimes.
13754
13754
  const mcpVersion = process.env.npm_package_version ||
13755
- ( true ? "2.32.1" : 0);
13755
+ ( true ? "2.32.2" : 0);
13756
13756
  return {
13757
13757
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
13758
13758
  deviceId: this.deviceId,
@@ -19659,7 +19659,7 @@ function registerSetupTools(server) {
19659
19659
  server.registerTool("downloadTemplate", {
19660
19660
  title: "下载项目模板",
19661
19661
  description: `自动下载并部署CloudBase项目模板。
19662
- **Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.32.1" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
19662
+ **Note**: Call this tool when the user requests to create a new project using a CloudBase template.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置\n- cursor: Cursor AI编辑器\n- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.32.2" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
19663
19663
  inputSchema: {
19664
19664
  template: zod_1.z
19665
19665
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
@@ -22747,10 +22747,16 @@ function registerMsgPushTools(server) {
22747
22747
  return buildTransportUnavailablePayload("queryMessagePush", action);
22748
22748
  }
22749
22749
  if (action === "list") {
22750
- const [state, container] = await Promise.all([
22750
+ const [state, containerRaw] = await Promise.all([
22751
22751
  readCallbackConfig(server, appid),
22752
- readContainerConfig(server, appid),
22752
+ // 兼容性降级:微信侧 apihttpagent 通道不支持 getcontainercallbackconfig
22753
+ // (ret=-9991)时,容器配置读取失败不阻断 list(pushMode 默认 cloudfunction)
22754
+ readContainerConfig(server, appid).catch((e) => {
22755
+ console.warn(`[msg-push] 读取云托管容器配置失败,降级为云函数模式推断: ${e instanceof Error ? e.message : String(e)}`);
22756
+ return null;
22757
+ }),
22753
22758
  ]);
22759
+ const container = containerRaw;
22754
22760
  const pushMode = resolvePushMode(container);
22755
22761
  const callbacks = env
22756
22762
  ? state.list.filter((c) => c.env === env)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cloudbase-mcp",
3
- "version": "2.32.1",
3
+ "version": "2.32.2",
4
4
  "mcpName": "io.github.TencentCloudBase/cloudbase-mcp",
5
5
  "packageManager": "pnpm@10.8.0",
6
6
  "description": "CloudBase MCP Server — operate Tencent CloudBase (database, auth, functions, storage, hosting) from AI coding tools via the Model Context Protocol. Part of CloudBase AI Toolkit.",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.TencentCloudBase/cloudbase-mcp",
4
4
  "title": "CloudBase",
5
5
  "description": "CloudBase MCP: DB, functions, storage, hosting via @cloudbase/cloudbase-mcp",
6
- "version": "2.32.1",
6
+ "version": "2.32.2",
7
7
  "websiteUrl": "https://github.com/TencentCloudBase/CloudBase-AI-Toolkit",
8
8
  "repository": {
9
9
  "url": "https://github.com/TencentCloudBase/CloudBase-AI-Toolkit",
@@ -25,7 +25,7 @@
25
25
  "registryType": "npm",
26
26
  "registryBaseUrl": "https://registry.npmjs.org",
27
27
  "identifier": "@cloudbase/cloudbase-mcp",
28
- "version": "2.32.1",
28
+ "version": "2.32.2",
29
29
  "runtimeHint": "npx",
30
30
  "transport": {
31
31
  "type": "stdio"