@cloudbase/cloudbase-mcp 2.15.3 → 2.15.4

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
@@ -130743,7 +130743,7 @@ class TelemetryReporter {
130743
130743
  const nodeVersion = process.version; // Node.js版本
130744
130744
  const arch = os_1.default.arch(); // 系统架构
130745
130745
  // 从构建时注入的版本号获取MCP版本信息
130746
- const mcpVersion = process.env.npm_package_version || "2.15.3" || 0;
130746
+ const mcpVersion = process.env.npm_package_version || "2.15.4" || 0;
130747
130747
  return {
130748
130748
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
130749
130749
  deviceId: this.deviceId,
@@ -187484,7 +187484,7 @@ ${envIdSection}
187484
187484
  ## 环境信息
187485
187485
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
187486
187486
  - Node.js版本: ${process.version}
187487
- - MCP 版本:${process.env.npm_package_version || "2.15.3" || 0}
187487
+ - MCP 版本:${process.env.npm_package_version || "2.15.4" || 0}
187488
187488
  - 系统架构: ${os_1.default.arch()}
187489
187489
  - 时间: ${new Date().toISOString()}
187490
187490
  - 请求ID: ${requestId}
@@ -194840,6 +194840,53 @@ function normalizeNoSqlDocuments(data) {
194840
194840
  }
194841
194841
  return data.map((item) => parseNoSqlDocument(item));
194842
194842
  }
194843
+ function normalizeSortDirection(value) {
194844
+ if (value === 1) {
194845
+ return 1;
194846
+ }
194847
+ if (value === -1) {
194848
+ return -1;
194849
+ }
194850
+ throw new Error(`非法 sort direction: ${String(value)},仅支持 1 / -1`);
194851
+ }
194852
+ function normalizeSortItem(value) {
194853
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
194854
+ throw new Error("sort 数组项必须是 { key, direction } 对象");
194855
+ }
194856
+ const { key, direction } = value;
194857
+ if (typeof key !== "string" || key.trim() === "") {
194858
+ throw new Error("sort.key 必须是非空字符串");
194859
+ }
194860
+ return {
194861
+ key,
194862
+ direction: normalizeSortDirection(direction),
194863
+ };
194864
+ }
194865
+ function normalizeSortInput(sort) {
194866
+ if (sort === undefined || sort === null) {
194867
+ return undefined;
194868
+ }
194869
+ let parsed = sort;
194870
+ if (typeof parsed === "string") {
194871
+ const trimmed = parsed.trim();
194872
+ if (!trimmed) {
194873
+ return undefined;
194874
+ }
194875
+ try {
194876
+ parsed = JSON.parse(trimmed);
194877
+ }
194878
+ catch {
194879
+ throw new Error("sort 必须是 sort 数组的 JSON 字符串");
194880
+ }
194881
+ }
194882
+ if (!Array.isArray(parsed)) {
194883
+ throw new Error('sort 仅支持数组 [{"key":"createdAt","direction":-1}] 或对应 JSON 字符串');
194884
+ }
194885
+ if (parsed.length === 0) {
194886
+ return undefined;
194887
+ }
194888
+ return JSON.stringify(parsed.map((item) => normalizeSortItem(item)));
194889
+ }
194843
194890
  function withCollectionName(collectionName, payload) {
194844
194891
  return {
194845
194892
  ...payload,
@@ -195184,7 +195231,7 @@ deleteCollection: 删除集合`),
195184
195231
  zod_1.z.string(),
195185
195232
  ])
195186
195233
  .optional()
195187
- .describe("排序条件,使用对象或字符串。"),
195234
+ .describe('排序条件,仅支持数组 [{"key":"createdAt","direction":-1}] 或对应 JSON 字符串。'),
195188
195235
  limit: zod_1.z.number().optional().describe("返回数量限制"),
195189
195236
  offset: zod_1.z.number().optional().describe("跳过的记录数"),
195190
195237
  },
@@ -195197,13 +195244,14 @@ deleteCollection: 删除集合`),
195197
195244
  const cloudbase = await getManager();
195198
195245
  const instanceId = await getDatabaseInstanceId(getManager);
195199
195246
  const toJSONString = (v) => typeof v === "object" && v !== null ? JSON.stringify(v) : v;
195247
+ const normalizedSort = normalizeSortInput(sort);
195200
195248
  const result = await cloudbase.commonService("tcb", "2018-06-08").call({
195201
195249
  Action: "QueryRecords",
195202
195250
  Param: {
195203
195251
  TableName: collectionName,
195204
195252
  MgoQuery: toJSONString(query),
195205
195253
  MgoProjection: toJSONString(projection),
195206
- MgoSort: toJSONString(sort),
195254
+ MgoSort: normalizedSort,
195207
195255
  MgoLimit: limit ?? 100,
195208
195256
  MgoOffset: offset,
195209
195257
  Tag: instanceId,
@@ -200544,7 +200592,7 @@ function registerSetupTools(server) {
200544
200592
  title: "下载项目模板",
200545
200593
  description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
200546
200594
 
200547
- **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- 其他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.15.3" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
200595
+ **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- 其他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.15.4" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
200548
200596
  inputSchema: {
200549
200597
  template: zod_1.z
200550
200598
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
package/dist/index.js CHANGED
@@ -1426,7 +1426,7 @@ ${envIdSection}
1426
1426
  ## 环境信息
1427
1427
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
1428
1428
  - Node.js版本: ${process.version}
1429
- - MCP 版本:${process.env.npm_package_version || "2.15.3" || 0}
1429
+ - MCP 版本:${process.env.npm_package_version || "2.15.4" || 0}
1430
1430
  - 系统架构: ${os_1.default.arch()}
1431
1431
  - 时间: ${new Date().toISOString()}
1432
1432
  - 请求ID: ${requestId}
@@ -3359,6 +3359,53 @@ function normalizeNoSqlDocuments(data) {
3359
3359
  }
3360
3360
  return data.map((item) => parseNoSqlDocument(item));
3361
3361
  }
3362
+ function normalizeSortDirection(value) {
3363
+ if (value === 1) {
3364
+ return 1;
3365
+ }
3366
+ if (value === -1) {
3367
+ return -1;
3368
+ }
3369
+ throw new Error(`非法 sort direction: ${String(value)},仅支持 1 / -1`);
3370
+ }
3371
+ function normalizeSortItem(value) {
3372
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
3373
+ throw new Error("sort 数组项必须是 { key, direction } 对象");
3374
+ }
3375
+ const { key, direction } = value;
3376
+ if (typeof key !== "string" || key.trim() === "") {
3377
+ throw new Error("sort.key 必须是非空字符串");
3378
+ }
3379
+ return {
3380
+ key,
3381
+ direction: normalizeSortDirection(direction),
3382
+ };
3383
+ }
3384
+ function normalizeSortInput(sort) {
3385
+ if (sort === undefined || sort === null) {
3386
+ return undefined;
3387
+ }
3388
+ let parsed = sort;
3389
+ if (typeof parsed === "string") {
3390
+ const trimmed = parsed.trim();
3391
+ if (!trimmed) {
3392
+ return undefined;
3393
+ }
3394
+ try {
3395
+ parsed = JSON.parse(trimmed);
3396
+ }
3397
+ catch {
3398
+ throw new Error("sort 必须是 sort 数组的 JSON 字符串");
3399
+ }
3400
+ }
3401
+ if (!Array.isArray(parsed)) {
3402
+ throw new Error('sort 仅支持数组 [{"key":"createdAt","direction":-1}] 或对应 JSON 字符串');
3403
+ }
3404
+ if (parsed.length === 0) {
3405
+ return undefined;
3406
+ }
3407
+ return JSON.stringify(parsed.map((item) => normalizeSortItem(item)));
3408
+ }
3362
3409
  function withCollectionName(collectionName, payload) {
3363
3410
  return {
3364
3411
  ...payload,
@@ -3703,7 +3750,7 @@ deleteCollection: 删除集合`),
3703
3750
  zod_1.z.string(),
3704
3751
  ])
3705
3752
  .optional()
3706
- .describe("排序条件,使用对象或字符串。"),
3753
+ .describe('排序条件,仅支持数组 [{"key":"createdAt","direction":-1}] 或对应 JSON 字符串。'),
3707
3754
  limit: zod_1.z.number().optional().describe("返回数量限制"),
3708
3755
  offset: zod_1.z.number().optional().describe("跳过的记录数"),
3709
3756
  },
@@ -3716,13 +3763,14 @@ deleteCollection: 删除集合`),
3716
3763
  const cloudbase = await getManager();
3717
3764
  const instanceId = await getDatabaseInstanceId(getManager);
3718
3765
  const toJSONString = (v) => typeof v === "object" && v !== null ? JSON.stringify(v) : v;
3766
+ const normalizedSort = normalizeSortInput(sort);
3719
3767
  const result = await cloudbase.commonService("tcb", "2018-06-08").call({
3720
3768
  Action: "QueryRecords",
3721
3769
  Param: {
3722
3770
  TableName: collectionName,
3723
3771
  MgoQuery: toJSONString(query),
3724
3772
  MgoProjection: toJSONString(projection),
3725
- MgoSort: toJSONString(sort),
3773
+ MgoSort: normalizedSort,
3726
3774
  MgoLimit: limit ?? 100,
3727
3775
  MgoOffset: offset,
3728
3776
  Tag: instanceId,
@@ -7082,7 +7130,7 @@ class TelemetryReporter {
7082
7130
  const nodeVersion = process.version; // Node.js版本
7083
7131
  const arch = os_1.default.arch(); // 系统架构
7084
7132
  // 从构建时注入的版本号获取MCP版本信息
7085
- const mcpVersion = process.env.npm_package_version || "2.15.3" || 0;
7133
+ const mcpVersion = process.env.npm_package_version || "2.15.4" || 0;
7086
7134
  return {
7087
7135
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
7088
7136
  deviceId: this.deviceId,
@@ -8914,7 +8962,7 @@ function registerSetupTools(server) {
8914
8962
  title: "下载项目模板",
8915
8963
  description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
8916
8964
 
8917
- **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- 其他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.15.3" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
8965
+ **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- 其他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.15.4" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
8918
8966
  inputSchema: {
8919
8967
  template: zod_1.z
8920
8968
  .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.15.3",
3
+ "version": "2.15.4",
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",