@cloudbase/cloudbase-mcp 2.2.0 → 2.3.1

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
@@ -2525,7 +2525,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2525
2525
  return (mod && mod.__esModule) ? mod : { "default": mod };
2526
2526
  };
2527
2527
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2528
- exports.downloadWebTemplate = downloadWebTemplate;
2529
2528
  exports.getClaudePrompt = getClaudePrompt;
2530
2529
  exports.registerRagTools = registerRagTools;
2531
2530
  const adm_zip_1 = __importDefault(__webpack_require__(872));
@@ -2543,6 +2542,58 @@ const KnowledgeBaseIdMap = {
2543
2542
  scf: "scfsczskzyws_4bdc",
2544
2543
  miniprogram: "xcxzskws_25d8",
2545
2544
  };
2545
+ // ============ 缓存配置 ============
2546
+ const CACHE_BASE_DIR = path.join(os.homedir(), ".cloudbase-mcp");
2547
+ const CACHE_META_FILE = path.join(CACHE_BASE_DIR, "cache-meta.json");
2548
+ const DEFAULT_CACHE_TTL_MS = 24 * 60 * 60 * 1000; // 默认 24 小时
2549
+ // 支持环境变量 CLOUDBASE_MCP_CACHE_TTL_MS 控制缓存过期时间(毫秒)
2550
+ const parsedCacheTTL = process.env.CLOUDBASE_MCP_CACHE_TTL_MS
2551
+ ? parseInt(process.env.CLOUDBASE_MCP_CACHE_TTL_MS, 10)
2552
+ : NaN;
2553
+ const CACHE_TTL_MS = Number.isNaN(parsedCacheTTL) || parsedCacheTTL < 0
2554
+ ? DEFAULT_CACHE_TTL_MS
2555
+ : parsedCacheTTL;
2556
+ if (!Number.isNaN(parsedCacheTTL) && parsedCacheTTL >= 0) {
2557
+ (0, logger_js_1.debug)("[cache] Using TTL from CLOUDBASE_MCP_CACHE_TTL_MS", {
2558
+ ttlMs: CACHE_TTL_MS,
2559
+ });
2560
+ }
2561
+ else {
2562
+ (0, logger_js_1.debug)("[cache] Using default TTL", { ttlMs: CACHE_TTL_MS });
2563
+ }
2564
+ // 共享的下载 Promise,防止并发重复下载
2565
+ let resourceDownloadPromise = null;
2566
+ // 检查缓存是否可用(未过期)
2567
+ async function canUseCache() {
2568
+ try {
2569
+ const content = await fs.readFile(CACHE_META_FILE, "utf8");
2570
+ const meta = JSON.parse(content);
2571
+ if (!meta.timestamp) {
2572
+ (0, logger_js_1.debug)("[cache] cache-meta missing timestamp, treating as invalid", {
2573
+ ttlMs: CACHE_TTL_MS,
2574
+ });
2575
+ return false;
2576
+ }
2577
+ const ageMs = Date.now() - meta.timestamp;
2578
+ const isValid = ageMs <= CACHE_TTL_MS;
2579
+ (0, logger_js_1.debug)("[cache] evaluated cache meta", {
2580
+ timestamp: meta.timestamp,
2581
+ ageMs,
2582
+ ttlMs: CACHE_TTL_MS,
2583
+ valid: isValid,
2584
+ });
2585
+ return isValid;
2586
+ }
2587
+ catch (error) {
2588
+ (0, logger_js_1.debug)("[cache] failed to read cache meta, treating as miss", { error });
2589
+ return false;
2590
+ }
2591
+ }
2592
+ // 更新缓存时间戳
2593
+ async function updateCache() {
2594
+ await fs.mkdir(CACHE_BASE_DIR, { recursive: true });
2595
+ await fs.writeFile(CACHE_META_FILE, JSON.stringify({ timestamp: Date.now() }, null, 2), "utf8");
2596
+ }
2546
2597
  // 安全 JSON.parse
2547
2598
  function safeParse(str) {
2548
2599
  try {
@@ -2569,31 +2620,141 @@ function safeStringify(obj) {
2569
2620
  return "";
2570
2621
  }
2571
2622
  }
2572
- // Download and extract web template, return extract directory path
2573
- // Always downloads and overwrites existing template
2623
+ // OpenAPI 文档 URL 列表
2624
+ const OPENAPI_SOURCES = [
2625
+ {
2626
+ name: "mysqldb",
2627
+ description: "MySQL RESTful API - 云开发 MySQL 数据库 HTTP API",
2628
+ url: "https://docs.cloudbase.net/openapi/mysqldb.v1.openapi.yaml",
2629
+ },
2630
+ {
2631
+ name: "functions",
2632
+ description: "Cloud Functions API - 云函数 HTTP API",
2633
+ url: "https://docs.cloudbase.net/openapi/functions.v1.openapi.yaml",
2634
+ },
2635
+ {
2636
+ name: "auth",
2637
+ description: "Authentication API - 身份认证 HTTP API",
2638
+ url: "https://docs.cloudbase.net/openapi/auth.v1.openapi.yaml",
2639
+ },
2640
+ {
2641
+ name: "cloudrun",
2642
+ description: "CloudRun API - 云托管服务 HTTP API",
2643
+ url: "https://docs.cloudbase.net/openapi/cloudrun.v1.openapi.yaml",
2644
+ },
2645
+ {
2646
+ name: "storage",
2647
+ description: "Storage API - 云存储 HTTP API",
2648
+ url: "https://docs.cloudbase.net/openapi/storage.v1.openapi.yaml",
2649
+ },
2650
+ ];
2574
2651
  async function downloadWebTemplate() {
2575
- const baseDir = path.join(os.homedir(), ".cloudbase-mcp");
2576
- const zipPath = path.join(baseDir, "web-cloudbase-project.zip");
2577
- const extractDir = path.join(baseDir, "web-template");
2652
+ const zipPath = path.join(CACHE_BASE_DIR, "web-cloudbase-project.zip");
2653
+ const extractDir = path.join(CACHE_BASE_DIR, "web-template");
2578
2654
  const url = "https://static.cloudbase.net/cloudbase-examples/web-cloudbase-project.zip";
2579
- await fs.mkdir(baseDir, { recursive: true });
2580
- // Download zip to specified path (overwrite)
2581
2655
  const response = await fetch(url);
2582
2656
  if (!response.ok) {
2583
2657
  throw new Error(`下载模板失败,状态码: ${response.status}`);
2584
2658
  }
2585
2659
  const buffer = Buffer.from(await response.arrayBuffer());
2586
2660
  await fs.writeFile(zipPath, buffer);
2587
- // Clean and recreate extract directory
2588
2661
  await fs.rm(extractDir, { recursive: true, force: true });
2589
2662
  await fs.mkdir(extractDir, { recursive: true });
2590
2663
  const zip = new adm_zip_1.default(zipPath);
2591
2664
  zip.extractAllTo(extractDir, true);
2665
+ (0, logger_js_1.debug)("[downloadResources] webTemplate 下载完成");
2592
2666
  return extractDir;
2593
2667
  }
2594
- async function prepareKnowledgeBaseWebTemplate() {
2595
- const extractDir = await downloadWebTemplate();
2596
- return collectSkillDescriptions(path.join(extractDir, ".claude", "skills"));
2668
+ async function downloadOpenAPI() {
2669
+ const baseDir = path.join(CACHE_BASE_DIR, "openapi");
2670
+ await fs.mkdir(baseDir, { recursive: true });
2671
+ const results = [];
2672
+ await Promise.all(OPENAPI_SOURCES.map(async (source) => {
2673
+ try {
2674
+ const response = await fetch(source.url);
2675
+ if (!response.ok) {
2676
+ (0, logger_js_1.warn)(`[downloadOpenAPI] Failed to download ${source.name}`, {
2677
+ status: response.status,
2678
+ });
2679
+ return;
2680
+ }
2681
+ const content = await response.text();
2682
+ const filePath = path.join(baseDir, `${source.name}.openapi.yaml`);
2683
+ await fs.writeFile(filePath, content, "utf8");
2684
+ results.push({
2685
+ name: source.name,
2686
+ description: source.description,
2687
+ absolutePath: filePath,
2688
+ });
2689
+ }
2690
+ catch (error) {
2691
+ (0, logger_js_1.warn)(`[downloadOpenAPI] Failed to download ${source.name}`, {
2692
+ error,
2693
+ });
2694
+ }
2695
+ }));
2696
+ (0, logger_js_1.debug)("[downloadOpenAPI] openAPIDocs 下载完成", {
2697
+ successCount: results.length,
2698
+ total: OPENAPI_SOURCES.length,
2699
+ });
2700
+ return results;
2701
+ }
2702
+ // 实际执行下载所有资源的函数(webTemplate 和 openAPI 并发下载)
2703
+ async function _doDownloadResources() {
2704
+ // 并发下载 webTemplate 和 openAPIDocs
2705
+ const [webTemplateDir, openAPIDocs] = await Promise.all([
2706
+ // 下载 web 模板
2707
+ downloadWebTemplate(),
2708
+ // 并发下载所有 OpenAPI 文档
2709
+ downloadOpenAPI(),
2710
+ ]);
2711
+ (0, logger_js_1.debug)("[downloadResources] 所有资源下载完成");
2712
+ return { webTemplateDir, openAPIDocs };
2713
+ }
2714
+ // 下载所有资源(带缓存和共享 Promise 机制)
2715
+ async function downloadResources() {
2716
+ const webTemplateDir = path.join(CACHE_BASE_DIR, "web-template");
2717
+ const openAPIDir = path.join(CACHE_BASE_DIR, "openapi");
2718
+ // 检查缓存是否有效
2719
+ if (await canUseCache()) {
2720
+ try {
2721
+ // 检查两个目录都存在
2722
+ await Promise.all([fs.access(webTemplateDir), fs.access(openAPIDir)]);
2723
+ const files = await fs.readdir(openAPIDir);
2724
+ if (files.length > 0) {
2725
+ (0, logger_js_1.debug)("[downloadResources] 使用缓存");
2726
+ return {
2727
+ webTemplateDir,
2728
+ openAPIDocs: OPENAPI_SOURCES.map((source) => ({
2729
+ name: source.name,
2730
+ description: source.description,
2731
+ absolutePath: path.join(openAPIDir, `${source.name}.openapi.yaml`),
2732
+ })).filter((item) => files.includes(`${item.name}.openapi.yaml`)),
2733
+ };
2734
+ }
2735
+ }
2736
+ catch {
2737
+ // 缓存无效,需要重新下载
2738
+ }
2739
+ }
2740
+ // 如果已有下载任务在进行中,共享该 Promise
2741
+ if (resourceDownloadPromise) {
2742
+ (0, logger_js_1.debug)("[downloadResources] 共享已有下载任务");
2743
+ return resourceDownloadPromise;
2744
+ }
2745
+ // 创建新的下载任务
2746
+ (0, logger_js_1.debug)("[downloadResources] 开始新下载任务");
2747
+ await fs.mkdir(CACHE_BASE_DIR, { recursive: true });
2748
+ resourceDownloadPromise = _doDownloadResources()
2749
+ .then(async (result) => {
2750
+ await updateCache();
2751
+ (0, logger_js_1.debug)("[downloadResources] 缓存已更新");
2752
+ return result;
2753
+ })
2754
+ .finally(() => {
2755
+ resourceDownloadPromise = null;
2756
+ });
2757
+ return resourceDownloadPromise;
2597
2758
  }
2598
2759
  // Get CLAUDE.md prompt content
2599
2760
  // Priority: 1. From downloaded template, 2. Fallback to embedded constant
@@ -2717,23 +2878,15 @@ async function registerRagTools(server) {
2717
2878
  };
2718
2879
  }
2719
2880
  });
2720
- let skills = [];
2721
2881
  let openapis = [];
2722
- // 知识库检索
2723
- try {
2724
- skills = await prepareKnowledgeBaseWebTemplate();
2725
- }
2726
- catch (error) {
2727
- (0, logger_js_1.warn)("[searchKnowledgeBase] Failed to prepare web template", {
2728
- error,
2729
- });
2730
- }
2731
- // OpenAPI 文档准备
2882
+ let skills = [];
2732
2883
  try {
2733
- openapis = await prepareOpenAPIDocs();
2884
+ const { webTemplateDir, openAPIDocs } = await downloadResources();
2885
+ openapis = openAPIDocs;
2886
+ skills = await collectSkillDescriptions(path.join(webTemplateDir, ".claude", "skills"));
2734
2887
  }
2735
2888
  catch (error) {
2736
- (0, logger_js_1.warn)("[searchKnowledgeBase] Failed to prepare OpenAPI docs", {
2889
+ (0, logger_js_1.warn)("[downloadResources] Failed to download resources", {
2737
2890
  error,
2738
2891
  });
2739
2892
  }
@@ -2900,65 +3053,6 @@ function extractDescriptionFromFrontMatter(content) {
2900
3053
  .match(/^(?:decsription|description)\s*:\s*(.*)$/m);
2901
3054
  return match ? match[1].trim() : null;
2902
3055
  }
2903
- // OpenAPI 文档 URL 列表
2904
- const OPENAPI_SOURCES = [
2905
- {
2906
- name: "mysqldb",
2907
- description: "MySQL RESTful API - 云开发 MySQL 数据库 HTTP API",
2908
- url: "https://docs.cloudbase.net/openapi/mysqldb.v1.openapi.yaml",
2909
- },
2910
- {
2911
- name: "functions",
2912
- description: "Cloud Functions API - 云函数 HTTP API",
2913
- url: "https://docs.cloudbase.net/openapi/functions.v1.openapi.yaml",
2914
- },
2915
- {
2916
- name: "auth",
2917
- description: "Authentication API - 身份认证 HTTP API",
2918
- url: "https://docs.cloudbase.net/openapi/auth.v1.openapi.yaml",
2919
- },
2920
- {
2921
- name: "cloudrun",
2922
- description: "CloudRun API - 云托管服务 HTTP API",
2923
- url: "https://docs.cloudbase.net/openapi/cloudrun.v1.openapi.yaml",
2924
- },
2925
- {
2926
- name: "storage",
2927
- description: "Storage API - 云存储 HTTP API",
2928
- url: "https://docs.cloudbase.net/openapi/storage.v1.openapi.yaml",
2929
- },
2930
- ];
2931
- // 下载并准备 OpenAPI 文档
2932
- async function prepareOpenAPIDocs() {
2933
- const baseDir = path.join(os.homedir(), ".cloudbase-mcp", "openapi");
2934
- await fs.mkdir(baseDir, { recursive: true });
2935
- const results = [];
2936
- await Promise.all(OPENAPI_SOURCES.map(async (source) => {
2937
- try {
2938
- const response = await fetch(source.url);
2939
- if (!response.ok) {
2940
- (0, logger_js_1.warn)(`[prepareOpenAPIDocs] Failed to download ${source.name}`, {
2941
- status: response.status,
2942
- });
2943
- return;
2944
- }
2945
- const content = await response.text();
2946
- const filePath = path.join(baseDir, `${source.name}.openapi.yaml`);
2947
- await fs.writeFile(filePath, content, "utf8");
2948
- results.push({
2949
- name: source.name,
2950
- description: source.description,
2951
- absolutePath: filePath,
2952
- });
2953
- }
2954
- catch (error) {
2955
- (0, logger_js_1.warn)(`[prepareOpenAPIDocs] Failed to download ${source.name}`, {
2956
- error,
2957
- });
2958
- }
2959
- }));
2960
- return results;
2961
- }
2962
3056
  async function collectSkillDescriptions(rootDir) {
2963
3057
  const result = [];
2964
3058
  async function walk(dir) {
@@ -6224,7 +6318,7 @@ ${envIdSection}
6224
6318
  ## 环境信息
6225
6319
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
6226
6320
  - Node.js版本: ${process.version}
6227
- - MCP 版本:${process.env.npm_package_version || "2.2.0" || 0}
6321
+ - MCP 版本:${process.env.npm_package_version || "2.3.1" || 0}
6228
6322
  - 系统架构: ${os_1.default.arch()}
6229
6323
  - 时间: ${new Date().toISOString()}
6230
6324
  - 请求ID: ${requestId}
@@ -7164,12 +7258,15 @@ const IDE_TYPES = [
7164
7258
  "roocode", // RooCode AI编辑器
7165
7259
  "tongyi-lingma", // 通义灵码
7166
7260
  "trae", // Trae AI编辑器
7261
+ "qoder", // Qoder AI编辑器
7262
+ "antigravity", // Google Antigravity AI编辑器
7167
7263
  "vscode", // Visual Studio Code
7168
7264
  ];
7169
7265
  // IDE到文件的映射关系
7266
+ // 注意:以 "/" 结尾的路径表示目录,会包含该目录下的所有文件
7170
7267
  const IDE_FILE_MAPPINGS = {
7171
- cursor: [".cursor/rules/cloudbase-rules.mdc", ".cursor/mcp.json"],
7172
- windsurf: [".windsurf/rules/cloudbase-rules.md"],
7268
+ cursor: [".cursor/rules/", ".cursor/mcp.json"],
7269
+ windsurf: [".windsurf/rules/"],
7173
7270
  codebuddy: [".rules/cloudbase-rules.md", "CODEBUDDY.md", ".mcp.json"],
7174
7271
  "claude-code": [
7175
7272
  "CLAUDE.md",
@@ -7179,7 +7276,7 @@ const IDE_FILE_MAPPINGS = {
7179
7276
  ".claude/commands/spec.md",
7180
7277
  ".claude/commands/no_spec.md",
7181
7278
  ],
7182
- cline: [".clinerules/cloudbase-rules.mdc"],
7279
+ cline: [".clinerules/"],
7183
7280
  "gemini-cli": [".gemini/GEMINI.md", ".gemini/settings.json"],
7184
7281
  opencode: [".opencode.json"],
7185
7282
  "qwen-code": [".qwen/QWEN.md", ".qwen/settings.json"],
@@ -7193,7 +7290,9 @@ const IDE_FILE_MAPPINGS = {
7193
7290
  "github-copilot": [".github/copilot-instructions.md"],
7194
7291
  roocode: [".roo/rules/cloudbaase-rules.md", ".roo/mcp.json"],
7195
7292
  "tongyi-lingma": [".lingma/rules/cloudbaase-rules.md"],
7196
- trae: [".trae/rules/cloudbase-rules.md"],
7293
+ trae: [".trae/rules/"],
7294
+ qoder: [".qoder/rules/"],
7295
+ antigravity: [".agent/rules/"],
7197
7296
  vscode: [".vscode/mcp.json", ".vscode/settings.json"],
7198
7297
  };
7199
7298
  // 所有IDE配置文件的完整列表 - 通过IDE_FILE_MAPPINGS计算得出
@@ -7218,6 +7317,8 @@ const IDE_DESCRIPTIONS = {
7218
7317
  roocode: "RooCode AI编辑器",
7219
7318
  "tongyi-lingma": "通义灵码",
7220
7319
  trae: "Trae AI编辑器",
7320
+ qoder: "Qoder AI编辑器",
7321
+ antigravity: "Google Antigravity AI编辑器",
7221
7322
  vscode: "Visual Studio Code",
7222
7323
  };
7223
7324
  // INTEGRATION_IDE 环境变量值到 IDE 类型的映射
@@ -7239,6 +7340,8 @@ const INTEGRATION_IDE_MAPPING = {
7239
7340
  RooCode: "roocode",
7240
7341
  "Tongyi Lingma": "tongyi-lingma",
7241
7342
  Trae: "trae",
7343
+ Qoder: "qoder",
7344
+ Antigravity: "antigravity",
7242
7345
  VSCode: "vscode",
7243
7346
  };
7244
7347
  // 根据 INTEGRATION_IDE 环境变量获取默认 IDE 类型
@@ -7389,6 +7492,17 @@ function validateIDE(ide) {
7389
7492
  }
7390
7493
  return { valid: true };
7391
7494
  }
7495
+ // 检查文件是否匹配给定的路径(支持文件和目录)
7496
+ function matchesPath(file, pathPattern) {
7497
+ if (pathPattern.endsWith("/")) {
7498
+ // 目录路径:检查文件是否在该目录下
7499
+ return file.startsWith(pathPattern);
7500
+ }
7501
+ else {
7502
+ // 文件路径:精确匹配
7503
+ return file === pathPattern;
7504
+ }
7505
+ }
7392
7506
  // 文件过滤函数
7393
7507
  function filterFilesByIDE(files, ide) {
7394
7508
  if (ide === "all") {
@@ -7399,9 +7513,32 @@ function filterFilesByIDE(files, ide) {
7399
7513
  return files; // 如果找不到映射,返回所有文件
7400
7514
  }
7401
7515
  // 计算需要排除的IDE文件(除了当前IDE需要的文件)
7402
- const filesToExclude = ALL_IDE_FILES.filter((file) => !ideFiles.includes(file));
7516
+ const filesToExclude = [];
7517
+ // 遍历所有IDE文件,找出不属于当前IDE的文件
7518
+ for (const ideFile of ALL_IDE_FILES) {
7519
+ // 检查这个文件是否属于当前IDE需要的文件
7520
+ let isCurrentIDEFile = false;
7521
+ for (const currentIDEFile of ideFiles) {
7522
+ if (matchesPath(ideFile, currentIDEFile)) {
7523
+ isCurrentIDEFile = true;
7524
+ break;
7525
+ }
7526
+ }
7527
+ // 如果不属于当前IDE,加入排除列表
7528
+ if (!isCurrentIDEFile) {
7529
+ filesToExclude.push(ideFile);
7530
+ }
7531
+ }
7403
7532
  // 排除不需要的IDE配置文件,保留其他所有文件
7404
- return files.filter((file) => !filesToExclude.includes(file));
7533
+ return files.filter((file) => {
7534
+ // 检查文件是否应该被排除
7535
+ for (const excludePath of filesToExclude) {
7536
+ if (matchesPath(file, excludePath)) {
7537
+ return false; // 排除
7538
+ }
7539
+ }
7540
+ return true; // 保留
7541
+ });
7405
7542
  }
7406
7543
  // 创建过滤后的目录结构
7407
7544
  async function createFilteredDirectory(extractDir, filteredFiles, ide) {
@@ -7428,7 +7565,7 @@ function registerSetupTools(server) {
7428
7565
  title: "下载项目模板",
7429
7566
  description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
7430
7567
 
7431
- **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- vscode: Visual Studio Code\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.2.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
7568
+ **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.3.1" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
7432
7569
  inputSchema: {
7433
7570
  template: zod_1.z
7434
7571
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
@@ -8526,7 +8663,7 @@ class TelemetryReporter {
8526
8663
  const nodeVersion = process.version; // Node.js版本
8527
8664
  const arch = os_1.default.arch(); // 系统架构
8528
8665
  // 从构建时注入的版本号获取MCP版本信息
8529
- const mcpVersion = process.env.npm_package_version || "2.2.0" || 0;
8666
+ const mcpVersion = process.env.npm_package_version || "2.3.1" || 0;
8530
8667
  return {
8531
8668
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
8532
8669
  deviceId: this.deviceId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cloudbase-mcp",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
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",