@cloudbase/cloudbase-mcp 2.6.4 → 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/cli.cjs +1 -1
- package/dist/index.cjs +48 -28
- package/dist/index.js +47 -27
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -89292,7 +89292,21 @@ function registerFunctionTools(server) {
|
|
|
89292
89292
|
// }
|
|
89293
89293
|
// 使用闭包中的 cloudBaseOptions
|
|
89294
89294
|
const cloudbase = await getManager();
|
|
89295
|
-
const
|
|
89295
|
+
const functionDetail = await cloudbase.functions.getFunctionDetail(funcParam.name);
|
|
89296
|
+
functionDetail.Environment;
|
|
89297
|
+
const vpc = (typeof functionDetail.VpcConfig === 'object' && functionDetail.VpcConfig !== null && functionDetail.VpcConfig.SubnetId && functionDetail.VpcConfig.VpcId) ? {
|
|
89298
|
+
subnetId: functionDetail.VpcConfig.SubnetId,
|
|
89299
|
+
vpcId: functionDetail.VpcConfig.VpcId
|
|
89300
|
+
} : undefined;
|
|
89301
|
+
const result = await cloudbase.functions.updateFunctionConfig({
|
|
89302
|
+
name: funcParam.name,
|
|
89303
|
+
envVariables: Object.assign({}, functionDetail.Environment.Variables.reduce((acc, curr) => {
|
|
89304
|
+
acc[curr.Key] = curr.Value;
|
|
89305
|
+
return acc;
|
|
89306
|
+
}, {}), funcParam.envVariables ?? {}),
|
|
89307
|
+
timeout: funcParam.timeout ?? functionDetail.Timeout,
|
|
89308
|
+
vpc: Object.assign({}, vpc, funcParam.vpc ?? {}),
|
|
89309
|
+
});
|
|
89296
89310
|
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
89297
89311
|
return {
|
|
89298
89312
|
content: [
|
|
@@ -137005,7 +137019,7 @@ class TelemetryReporter {
|
|
|
137005
137019
|
const nodeVersion = process.version; // Node.js版本
|
|
137006
137020
|
const arch = os_1.default.arch(); // 系统架构
|
|
137007
137021
|
// 从构建时注入的版本号获取MCP版本信息
|
|
137008
|
-
const mcpVersion = process.env.npm_package_version || "2.6.
|
|
137022
|
+
const mcpVersion = process.env.npm_package_version || "2.6.5" || 0;
|
|
137009
137023
|
return {
|
|
137010
137024
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
137011
137025
|
deviceId: this.deviceId,
|
|
@@ -203569,7 +203583,7 @@ ${envIdSection}
|
|
|
203569
203583
|
## 环境信息
|
|
203570
203584
|
- 操作系统: ${os_1.default.type()} ${os_1.default.release()}
|
|
203571
203585
|
- Node.js版本: ${process.version}
|
|
203572
|
-
- MCP 版本:${process.env.npm_package_version || "2.6.
|
|
203586
|
+
- MCP 版本:${process.env.npm_package_version || "2.6.5" || 0}
|
|
203573
203587
|
- 系统架构: ${os_1.default.arch()}
|
|
203574
203588
|
- 时间: ${new Date().toISOString()}
|
|
203575
203589
|
- 请求ID: ${requestId}
|
|
@@ -218184,6 +218198,20 @@ function matchesPath(file, pathPattern) {
|
|
|
218184
218198
|
return file === pathPattern;
|
|
218185
218199
|
}
|
|
218186
218200
|
}
|
|
218201
|
+
// 构建 IDE 配置文件检查清单
|
|
218202
|
+
// 返回所有需要检查的路径模式列表
|
|
218203
|
+
function buildIDEChecklist() {
|
|
218204
|
+
return ALL_IDE_FILES;
|
|
218205
|
+
}
|
|
218206
|
+
// 检查文件是否在检查清单范围内
|
|
218207
|
+
function isInChecklist(file, checklist) {
|
|
218208
|
+
for (const pattern of checklist) {
|
|
218209
|
+
if (matchesPath(file, pattern)) {
|
|
218210
|
+
return true;
|
|
218211
|
+
}
|
|
218212
|
+
}
|
|
218213
|
+
return false;
|
|
218214
|
+
}
|
|
218187
218215
|
// 文件过滤函数
|
|
218188
218216
|
function filterFilesByIDE(files, ide) {
|
|
218189
218217
|
if (ide === "all") {
|
|
@@ -218193,32 +218221,24 @@ function filterFilesByIDE(files, ide) {
|
|
|
218193
218221
|
if (!ideFiles) {
|
|
218194
218222
|
return files; // 如果找不到映射,返回所有文件
|
|
218195
218223
|
}
|
|
218196
|
-
//
|
|
218197
|
-
const
|
|
218198
|
-
//
|
|
218199
|
-
for (const ideFile of ALL_IDE_FILES) {
|
|
218200
|
-
// 检查这个文件是否属于当前IDE需要的文件
|
|
218201
|
-
let isCurrentIDEFile = false;
|
|
218202
|
-
for (const currentIDEFile of ideFiles) {
|
|
218203
|
-
if (matchesPath(ideFile, currentIDEFile)) {
|
|
218204
|
-
isCurrentIDEFile = true;
|
|
218205
|
-
break;
|
|
218206
|
-
}
|
|
218207
|
-
}
|
|
218208
|
-
// 如果不属于当前IDE,加入排除列表
|
|
218209
|
-
if (!isCurrentIDEFile) {
|
|
218210
|
-
filesToExclude.push(ideFile);
|
|
218211
|
-
}
|
|
218212
|
-
}
|
|
218213
|
-
// 排除不需要的IDE配置文件,保留其他所有文件
|
|
218224
|
+
// 构建检查清单
|
|
218225
|
+
const checklist = buildIDEChecklist();
|
|
218226
|
+
// 两阶段过滤
|
|
218214
218227
|
return files.filter((file) => {
|
|
218215
|
-
//
|
|
218216
|
-
|
|
218217
|
-
|
|
218218
|
-
|
|
218228
|
+
// 阶段1: 检查文件是否在检查清单范围内
|
|
218229
|
+
if (!isInChecklist(file, checklist)) {
|
|
218230
|
+
// 不在检查清单范围内,直接保留
|
|
218231
|
+
return true;
|
|
218232
|
+
}
|
|
218233
|
+
// 阶段2: 在检查清单范围内,检查是否属于当前 IDE
|
|
218234
|
+
for (const ideFile of ideFiles) {
|
|
218235
|
+
if (matchesPath(file, ideFile)) {
|
|
218236
|
+
// 属于当前 IDE,保留
|
|
218237
|
+
return true;
|
|
218219
218238
|
}
|
|
218220
218239
|
}
|
|
218221
|
-
|
|
218240
|
+
// 在检查清单范围内但不属于当前 IDE,排除
|
|
218241
|
+
return false;
|
|
218222
218242
|
});
|
|
218223
218243
|
}
|
|
218224
218244
|
// 创建过滤后的目录结构
|
|
@@ -218246,7 +218266,7 @@ function registerSetupTools(server) {
|
|
|
218246
218266
|
title: "下载项目模板",
|
|
218247
218267
|
description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
|
|
218248
218268
|
|
|
218249
|
-
**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.
|
|
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)`,
|
|
218250
218270
|
inputSchema: {
|
|
218251
218271
|
template: zod_1.z
|
|
218252
218272
|
.enum(["react", "vue", "miniprogram", "uniapp", "rules"])
|
|
@@ -229778,7 +229798,7 @@ class CloudService {
|
|
|
229778
229798
|
[service]: `https://${service}.internal.tencentcloudapi.com`,
|
|
229779
229799
|
})).reduce((acc, cur) => (Object.assign(Object.assign({}, acc), cur)), {});
|
|
229780
229800
|
if (internalEndpoint) {
|
|
229781
|
-
return intranetUrlMap[this.service]
|
|
229801
|
+
return intranetUrlMap[this.service] || `https://${this.service}.internal.tencentcloudapi.com`;
|
|
229782
229802
|
}
|
|
229783
229803
|
if (urlMap[this.service]) {
|
|
229784
229804
|
return urlMap[this.service];
|
package/dist/index.js
CHANGED
|
@@ -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.
|
|
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}
|
|
@@ -8647,7 +8647,7 @@ class TelemetryReporter {
|
|
|
8647
8647
|
const nodeVersion = process.version; // Node.js版本
|
|
8648
8648
|
const arch = os_1.default.arch(); // 系统架构
|
|
8649
8649
|
// 从构建时注入的版本号获取MCP版本信息
|
|
8650
|
-
const mcpVersion = process.env.npm_package_version || "2.6.
|
|
8650
|
+
const mcpVersion = process.env.npm_package_version || "2.6.5" || 0;
|
|
8651
8651
|
return {
|
|
8652
8652
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
8653
8653
|
deviceId: this.deviceId,
|
|
@@ -9220,7 +9220,21 @@ function registerFunctionTools(server) {
|
|
|
9220
9220
|
// }
|
|
9221
9221
|
// 使用闭包中的 cloudBaseOptions
|
|
9222
9222
|
const cloudbase = await getManager();
|
|
9223
|
-
const
|
|
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
|
+
});
|
|
9224
9238
|
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
9225
9239
|
return {
|
|
9226
9240
|
content: [
|
|
@@ -9932,6 +9946,20 @@ function matchesPath(file, pathPattern) {
|
|
|
9932
9946
|
return file === pathPattern;
|
|
9933
9947
|
}
|
|
9934
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
|
+
}
|
|
9935
9963
|
// 文件过滤函数
|
|
9936
9964
|
function filterFilesByIDE(files, ide) {
|
|
9937
9965
|
if (ide === "all") {
|
|
@@ -9941,32 +9969,24 @@ function filterFilesByIDE(files, ide) {
|
|
|
9941
9969
|
if (!ideFiles) {
|
|
9942
9970
|
return files; // 如果找不到映射,返回所有文件
|
|
9943
9971
|
}
|
|
9944
|
-
//
|
|
9945
|
-
const
|
|
9946
|
-
//
|
|
9947
|
-
for (const ideFile of ALL_IDE_FILES) {
|
|
9948
|
-
// 检查这个文件是否属于当前IDE需要的文件
|
|
9949
|
-
let isCurrentIDEFile = false;
|
|
9950
|
-
for (const currentIDEFile of ideFiles) {
|
|
9951
|
-
if (matchesPath(ideFile, currentIDEFile)) {
|
|
9952
|
-
isCurrentIDEFile = true;
|
|
9953
|
-
break;
|
|
9954
|
-
}
|
|
9955
|
-
}
|
|
9956
|
-
// 如果不属于当前IDE,加入排除列表
|
|
9957
|
-
if (!isCurrentIDEFile) {
|
|
9958
|
-
filesToExclude.push(ideFile);
|
|
9959
|
-
}
|
|
9960
|
-
}
|
|
9961
|
-
// 排除不需要的IDE配置文件,保留其他所有文件
|
|
9972
|
+
// 构建检查清单
|
|
9973
|
+
const checklist = buildIDEChecklist();
|
|
9974
|
+
// 两阶段过滤
|
|
9962
9975
|
return files.filter((file) => {
|
|
9963
|
-
//
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
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;
|
|
9967
9986
|
}
|
|
9968
9987
|
}
|
|
9969
|
-
|
|
9988
|
+
// 在检查清单范围内但不属于当前 IDE,排除
|
|
9989
|
+
return false;
|
|
9970
9990
|
});
|
|
9971
9991
|
}
|
|
9972
9992
|
// 创建过滤后的目录结构
|
|
@@ -9994,7 +10014,7 @@ function registerSetupTools(server) {
|
|
|
9994
10014
|
title: "下载项目模板",
|
|
9995
10015
|
description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
|
|
9996
10016
|
|
|
9997
|
-
**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.
|
|
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)`,
|
|
9998
10018
|
inputSchema: {
|
|
9999
10019
|
template: zod_1.z
|
|
10000
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
|
+
"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",
|