@cloudbase/cloudbase-mcp 2.6.3 → 2.6.5

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.js CHANGED
@@ -360,7 +360,7 @@ function registerEnvTools(server) {
360
360
  content: [
361
361
  {
362
362
  type: "text",
363
- text: JSON.stringify(result, null, 2),
363
+ text: `${JSON.stringify(result, null, 2)}\n\n请注意安全域名需要10分钟才能生效,用户也应该了解这一点。`,
364
364
  },
365
365
  ],
366
366
  };
@@ -517,7 +517,7 @@ ${envIdSection}
517
517
  ## 环境信息
518
518
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
519
519
  - Node.js版本: ${process.version}
520
- - MCP 版本:${process.env.npm_package_version || "2.6.3" || 0}
520
+ - MCP 版本:${process.env.npm_package_version || "2.6.5" || 0}
521
521
  - 系统架构: ${os_1.default.arch()}
522
522
  - 时间: ${new Date().toISOString()}
523
523
  - 请求ID: ${requestId}
@@ -1417,7 +1417,7 @@ class InteractiveServer {
1417
1417
  this.stop().catch((err) => {
1418
1418
  (0, logger_js_1.debug)("Error stopping server after timeout:", err);
1419
1419
  });
1420
- resolve({ type: "envId", data: null, cancelled: true });
1420
+ resolve({ type: "envId", data: null, cancelled: true, timeout: true, timeoutDuration });
1421
1421
  }
1422
1422
  }, timeoutDuration);
1423
1423
  // Store timeout ID so we can clear it if resolved early
@@ -3997,14 +3997,59 @@ class EnvironmentManager {
3997
3997
  }
3998
3998
  // 2. 自动设置环境ID (pass mcpServer for IDE detection)
3999
3999
  (0, logger_js_1.debug)('未找到环境ID,尝试自动设置...');
4000
- const autoEnvId = await (0, interactive_js_1.autoSetupEnvironmentId)(mcpServer);
4000
+ let setupResult;
4001
+ try {
4002
+ setupResult = await (0, interactive_js_1._promptAndSetEnvironmentId)(true, { server: mcpServer });
4003
+ }
4004
+ catch (setupError) {
4005
+ // Preserve original error information
4006
+ const errorObj = setupError instanceof Error ? setupError : new Error(String(setupError));
4007
+ (0, logger_js_1.error)('自动设置环境ID时发生异常:', {
4008
+ error: errorObj.message,
4009
+ stack: errorObj.stack,
4010
+ name: errorObj.name,
4011
+ });
4012
+ // Re-throw with enhanced context
4013
+ const enhancedError = new Error(`自动设置环境ID失败: ${errorObj.message}`);
4014
+ enhancedError.originalError = errorObj;
4015
+ enhancedError.failureInfo = {
4016
+ reason: 'unknown_error',
4017
+ error: errorObj.message,
4018
+ errorCode: 'SETUP_EXCEPTION',
4019
+ };
4020
+ throw enhancedError;
4021
+ }
4022
+ const autoEnvId = setupResult.selectedEnvId;
4001
4023
  if (!autoEnvId) {
4002
- throw new Error("CloudBase Environment ID not found after auto setup. Please set CLOUDBASE_ENV_ID or run setupEnvironmentId tool.");
4024
+ // Build detailed error message from failure info
4025
+ const errorMessage = this._buildDetailedErrorMessage(setupResult.failureInfo);
4026
+ (0, logger_js_1.error)('自动设置环境ID失败:', {
4027
+ reason: setupResult.failureInfo?.reason,
4028
+ errorCode: setupResult.failureInfo?.errorCode,
4029
+ error: setupResult.failureInfo?.error,
4030
+ details: setupResult.failureInfo?.details,
4031
+ });
4032
+ // Create error with detailed information
4033
+ const detailedError = new Error(errorMessage);
4034
+ detailedError.failureInfo = setupResult.failureInfo;
4035
+ throw detailedError;
4003
4036
  }
4004
4037
  (0, logger_js_1.debug)('自动设置环境ID成功:', { envId: autoEnvId });
4005
4038
  this._setCachedEnvId(autoEnvId);
4006
4039
  return autoEnvId;
4007
4040
  }
4041
+ catch (err) {
4042
+ // Log the error with full context before re-throwing
4043
+ const errorObj = err instanceof Error ? err : new Error(String(err));
4044
+ (0, logger_js_1.error)('获取环境ID失败:', {
4045
+ message: errorObj.message,
4046
+ stack: errorObj.stack,
4047
+ name: errorObj.name,
4048
+ failureInfo: errorObj.failureInfo,
4049
+ originalError: errorObj.originalError,
4050
+ });
4051
+ throw errorObj;
4052
+ }
4008
4053
  finally {
4009
4054
  this.envIdPromise = null;
4010
4055
  }
@@ -4015,6 +4060,65 @@ class EnvironmentManager {
4015
4060
  process.env.CLOUDBASE_ENV_ID = envId;
4016
4061
  (0, logger_js_1.debug)('已更新环境ID缓存:', { envId });
4017
4062
  }
4063
+ // Build detailed error message from failure info
4064
+ _buildDetailedErrorMessage(failureInfo) {
4065
+ if (!failureInfo) {
4066
+ return "CloudBase Environment ID not found after auto setup. Please set CLOUDBASE_ENV_ID or run setupEnvironmentId tool.";
4067
+ }
4068
+ const { reason, error: errorMsg, errorCode, helpUrl, details } = failureInfo;
4069
+ let message = "CloudBase Environment ID not found after auto setup.\n\n";
4070
+ message += `原因: ${this._getReasonDescription(reason)}\n`;
4071
+ if (errorMsg) {
4072
+ message += `错误: ${errorMsg}\n`;
4073
+ }
4074
+ if (errorCode) {
4075
+ message += `错误代码: ${errorCode}\n`;
4076
+ }
4077
+ // Add specific details based on failure reason
4078
+ if (reason === 'tcb_init_failed' && details?.initTcbError) {
4079
+ const initError = details.initTcbError;
4080
+ if (initError.needRealNameAuth) {
4081
+ message += "\n需要完成实名认证才能使用 CloudBase 服务。\n";
4082
+ }
4083
+ if (initError.needCamAuth) {
4084
+ message += "\n需要 CAM 权限才能使用 CloudBase 服务。\n";
4085
+ }
4086
+ }
4087
+ if (reason === 'env_creation_failed' && details?.createEnvError) {
4088
+ const createError = details.createEnvError;
4089
+ message += `\n环境创建失败: ${createError.message || '未知错误'}\n`;
4090
+ }
4091
+ if (reason === 'env_query_failed' && details?.queryEnvError) {
4092
+ message += `\n环境查询失败: ${details.queryEnvError}\n`;
4093
+ }
4094
+ if (reason === 'timeout' && details?.timeoutDuration) {
4095
+ message += `\n超时时间: ${details.timeoutDuration / 1000} 秒\n`;
4096
+ message += "提示: 请确保浏览器窗口已打开,并在规定时间内完成环境选择。\n";
4097
+ }
4098
+ message += "\n解决方案:\n";
4099
+ message += "1. 手动设置环境ID: 设置环境变量 CLOUDBASE_ENV_ID\n";
4100
+ message += "2. 使用工具设置: 运行 setupEnvironmentId 工具\n";
4101
+ if (helpUrl) {
4102
+ message += `3. 查看帮助文档: ${helpUrl}\n`;
4103
+ }
4104
+ else {
4105
+ message += "3. 查看帮助文档: https://docs.cloudbase.net/cli-v1/env\n";
4106
+ }
4107
+ return message;
4108
+ }
4109
+ _getReasonDescription(reason) {
4110
+ const descriptions = {
4111
+ 'timeout': '环境选择超时',
4112
+ 'cancelled': '用户取消了环境选择',
4113
+ 'no_environments': '没有可用环境',
4114
+ 'login_failed': '登录失败',
4115
+ 'tcb_init_failed': 'CloudBase 服务初始化失败',
4116
+ 'env_query_failed': '环境列表查询失败',
4117
+ 'env_creation_failed': '环境创建失败',
4118
+ 'unknown_error': '未知错误',
4119
+ };
4120
+ return descriptions[reason] || '未知原因';
4121
+ }
4018
4122
  // 手动设置环境ID(用于外部调用)
4019
4123
  async setEnvId(envId) {
4020
4124
  this._setCachedEnvId(envId);
@@ -4328,6 +4432,11 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4328
4432
  selectedEnvId: null,
4329
4433
  cancelled: false,
4330
4434
  error: "请先登录云开发账户",
4435
+ failureInfo: {
4436
+ reason: 'login_failed',
4437
+ error: "请先登录云开发账户",
4438
+ errorCode: "LOGIN_REQUIRED",
4439
+ },
4331
4440
  };
4332
4441
  }
4333
4442
  // Get UIN for telemetry
@@ -4458,13 +4567,15 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4458
4567
  (0, logger_js_1.debug)("降级到 listEnvs() 也失败:", fallbackError instanceof Error ? fallbackError : new Error(String(fallbackError)));
4459
4568
  }
4460
4569
  }
4461
- // Report query_env_list event
4570
+ // Report query_env_list event with detailed information
4462
4571
  await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
4463
4572
  step: 'query_env_list',
4464
4573
  success: queryEnvSuccess ? 'true' : 'false',
4465
4574
  uin: setupContext.uin || 'unknown',
4466
4575
  error: queryEnvError ? queryEnvError.substring(0, 200) : undefined,
4467
- envCount: (envResult?.EnvList || []).length
4576
+ envCount: (envResult?.EnvList || []).length,
4577
+ hasInitTcbError: !!setupContext.initTcbError,
4578
+ tcbServiceInitialized: setupContext.tcbServiceInitialized,
4468
4579
  });
4469
4580
  (0, logger_js_1.debug)("[interactive] Environment query result:", {
4470
4581
  hasResult: !!envResult,
@@ -4472,6 +4583,24 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4472
4583
  querySuccess: queryEnvSuccess,
4473
4584
  queryError: queryEnvError
4474
4585
  });
4586
+ // If query failed completely, return error
4587
+ if (!queryEnvSuccess && queryEnvError) {
4588
+ (0, logger_js_1.debug)("[interactive] Environment query failed completely, returning error");
4589
+ return {
4590
+ selectedEnvId: null,
4591
+ cancelled: false,
4592
+ error: `无法获取环境列表: ${queryEnvError}`,
4593
+ failureInfo: {
4594
+ reason: 'env_query_failed',
4595
+ error: `无法获取环境列表: ${queryEnvError}`,
4596
+ errorCode: "ENV_QUERY_FAILED",
4597
+ helpUrl: "https://docs.cloudbase.net/cli-v1/env",
4598
+ details: {
4599
+ queryEnvError,
4600
+ },
4601
+ },
4602
+ };
4603
+ }
4475
4604
  const { EnvList } = envResult || {};
4476
4605
  let selectedEnvId = null;
4477
4606
  // 4. 如果没有环境,尝试自动创建免费环境
@@ -4482,11 +4611,15 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4482
4611
  });
4483
4612
  if (!EnvList || EnvList.length === 0) {
4484
4613
  (0, logger_js_1.debug)("[interactive] No environments found");
4485
- // Report no_envs event
4614
+ // Report no_envs event with context
4486
4615
  await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
4487
4616
  step: 'no_envs',
4488
4617
  success: 'true',
4489
- uin: setupContext.uin || 'unknown'
4618
+ uin: setupContext.uin || 'unknown',
4619
+ hasInitTcbError: !!setupContext.initTcbError,
4620
+ tcbServiceInitialized: setupContext.tcbServiceInitialized,
4621
+ initTcbErrorCode: setupContext.initTcbError?.code,
4622
+ inCloudMode,
4490
4623
  });
4491
4624
  // Only try to create free environment if TCB service is initialized successfully
4492
4625
  // If InitTcb failed, skip environment creation
@@ -4638,11 +4771,19 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4638
4771
  if (inCloudMode) {
4639
4772
  (0, logger_js_1.debug)("[interactive] CloudMode: Returning error message");
4640
4773
  let errorMsg = "未找到可用环境";
4774
+ let failureReason = 'no_environments';
4775
+ let errorCode = "NO_ENVIRONMENTS";
4641
4776
  if (setupContext.initTcbError) {
4642
4777
  errorMsg += `\nCloudBase 初始化失败: ${setupContext.initTcbError.message}`;
4778
+ failureReason = 'tcb_init_failed';
4779
+ errorCode = setupContext.initTcbError.code || "TCB_INIT_FAILED";
4643
4780
  }
4644
4781
  if (setupContext.createEnvError) {
4645
4782
  errorMsg += `\n环境创建失败: ${setupContext.createEnvError.message}`;
4783
+ if (failureReason === 'no_environments') {
4784
+ failureReason = 'env_creation_failed';
4785
+ }
4786
+ errorCode = setupContext.createEnvError.code || "ENV_CREATION_FAILED";
4646
4787
  }
4647
4788
  const helpUrl = setupContext.createEnvError?.helpUrl || setupContext.initTcbError?.helpUrl;
4648
4789
  if (helpUrl) {
@@ -4652,7 +4793,17 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4652
4793
  selectedEnvId: null,
4653
4794
  cancelled: false,
4654
4795
  error: errorMsg,
4655
- noEnvs: true
4796
+ noEnvs: true,
4797
+ failureInfo: {
4798
+ reason: failureReason,
4799
+ error: errorMsg,
4800
+ errorCode,
4801
+ helpUrl,
4802
+ details: {
4803
+ initTcbError: setupContext.initTcbError,
4804
+ createEnvError: setupContext.createEnvError,
4805
+ },
4806
+ },
4656
4807
  };
4657
4808
  }
4658
4809
  // In normal mode, show UI (even if creation failed or skipped)
@@ -4713,7 +4864,23 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4713
4864
  cloudbase, // Pass manager for refreshing env list
4714
4865
  resolvedServer);
4715
4866
  if (result.cancelled) {
4716
- return { selectedEnvId: null, cancelled: true };
4867
+ const isTimeout = result.timeout === true;
4868
+ const timeoutDuration = result.timeoutDuration;
4869
+ return {
4870
+ selectedEnvId: null,
4871
+ cancelled: true,
4872
+ failureInfo: {
4873
+ reason: isTimeout ? 'timeout' : 'cancelled',
4874
+ error: isTimeout
4875
+ ? `环境选择超时(${timeoutDuration ? timeoutDuration / 1000 : 120}秒),请重新尝试或手动设置环境ID`
4876
+ : "用户取消了环境选择",
4877
+ errorCode: isTimeout ? "ENV_SELECTION_TIMEOUT" : "USER_CANCELLED",
4878
+ helpUrl: isTimeout ? "https://docs.cloudbase.net/cli-v1/env" : undefined,
4879
+ details: isTimeout ? {
4880
+ timeoutDuration,
4881
+ } : undefined,
4882
+ },
4883
+ };
4717
4884
  }
4718
4885
  if (result.switch) {
4719
4886
  // Report switch_account event
@@ -4736,20 +4903,70 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
4736
4903
  // 自动设置环境ID(无需MCP工具调用)
4737
4904
  async function autoSetupEnvironmentId(mcpServer) {
4738
4905
  try {
4739
- const { selectedEnvId, cancelled, error, noEnvs } = await _promptAndSetEnvironmentId(true, { server: mcpServer });
4906
+ const { selectedEnvId, cancelled, error, noEnvs, failureInfo } = await _promptAndSetEnvironmentId(true, { server: mcpServer });
4740
4907
  if (error || noEnvs || cancelled) {
4741
- (0, logger_js_1.debug)("Auto setup environment ID interrupted or failed silently.", {
4908
+ (0, logger_js_1.debug)("Auto setup environment ID interrupted or failed.", {
4742
4909
  error,
4743
4910
  noEnvs,
4744
4911
  cancelled,
4912
+ failureInfo,
4745
4913
  });
4914
+ // Report failure to telemetry with detailed information
4915
+ if (failureInfo) {
4916
+ const telemetryData = {
4917
+ step: 'auto_setup_failed',
4918
+ success: 'false',
4919
+ reason: failureInfo.reason,
4920
+ errorCode: failureInfo.errorCode,
4921
+ error: failureInfo.error?.substring(0, 200),
4922
+ };
4923
+ // Add detailed context based on failure reason
4924
+ if (failureInfo.details) {
4925
+ if (failureInfo.details.initTcbError) {
4926
+ telemetryData.initTcbErrorCode = failureInfo.details.initTcbError.code;
4927
+ telemetryData.needRealNameAuth = failureInfo.details.initTcbError.needRealNameAuth;
4928
+ telemetryData.needCamAuth = failureInfo.details.initTcbError.needCamAuth;
4929
+ }
4930
+ if (failureInfo.details.createEnvError) {
4931
+ telemetryData.createEnvErrorCode = failureInfo.details.createEnvError.code;
4932
+ }
4933
+ if (failureInfo.details.queryEnvError) {
4934
+ telemetryData.queryEnvError = failureInfo.details.queryEnvError.substring(0, 200);
4935
+ }
4936
+ if (failureInfo.details.timeoutDuration) {
4937
+ telemetryData.timeoutDuration = failureInfo.details.timeoutDuration;
4938
+ }
4939
+ }
4940
+ if (failureInfo.helpUrl) {
4941
+ telemetryData.helpUrl = failureInfo.helpUrl;
4942
+ }
4943
+ await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', telemetryData);
4944
+ }
4945
+ else {
4946
+ // Fallback: report without failureInfo
4947
+ await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
4948
+ step: 'auto_setup_failed',
4949
+ success: 'false',
4950
+ reason: 'unknown',
4951
+ error: error || (noEnvs ? 'no_environments' : cancelled ? 'cancelled' : 'unknown'),
4952
+ });
4953
+ }
4746
4954
  return null;
4747
4955
  }
4748
4956
  (0, logger_js_1.debug)("Auto setup environment ID successful.", { selectedEnvId });
4749
4957
  return selectedEnvId;
4750
4958
  }
4751
4959
  catch (error) {
4752
- console.error("自动配置环境ID时出错:", error);
4960
+ const errorObj = error instanceof Error ? error : new Error(String(error));
4961
+ console.error("自动配置环境ID时出错:", errorObj);
4962
+ // Report unexpected error to telemetry
4963
+ await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
4964
+ step: 'auto_setup_exception',
4965
+ success: 'false',
4966
+ reason: 'unknown_error',
4967
+ error: errorObj.message.substring(0, 200),
4968
+ stack: errorObj.stack?.substring(0, 500),
4969
+ });
4753
4970
  return null;
4754
4971
  }
4755
4972
  }
@@ -8430,7 +8647,7 @@ class TelemetryReporter {
8430
8647
  const nodeVersion = process.version; // Node.js版本
8431
8648
  const arch = os_1.default.arch(); // 系统架构
8432
8649
  // 从构建时注入的版本号获取MCP版本信息
8433
- const mcpVersion = process.env.npm_package_version || "2.6.3" || 0;
8650
+ const mcpVersion = process.env.npm_package_version || "2.6.5" || 0;
8434
8651
  return {
8435
8652
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
8436
8653
  deviceId: this.deviceId,
@@ -9003,7 +9220,21 @@ function registerFunctionTools(server) {
9003
9220
  // }
9004
9221
  // 使用闭包中的 cloudBaseOptions
9005
9222
  const cloudbase = await getManager();
9006
- const result = await cloudbase.functions.updateFunctionConfig(funcParam);
9223
+ const functionDetail = await cloudbase.functions.getFunctionDetail(funcParam.name);
9224
+ functionDetail.Environment;
9225
+ const vpc = (typeof functionDetail.VpcConfig === 'object' && functionDetail.VpcConfig !== null && functionDetail.VpcConfig.SubnetId && functionDetail.VpcConfig.VpcId) ? {
9226
+ subnetId: functionDetail.VpcConfig.SubnetId,
9227
+ vpcId: functionDetail.VpcConfig.VpcId
9228
+ } : undefined;
9229
+ const result = await cloudbase.functions.updateFunctionConfig({
9230
+ name: funcParam.name,
9231
+ envVariables: Object.assign({}, functionDetail.Environment.Variables.reduce((acc, curr) => {
9232
+ acc[curr.Key] = curr.Value;
9233
+ return acc;
9234
+ }, {}), funcParam.envVariables ?? {}),
9235
+ timeout: funcParam.timeout ?? functionDetail.Timeout,
9236
+ vpc: Object.assign({}, vpc, funcParam.vpc ?? {}),
9237
+ });
9007
9238
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
9008
9239
  return {
9009
9240
  content: [
@@ -9715,6 +9946,20 @@ function matchesPath(file, pathPattern) {
9715
9946
  return file === pathPattern;
9716
9947
  }
9717
9948
  }
9949
+ // 构建 IDE 配置文件检查清单
9950
+ // 返回所有需要检查的路径模式列表
9951
+ function buildIDEChecklist() {
9952
+ return ALL_IDE_FILES;
9953
+ }
9954
+ // 检查文件是否在检查清单范围内
9955
+ function isInChecklist(file, checklist) {
9956
+ for (const pattern of checklist) {
9957
+ if (matchesPath(file, pattern)) {
9958
+ return true;
9959
+ }
9960
+ }
9961
+ return false;
9962
+ }
9718
9963
  // 文件过滤函数
9719
9964
  function filterFilesByIDE(files, ide) {
9720
9965
  if (ide === "all") {
@@ -9724,32 +9969,24 @@ function filterFilesByIDE(files, ide) {
9724
9969
  if (!ideFiles) {
9725
9970
  return files; // 如果找不到映射,返回所有文件
9726
9971
  }
9727
- // 计算需要排除的IDE文件(除了当前IDE需要的文件)
9728
- const filesToExclude = [];
9729
- // 遍历所有IDE文件,找出不属于当前IDE的文件
9730
- for (const ideFile of ALL_IDE_FILES) {
9731
- // 检查这个文件是否属于当前IDE需要的文件
9732
- let isCurrentIDEFile = false;
9733
- for (const currentIDEFile of ideFiles) {
9734
- if (matchesPath(ideFile, currentIDEFile)) {
9735
- isCurrentIDEFile = true;
9736
- break;
9737
- }
9738
- }
9739
- // 如果不属于当前IDE,加入排除列表
9740
- if (!isCurrentIDEFile) {
9741
- filesToExclude.push(ideFile);
9742
- }
9743
- }
9744
- // 排除不需要的IDE配置文件,保留其他所有文件
9972
+ // 构建检查清单
9973
+ const checklist = buildIDEChecklist();
9974
+ // 两阶段过滤
9745
9975
  return files.filter((file) => {
9746
- // 检查文件是否应该被排除
9747
- for (const excludePath of filesToExclude) {
9748
- if (matchesPath(file, excludePath)) {
9749
- return false; // 排除
9976
+ // 阶段1: 检查文件是否在检查清单范围内
9977
+ if (!isInChecklist(file, checklist)) {
9978
+ // 不在检查清单范围内,直接保留
9979
+ return true;
9980
+ }
9981
+ // 阶段2: 在检查清单范围内,检查是否属于当前 IDE
9982
+ for (const ideFile of ideFiles) {
9983
+ if (matchesPath(file, ideFile)) {
9984
+ // 属于当前 IDE,保留
9985
+ return true;
9750
9986
  }
9751
9987
  }
9752
- return true; // 保留
9988
+ // 在检查清单范围内但不属于当前 IDE,排除
9989
+ return false;
9753
9990
  });
9754
9991
  }
9755
9992
  // 创建过滤后的目录结构
@@ -9777,7 +10014,7 @@ function registerSetupTools(server) {
9777
10014
  title: "下载项目模板",
9778
10015
  description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
9779
10016
 
9780
- **CRITICAL**: This tool MUST be called FIRST when starting a new project.\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- 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\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.6.3" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
10017
+ **CRITICAL**: This tool MUST be called FIRST when starting a new project.\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- 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\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.6.5" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
9781
10018
  inputSchema: {
9782
10019
  template: zod_1.z
9783
10020
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cloudbase-mcp",
3
- "version": "2.6.3",
3
+ "version": "2.6.5",
4
4
  "description": "腾讯云开发 MCP Server,通过AI提示词和MCP协议+云开发,让开发更智能、更高效,当你在Cursor/ VSCode GitHub Copilot/WinSurf/CodeBuddy/Augment Code/Claude Code等AI编程工具里写代码时,它能自动帮你生成可直接部署的前后端应用+小程序,并一键发布到腾讯云开发 CloudBase。",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",