@cloudbase/cloudbase-mcp 2.6.5 → 2.7.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
@@ -1614,6 +1614,7 @@ warn.forProperties(exports, 'deprecated', ['emitErrs', 'levelLength']);
1614
1614
  "use strict";
1615
1615
 
1616
1616
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1617
+ exports.simplifyEnvList = simplifyEnvList;
1617
1618
  exports.registerEnvTools = registerEnvTools;
1618
1619
  const zod_1 = __webpack_require__(21614);
1619
1620
  const auth_js_1 = __webpack_require__(77291);
@@ -1621,6 +1622,36 @@ const cloudbase_manager_js_1 = __webpack_require__(3431);
1621
1622
  const logger_js_1 = __webpack_require__(13039);
1622
1623
  const interactive_js_1 = __webpack_require__(3461);
1623
1624
  const rag_js_1 = __webpack_require__(64215);
1625
+ /**
1626
+ * Simplify environment list data by keeping only essential fields for AI assistant
1627
+ * This reduces token consumption when returning environment lists via MCP tools
1628
+ * @param envList - Full environment list from API
1629
+ * @returns Simplified environment list with only essential fields
1630
+ */
1631
+ function simplifyEnvList(envList) {
1632
+ if (!Array.isArray(envList)) {
1633
+ return envList;
1634
+ }
1635
+ return envList.map((env) => {
1636
+ // Only keep essential fields that are useful for AI assistant
1637
+ const simplified = {};
1638
+ if (env.EnvId !== undefined)
1639
+ simplified.EnvId = env.EnvId;
1640
+ if (env.Alias !== undefined)
1641
+ simplified.Alias = env.Alias;
1642
+ if (env.Status !== undefined)
1643
+ simplified.Status = env.Status;
1644
+ if (env.EnvType !== undefined)
1645
+ simplified.EnvType = env.EnvType;
1646
+ if (env.Region !== undefined)
1647
+ simplified.Region = env.Region;
1648
+ if (env.PackageName !== undefined)
1649
+ simplified.PackageName = env.PackageName;
1650
+ if (env.IsDefault !== undefined)
1651
+ simplified.IsDefault = env.IsDefault;
1652
+ return simplified;
1653
+ });
1654
+ }
1624
1655
  function registerEnvTools(server) {
1625
1656
  // 获取 cloudBaseOptions,如果没有则为 undefined
1626
1657
  const cloudBaseOptions = server.cloudBaseOptions;
@@ -1820,6 +1851,10 @@ function registerEnvTools(server) {
1820
1851
  result = await cloudbaseList.env.listEnvs();
1821
1852
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
1822
1853
  }
1854
+ // Apply field simplification for MCP tool response to reduce token consumption
1855
+ if (result && Array.isArray(result.EnvList)) {
1856
+ result.EnvList = simplifyEnvList(result.EnvList);
1857
+ }
1823
1858
  }
1824
1859
  catch (error) {
1825
1860
  (0, logger_js_1.debug)("获取环境列表时出错,尝试降级到 listEnvs():", error instanceof Error ? error : new Error(String(error)));
@@ -1832,6 +1867,10 @@ function registerEnvTools(server) {
1832
1867
  });
1833
1868
  result = await cloudbaseList.env.listEnvs();
1834
1869
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
1870
+ // Apply field simplification for fallback response as well
1871
+ if (result && Array.isArray(result.EnvList)) {
1872
+ result.EnvList = simplifyEnvList(result.EnvList);
1873
+ }
1835
1874
  }
1836
1875
  catch (fallbackError) {
1837
1876
  (0, logger_js_1.debug)("降级到 listEnvs() 也失败:", fallbackError instanceof Error ? fallbackError : new Error(String(fallbackError)));
@@ -137019,7 +137058,7 @@ class TelemetryReporter {
137019
137058
  const nodeVersion = process.version; // Node.js版本
137020
137059
  const arch = os_1.default.arch(); // 系统架构
137021
137060
  // 从构建时注入的版本号获取MCP版本信息
137022
- const mcpVersion = process.env.npm_package_version || "2.6.5" || 0;
137061
+ const mcpVersion = process.env.npm_package_version || "2.7.2" || 0;
137023
137062
  return {
137024
137063
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
137025
137064
  deviceId: this.deviceId,
@@ -203583,7 +203622,7 @@ ${envIdSection}
203583
203622
  ## 环境信息
203584
203623
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
203585
203624
  - Node.js版本: ${process.version}
203586
- - MCP 版本:${process.env.npm_package_version || "2.6.5" || 0}
203625
+ - MCP 版本:${process.env.npm_package_version || "2.7.2" || 0}
203587
203626
  - 系统架构: ${os_1.default.arch()}
203588
203627
  - 时间: ${new Date().toISOString()}
203589
203628
  - 请求ID: ${requestId}
@@ -217899,6 +217938,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
217899
217938
  return (mod && mod.__esModule) ? mod : { "default": mod };
217900
217939
  };
217901
217940
  Object.defineProperty(exports, "__esModule", ({ value: true }));
217941
+ exports.RAW_IDE_FILE_MAPPINGS = void 0;
217902
217942
  exports.registerSetupTools = registerSetupTools;
217903
217943
  const adm_zip_1 = __importDefault(__webpack_require__(30283));
217904
217944
  const fs = __importStar(__webpack_require__(29021));
@@ -217953,45 +217993,78 @@ const IDE_TYPES = [
217953
217993
  "antigravity", // Google Antigravity AI编辑器
217954
217994
  "vscode", // Visual Studio Code
217955
217995
  "kiro", // Kiro AI编辑器
217996
+ "aider", // Aider AI编辑器
217997
+ "iflow-cli", // iFlow CLI
217956
217998
  ];
217957
217999
  // IDE到文件的映射关系
217958
218000
  // 注意:以 "/" 结尾的路径表示目录,会包含该目录下的所有文件
217959
- const IDE_FILE_MAPPINGS = {
217960
- cursor: [".cursor/rules/", ".cursor/mcp.json"],
217961
- windsurf: [".windsurf/rules/"],
217962
- codebuddy: [".rules/cloudbase-rules.md", "CODEBUDDY.md", ".mcp.json"],
218001
+ exports.RAW_IDE_FILE_MAPPINGS = {
218002
+ cursor: [
218003
+ { path: ".cursor/rules/" },
218004
+ { path: ".cursor/mcp.json", isMcpConfig: true },
218005
+ ],
218006
+ windsurf: [{ path: ".windsurf/rules/" }],
218007
+ codebuddy: [
218008
+ { path: ".rules/cloudbase-rules.md" },
218009
+ { path: ".codebuddy/" },
218010
+ { path: "CODEBUDDY.md" },
218011
+ { path: ".mcp.json", isMcpConfig: true },
218012
+ ],
217963
218013
  "claude-code": [
217964
- "CLAUDE.md",
217965
- ".mcp.json",
217966
- ".claude/settings.local.json",
217967
- ".claude/commands/prototype.md",
217968
- ".claude/commands/spec.md",
217969
- ".claude/commands/no_spec.md",
218014
+ { path: "CLAUDE.md" },
218015
+ { path: ".mcp.json", isMcpConfig: true },
218016
+ { path: ".claude/" },
218017
+ ],
218018
+ cline: [{ path: ".clinerules/" }],
218019
+ "gemini-cli": [
218020
+ { path: ".gemini/GEMINI.md" },
218021
+ { path: ".gemini/settings.json", isMcpConfig: true },
218022
+ ],
218023
+ opencode: [{ path: ".opencode.json", isMcpConfig: true }],
218024
+ "qwen-code": [
218025
+ { path: ".qwen/QWEN.md" },
218026
+ { path: ".qwen/settings.json", isMcpConfig: true },
217970
218027
  ],
217971
- cline: [".clinerules/"],
217972
- "gemini-cli": [".gemini/GEMINI.md", ".gemini/settings.json"],
217973
- opencode: [".opencode.json"],
217974
- "qwen-code": [".qwen/QWEN.md", ".qwen/settings.json"],
217975
218028
  "baidu-comate": [
217976
- ".comate/rules/cloudbase-rules.mdr",
217977
- ".comate/rules/cloudbaase-rules.mdr",
217978
- ".comate/mcp.json",
218029
+ { path: ".comate/rules/cloudbase-rules.mdr" },
218030
+ { path: ".comate/rules/cloudbaase-rules.mdr" },
218031
+ { path: ".comate/mcp.json", isMcpConfig: true },
218032
+ ],
218033
+ "openai-codex-cli": [
218034
+ { path: ".codex/config.toml", isMcpConfig: true },
218035
+ { path: "AGENTS.md" },
218036
+ ],
218037
+ "augment-code": [{ path: ".augment-guidelines" }],
218038
+ "github-copilot": [{ path: ".github/copilot-instructions.md" }],
218039
+ roocode: [
218040
+ { path: ".roo/rules/cloudbaase-rules.md" },
218041
+ { path: ".roo/mcp.json", isMcpConfig: true },
218042
+ ],
218043
+ "tongyi-lingma": [{ path: ".lingma/rules/cloudbaase-rules.md" }],
218044
+ trae: [{ path: ".trae/rules/" }],
218045
+ qoder: [{ path: ".qoder/rules/" }],
218046
+ antigravity: [{ path: ".agent/rules/" }],
218047
+ vscode: [
218048
+ { path: ".vscode/mcp.json", isMcpConfig: true },
218049
+ { path: ".vscode/settings.json" },
218050
+ ],
218051
+ kiro: [
218052
+ { path: ".kiro/settings/mcp.json", isMcpConfig: true },
218053
+ { path: ".kiro/steering/" },
218054
+ ],
218055
+ aider: [{ path: "mcp.json", isMcpConfig: true }],
218056
+ "iflow-cli": [
218057
+ { path: "IFLOW.md" },
218058
+ { path: ".iflow/settings.json", isMcpConfig: true },
217979
218059
  ],
217980
- "openai-codex-cli": [".codex/config.toml", "AGENTS.md"],
217981
- "augment-code": [".augment-guidelines"],
217982
- "github-copilot": [".github/copilot-instructions.md"],
217983
- roocode: [".roo/rules/cloudbaase-rules.md", ".roo/mcp.json"],
217984
- "tongyi-lingma": [".lingma/rules/cloudbaase-rules.md"],
217985
- trae: [".trae/rules/"],
217986
- qoder: [".qoder/rules/"],
217987
- antigravity: [".agent/rules/"],
217988
- vscode: [".vscode/mcp.json", ".vscode/settings.json"],
217989
- kiro: [".kiro/settings/mcp.json", ".kiro/steering/"],
217990
218060
  };
218061
+ const IDE_FILE_MAPPINGS = structuredClone(exports.RAW_IDE_FILE_MAPPINGS);
217991
218062
  // 所有IDE配置文件的完整列表 - 通过IDE_FILE_MAPPINGS计算得出
217992
- const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS).flat()));
218063
+ const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS)
218064
+ .flat()
218065
+ .map((descriptor) => descriptor.path)));
217993
218066
  // 为"all"选项添加映射
217994
- IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES;
218067
+ IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES.map((path) => ({ path }));
217995
218068
  // IDE描述映射
217996
218069
  const IDE_DESCRIPTIONS = {
217997
218070
  all: "所有IDE配置",
@@ -218014,6 +218087,8 @@ const IDE_DESCRIPTIONS = {
218014
218087
  antigravity: "Google Antigravity AI编辑器",
218015
218088
  vscode: "Visual Studio Code",
218016
218089
  kiro: "Kiro AI编辑器",
218090
+ aider: "Aider AI编辑器",
218091
+ "iflow-cli": "iFlow CLI",
218017
218092
  };
218018
218093
  // INTEGRATION_IDE 环境变量值到 IDE 类型的映射
218019
218094
  const INTEGRATION_IDE_MAPPING = {
@@ -218038,6 +218113,7 @@ const INTEGRATION_IDE_MAPPING = {
218038
218113
  Antigravity: "antigravity",
218039
218114
  VSCode: "vscode",
218040
218115
  Kiro: "kiro",
218116
+ iFlow: "iflow-cli",
218041
218117
  };
218042
218118
  // 根据 INTEGRATION_IDE 环境变量获取默认 IDE 类型
218043
218119
  function getDefaultIDEFromEnv() {
@@ -218232,7 +218308,7 @@ function filterFilesByIDE(files, ide) {
218232
218308
  }
218233
218309
  // 阶段2: 在检查清单范围内,检查是否属于当前 IDE
218234
218310
  for (const ideFile of ideFiles) {
218235
- if (matchesPath(file, ideFile)) {
218311
+ if (matchesPath(file, ideFile.path)) {
218236
218312
  // 属于当前 IDE,保留
218237
218313
  return true;
218238
218314
  }
@@ -218266,7 +218342,7 @@ function registerSetupTools(server) {
218266
218342
  title: "下载项目模板",
218267
218343
  description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
218268
218344
 
218269
- **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)`,
218345
+ **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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.7.2" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
218270
218346
  inputSchema: {
218271
218347
  template: zod_1.z
218272
218348
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
@@ -220686,7 +220762,7 @@ function tryStat(path) {
220686
220762
  "use strict";
220687
220763
 
220688
220764
  Object.defineProperty(exports, "__esModule", ({ value: true }));
220689
- exports.envManager = exports.createCloudBaseManagerWithOptions = exports.resetCloudBaseManagerCache = exports.getEnvId = exports.getCloudBaseManager = exports.shouldRegisterTool = exports.getCloudModeStatus = exports.enableCloudMode = exports.isCloudMode = exports.logout = exports.getLoginState = exports.warn = exports.error = exports.info = exports.reportToolCall = exports.reportToolkitLifecycle = exports.telemetryReporter = exports.StdioServerTransport = exports.getDefaultServer = exports.createCloudBaseMcpServer = void 0;
220765
+ exports.RAW_IDE_FILE_MAPPINGS = exports.simplifyEnvList = exports.envManager = exports.createCloudBaseManagerWithOptions = exports.resetCloudBaseManagerCache = exports.getEnvId = exports.getCloudBaseManager = exports.shouldRegisterTool = exports.getCloudModeStatus = exports.enableCloudMode = exports.isCloudMode = exports.logout = exports.getLoginState = exports.warn = exports.error = exports.info = exports.reportToolCall = exports.reportToolkitLifecycle = exports.telemetryReporter = exports.StdioServerTransport = exports.getDefaultServer = exports.createCloudBaseMcpServer = void 0;
220690
220766
  exports.getInteractiveServerAsync = getInteractiveServerAsync;
220691
220767
  // CloudBase MCP Server Library
220692
220768
  var server_js_1 = __webpack_require__(31422);
@@ -220713,6 +220789,10 @@ Object.defineProperty(exports, "getEnvId", ({ enumerable: true, get: function ()
220713
220789
  Object.defineProperty(exports, "resetCloudBaseManagerCache", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.resetCloudBaseManagerCache; } }));
220714
220790
  Object.defineProperty(exports, "createCloudBaseManagerWithOptions", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.createCloudBaseManagerWithOptions; } }));
220715
220791
  Object.defineProperty(exports, "envManager", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.envManager; } }));
220792
+ var env_js_1 = __webpack_require__(622);
220793
+ Object.defineProperty(exports, "simplifyEnvList", ({ enumerable: true, get: function () { return env_js_1.simplifyEnvList; } }));
220794
+ var setup_js_1 = __webpack_require__(76556);
220795
+ Object.defineProperty(exports, "RAW_IDE_FILE_MAPPINGS", ({ enumerable: true, get: function () { return setup_js_1.RAW_IDE_FILE_MAPPINGS; } }));
220716
220796
  /**
220717
220797
  * Get interactive server instance (CommonJS compatible)
220718
220798
  */
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export type { UploadFileParams, ListFilesParams, DeleteFileParams, GetFileInfoPa
3
3
  export { getLoginState, logout } from "./auth.js";
4
4
  export { isCloudMode, enableCloudMode, getCloudModeStatus, shouldRegisterTool } from "./utils/cloud-mode.js";
5
5
  export { getCloudBaseManager, getEnvId, resetCloudBaseManagerCache, createCloudBaseManagerWithOptions, envManager } from "./cloudbase-manager.js";
6
+ export { simplifyEnvList } from "./tools/env.js";
7
+ export { RAW_IDE_FILE_MAPPINGS } from "./tools/setup.js";
6
8
  export type { InteractiveResult } from "./interactive-server.js";
7
9
  /**
8
10
  * Get interactive server instance (CommonJS compatible)
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_winston__ from "winston";
30
30
 
31
31
 
32
32
  Object.defineProperty(exports, "__esModule", ({ value: true }));
33
+ exports.simplifyEnvList = simplifyEnvList;
33
34
  exports.registerEnvTools = registerEnvTools;
34
35
  const zod_1 = __webpack_require__(2971);
35
36
  const auth_js_1 = __webpack_require__(7291);
@@ -37,6 +38,36 @@ const cloudbase_manager_js_1 = __webpack_require__(3431);
37
38
  const logger_js_1 = __webpack_require__(3039);
38
39
  const interactive_js_1 = __webpack_require__(3461);
39
40
  const rag_js_1 = __webpack_require__(4215);
41
+ /**
42
+ * Simplify environment list data by keeping only essential fields for AI assistant
43
+ * This reduces token consumption when returning environment lists via MCP tools
44
+ * @param envList - Full environment list from API
45
+ * @returns Simplified environment list with only essential fields
46
+ */
47
+ function simplifyEnvList(envList) {
48
+ if (!Array.isArray(envList)) {
49
+ return envList;
50
+ }
51
+ return envList.map((env) => {
52
+ // Only keep essential fields that are useful for AI assistant
53
+ const simplified = {};
54
+ if (env.EnvId !== undefined)
55
+ simplified.EnvId = env.EnvId;
56
+ if (env.Alias !== undefined)
57
+ simplified.Alias = env.Alias;
58
+ if (env.Status !== undefined)
59
+ simplified.Status = env.Status;
60
+ if (env.EnvType !== undefined)
61
+ simplified.EnvType = env.EnvType;
62
+ if (env.Region !== undefined)
63
+ simplified.Region = env.Region;
64
+ if (env.PackageName !== undefined)
65
+ simplified.PackageName = env.PackageName;
66
+ if (env.IsDefault !== undefined)
67
+ simplified.IsDefault = env.IsDefault;
68
+ return simplified;
69
+ });
70
+ }
40
71
  function registerEnvTools(server) {
41
72
  // 获取 cloudBaseOptions,如果没有则为 undefined
42
73
  const cloudBaseOptions = server.cloudBaseOptions;
@@ -236,6 +267,10 @@ function registerEnvTools(server) {
236
267
  result = await cloudbaseList.env.listEnvs();
237
268
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
238
269
  }
270
+ // Apply field simplification for MCP tool response to reduce token consumption
271
+ if (result && Array.isArray(result.EnvList)) {
272
+ result.EnvList = simplifyEnvList(result.EnvList);
273
+ }
239
274
  }
240
275
  catch (error) {
241
276
  (0, logger_js_1.debug)("获取环境列表时出错,尝试降级到 listEnvs():", error instanceof Error ? error : new Error(String(error)));
@@ -248,6 +283,10 @@ function registerEnvTools(server) {
248
283
  });
249
284
  result = await cloudbaseList.env.listEnvs();
250
285
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
286
+ // Apply field simplification for fallback response as well
287
+ if (result && Array.isArray(result.EnvList)) {
288
+ result.EnvList = simplifyEnvList(result.EnvList);
289
+ }
251
290
  }
252
291
  catch (fallbackError) {
253
292
  (0, logger_js_1.debug)("降级到 listEnvs() 也失败:", fallbackError instanceof Error ? fallbackError : new Error(String(fallbackError)));
@@ -517,7 +556,7 @@ ${envIdSection}
517
556
  ## 环境信息
518
557
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
519
558
  - Node.js版本: ${process.version}
520
- - MCP 版本:${process.env.npm_package_version || "2.6.5" || 0}
559
+ - MCP 版本:${process.env.npm_package_version || "2.7.2" || 0}
521
560
  - 系统架构: ${os_1.default.arch()}
522
561
  - 时间: ${new Date().toISOString()}
523
562
  - 请求ID: ${requestId}
@@ -8647,7 +8686,7 @@ class TelemetryReporter {
8647
8686
  const nodeVersion = process.version; // Node.js版本
8648
8687
  const arch = os_1.default.arch(); // 系统架构
8649
8688
  // 从构建时注入的版本号获取MCP版本信息
8650
- const mcpVersion = process.env.npm_package_version || "2.6.5" || 0;
8689
+ const mcpVersion = process.env.npm_package_version || "2.7.2" || 0;
8651
8690
  return {
8652
8691
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
8653
8692
  deviceId: this.deviceId,
@@ -9647,6 +9686,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9647
9686
  return (mod && mod.__esModule) ? mod : { "default": mod };
9648
9687
  };
9649
9688
  Object.defineProperty(exports, "__esModule", ({ value: true }));
9689
+ exports.RAW_IDE_FILE_MAPPINGS = void 0;
9650
9690
  exports.registerSetupTools = registerSetupTools;
9651
9691
  const adm_zip_1 = __importDefault(__webpack_require__(2872));
9652
9692
  const fs = __importStar(__webpack_require__(4421));
@@ -9701,45 +9741,78 @@ const IDE_TYPES = [
9701
9741
  "antigravity", // Google Antigravity AI编辑器
9702
9742
  "vscode", // Visual Studio Code
9703
9743
  "kiro", // Kiro AI编辑器
9744
+ "aider", // Aider AI编辑器
9745
+ "iflow-cli", // iFlow CLI
9704
9746
  ];
9705
9747
  // IDE到文件的映射关系
9706
9748
  // 注意:以 "/" 结尾的路径表示目录,会包含该目录下的所有文件
9707
- const IDE_FILE_MAPPINGS = {
9708
- cursor: [".cursor/rules/", ".cursor/mcp.json"],
9709
- windsurf: [".windsurf/rules/"],
9710
- codebuddy: [".rules/cloudbase-rules.md", "CODEBUDDY.md", ".mcp.json"],
9749
+ exports.RAW_IDE_FILE_MAPPINGS = {
9750
+ cursor: [
9751
+ { path: ".cursor/rules/" },
9752
+ { path: ".cursor/mcp.json", isMcpConfig: true },
9753
+ ],
9754
+ windsurf: [{ path: ".windsurf/rules/" }],
9755
+ codebuddy: [
9756
+ { path: ".rules/cloudbase-rules.md" },
9757
+ { path: ".codebuddy/" },
9758
+ { path: "CODEBUDDY.md" },
9759
+ { path: ".mcp.json", isMcpConfig: true },
9760
+ ],
9711
9761
  "claude-code": [
9712
- "CLAUDE.md",
9713
- ".mcp.json",
9714
- ".claude/settings.local.json",
9715
- ".claude/commands/prototype.md",
9716
- ".claude/commands/spec.md",
9717
- ".claude/commands/no_spec.md",
9762
+ { path: "CLAUDE.md" },
9763
+ { path: ".mcp.json", isMcpConfig: true },
9764
+ { path: ".claude/" },
9765
+ ],
9766
+ cline: [{ path: ".clinerules/" }],
9767
+ "gemini-cli": [
9768
+ { path: ".gemini/GEMINI.md" },
9769
+ { path: ".gemini/settings.json", isMcpConfig: true },
9770
+ ],
9771
+ opencode: [{ path: ".opencode.json", isMcpConfig: true }],
9772
+ "qwen-code": [
9773
+ { path: ".qwen/QWEN.md" },
9774
+ { path: ".qwen/settings.json", isMcpConfig: true },
9718
9775
  ],
9719
- cline: [".clinerules/"],
9720
- "gemini-cli": [".gemini/GEMINI.md", ".gemini/settings.json"],
9721
- opencode: [".opencode.json"],
9722
- "qwen-code": [".qwen/QWEN.md", ".qwen/settings.json"],
9723
9776
  "baidu-comate": [
9724
- ".comate/rules/cloudbase-rules.mdr",
9725
- ".comate/rules/cloudbaase-rules.mdr",
9726
- ".comate/mcp.json",
9777
+ { path: ".comate/rules/cloudbase-rules.mdr" },
9778
+ { path: ".comate/rules/cloudbaase-rules.mdr" },
9779
+ { path: ".comate/mcp.json", isMcpConfig: true },
9780
+ ],
9781
+ "openai-codex-cli": [
9782
+ { path: ".codex/config.toml", isMcpConfig: true },
9783
+ { path: "AGENTS.md" },
9784
+ ],
9785
+ "augment-code": [{ path: ".augment-guidelines" }],
9786
+ "github-copilot": [{ path: ".github/copilot-instructions.md" }],
9787
+ roocode: [
9788
+ { path: ".roo/rules/cloudbaase-rules.md" },
9789
+ { path: ".roo/mcp.json", isMcpConfig: true },
9790
+ ],
9791
+ "tongyi-lingma": [{ path: ".lingma/rules/cloudbaase-rules.md" }],
9792
+ trae: [{ path: ".trae/rules/" }],
9793
+ qoder: [{ path: ".qoder/rules/" }],
9794
+ antigravity: [{ path: ".agent/rules/" }],
9795
+ vscode: [
9796
+ { path: ".vscode/mcp.json", isMcpConfig: true },
9797
+ { path: ".vscode/settings.json" },
9798
+ ],
9799
+ kiro: [
9800
+ { path: ".kiro/settings/mcp.json", isMcpConfig: true },
9801
+ { path: ".kiro/steering/" },
9802
+ ],
9803
+ aider: [{ path: "mcp.json", isMcpConfig: true }],
9804
+ "iflow-cli": [
9805
+ { path: "IFLOW.md" },
9806
+ { path: ".iflow/settings.json", isMcpConfig: true },
9727
9807
  ],
9728
- "openai-codex-cli": [".codex/config.toml", "AGENTS.md"],
9729
- "augment-code": [".augment-guidelines"],
9730
- "github-copilot": [".github/copilot-instructions.md"],
9731
- roocode: [".roo/rules/cloudbaase-rules.md", ".roo/mcp.json"],
9732
- "tongyi-lingma": [".lingma/rules/cloudbaase-rules.md"],
9733
- trae: [".trae/rules/"],
9734
- qoder: [".qoder/rules/"],
9735
- antigravity: [".agent/rules/"],
9736
- vscode: [".vscode/mcp.json", ".vscode/settings.json"],
9737
- kiro: [".kiro/settings/mcp.json", ".kiro/steering/"],
9738
9808
  };
9809
+ const IDE_FILE_MAPPINGS = structuredClone(exports.RAW_IDE_FILE_MAPPINGS);
9739
9810
  // 所有IDE配置文件的完整列表 - 通过IDE_FILE_MAPPINGS计算得出
9740
- const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS).flat()));
9811
+ const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS)
9812
+ .flat()
9813
+ .map((descriptor) => descriptor.path)));
9741
9814
  // 为"all"选项添加映射
9742
- IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES;
9815
+ IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES.map((path) => ({ path }));
9743
9816
  // IDE描述映射
9744
9817
  const IDE_DESCRIPTIONS = {
9745
9818
  all: "所有IDE配置",
@@ -9762,6 +9835,8 @@ const IDE_DESCRIPTIONS = {
9762
9835
  antigravity: "Google Antigravity AI编辑器",
9763
9836
  vscode: "Visual Studio Code",
9764
9837
  kiro: "Kiro AI编辑器",
9838
+ aider: "Aider AI编辑器",
9839
+ "iflow-cli": "iFlow CLI",
9765
9840
  };
9766
9841
  // INTEGRATION_IDE 环境变量值到 IDE 类型的映射
9767
9842
  const INTEGRATION_IDE_MAPPING = {
@@ -9786,6 +9861,7 @@ const INTEGRATION_IDE_MAPPING = {
9786
9861
  Antigravity: "antigravity",
9787
9862
  VSCode: "vscode",
9788
9863
  Kiro: "kiro",
9864
+ iFlow: "iflow-cli",
9789
9865
  };
9790
9866
  // 根据 INTEGRATION_IDE 环境变量获取默认 IDE 类型
9791
9867
  function getDefaultIDEFromEnv() {
@@ -9980,7 +10056,7 @@ function filterFilesByIDE(files, ide) {
9980
10056
  }
9981
10057
  // 阶段2: 在检查清单范围内,检查是否属于当前 IDE
9982
10058
  for (const ideFile of ideFiles) {
9983
- if (matchesPath(file, ideFile)) {
10059
+ if (matchesPath(file, ideFile.path)) {
9984
10060
  // 属于当前 IDE,保留
9985
10061
  return true;
9986
10062
  }
@@ -10014,7 +10090,7 @@ function registerSetupTools(server) {
10014
10090
  title: "下载项目模板",
10015
10091
  description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
10016
10092
 
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)`,
10093
+ **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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.7.2" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
10018
10094
  inputSchema: {
10019
10095
  template: zod_1.z
10020
10096
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
@@ -13673,7 +13749,7 @@ var __webpack_exports__ = {};
13673
13749
  var exports = __webpack_exports__;
13674
13750
 
13675
13751
  Object.defineProperty(exports, "BJ", ({ value: true }));
13676
- exports.vY = exports.q8 = exports.bM = exports.fW = exports._k = exports.T$ = exports.$n = exports.S = exports.bT = exports.ri = exports.BS = exports.R8 = exports.z3 = exports.pq = exports.R4 = exports.ps = exports.v7 = exports.S7 = exports.dD = exports.Gh = void 0;
13752
+ exports.pk = exports.ZS = exports.vY = exports.q8 = exports.bM = exports.fW = exports._k = exports.T$ = exports.$n = exports.S = exports.bT = exports.ri = exports.BS = exports.R8 = exports.z3 = exports.pq = exports.R4 = exports.ps = exports.v7 = exports.S7 = exports.dD = exports.Gh = void 0;
13677
13753
  exports.SJ = getInteractiveServerAsync;
13678
13754
  // CloudBase MCP Server Library
13679
13755
  var server_js_1 = __webpack_require__(1422);
@@ -13700,6 +13776,10 @@ Object.defineProperty(exports, "fW", ({ enumerable: true, get: function () { ret
13700
13776
  Object.defineProperty(exports, "bM", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.resetCloudBaseManagerCache; } }));
13701
13777
  Object.defineProperty(exports, "q8", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.createCloudBaseManagerWithOptions; } }));
13702
13778
  Object.defineProperty(exports, "vY", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.envManager; } }));
13779
+ var env_js_1 = __webpack_require__(622);
13780
+ Object.defineProperty(exports, "ZS", ({ enumerable: true, get: function () { return env_js_1.simplifyEnvList; } }));
13781
+ var setup_js_1 = __webpack_require__(6556);
13782
+ Object.defineProperty(exports, "pk", ({ enumerable: true, get: function () { return setup_js_1.RAW_IDE_FILE_MAPPINGS; } }));
13703
13783
  /**
13704
13784
  * Get interactive server instance (CommonJS compatible)
13705
13785
  */
@@ -13712,6 +13792,7 @@ async function getInteractiveServerAsync() {
13712
13792
 
13713
13793
  })();
13714
13794
 
13795
+ const __webpack_exports__RAW_IDE_FILE_MAPPINGS = __webpack_exports__.pk;
13715
13796
  const __webpack_exports__StdioServerTransport = __webpack_exports__.S7;
13716
13797
  const __webpack_exports___esModule = __webpack_exports__.BJ;
13717
13798
  const __webpack_exports__createCloudBaseManagerWithOptions = __webpack_exports__.q8;
@@ -13732,6 +13813,7 @@ const __webpack_exports__reportToolCall = __webpack_exports__.R4;
13732
13813
  const __webpack_exports__reportToolkitLifecycle = __webpack_exports__.ps;
13733
13814
  const __webpack_exports__resetCloudBaseManagerCache = __webpack_exports__.bM;
13734
13815
  const __webpack_exports__shouldRegisterTool = __webpack_exports__.T$;
13816
+ const __webpack_exports__simplifyEnvList = __webpack_exports__.ZS;
13735
13817
  const __webpack_exports__telemetryReporter = __webpack_exports__.v7;
13736
13818
  const __webpack_exports__warn = __webpack_exports__.R8;
13737
- export { __webpack_exports__StdioServerTransport as StdioServerTransport, __webpack_exports___esModule as __esModule, __webpack_exports__createCloudBaseManagerWithOptions as createCloudBaseManagerWithOptions, __webpack_exports__createCloudBaseMcpServer as createCloudBaseMcpServer, __webpack_exports__enableCloudMode as enableCloudMode, __webpack_exports__envManager as envManager, __webpack_exports__error as error, __webpack_exports__getCloudBaseManager as getCloudBaseManager, __webpack_exports__getCloudModeStatus as getCloudModeStatus, __webpack_exports__getDefaultServer as getDefaultServer, __webpack_exports__getEnvId as getEnvId, __webpack_exports__getInteractiveServerAsync as getInteractiveServerAsync, __webpack_exports__getLoginState as getLoginState, __webpack_exports__info as info, __webpack_exports__isCloudMode as isCloudMode, __webpack_exports__logout as logout, __webpack_exports__reportToolCall as reportToolCall, __webpack_exports__reportToolkitLifecycle as reportToolkitLifecycle, __webpack_exports__resetCloudBaseManagerCache as resetCloudBaseManagerCache, __webpack_exports__shouldRegisterTool as shouldRegisterTool, __webpack_exports__telemetryReporter as telemetryReporter, __webpack_exports__warn as warn };
13819
+ export { __webpack_exports__RAW_IDE_FILE_MAPPINGS as RAW_IDE_FILE_MAPPINGS, __webpack_exports__StdioServerTransport as StdioServerTransport, __webpack_exports___esModule as __esModule, __webpack_exports__createCloudBaseManagerWithOptions as createCloudBaseManagerWithOptions, __webpack_exports__createCloudBaseMcpServer as createCloudBaseMcpServer, __webpack_exports__enableCloudMode as enableCloudMode, __webpack_exports__envManager as envManager, __webpack_exports__error as error, __webpack_exports__getCloudBaseManager as getCloudBaseManager, __webpack_exports__getCloudModeStatus as getCloudModeStatus, __webpack_exports__getDefaultServer as getDefaultServer, __webpack_exports__getEnvId as getEnvId, __webpack_exports__getInteractiveServerAsync as getInteractiveServerAsync, __webpack_exports__getLoginState as getLoginState, __webpack_exports__info as info, __webpack_exports__isCloudMode as isCloudMode, __webpack_exports__logout as logout, __webpack_exports__reportToolCall as reportToolCall, __webpack_exports__reportToolkitLifecycle as reportToolkitLifecycle, __webpack_exports__resetCloudBaseManagerCache as resetCloudBaseManagerCache, __webpack_exports__shouldRegisterTool as shouldRegisterTool, __webpack_exports__simplifyEnvList as simplifyEnvList, __webpack_exports__telemetryReporter as telemetryReporter, __webpack_exports__warn as warn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cloudbase-mcp",
3
- "version": "2.6.5",
3
+ "version": "2.7.2",
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",
@@ -27,6 +27,10 @@
27
27
  "url": "https://github.com/TencentCloudBase/CloudBase-AI-ToolKit/issues",
28
28
  "email": "bookerzhao@tencent.com"
29
29
  },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/TencentCloudBase/CloudBase-AI-ToolKit.git"
33
+ },
30
34
  "scripts": {
31
35
  "clean": "rm -rf dist",
32
36
  "prebuild": "npm run clean",