@cloudbase/cloudbase-mcp 2.2.0-alpha.0 → 2.3.0
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/README.md +1 -1
- package/dist/cli.cjs +87 -426
- package/dist/index.cjs +87 -426
- package/dist/index.js +52 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6224,7 +6224,7 @@ ${envIdSection}
|
|
|
6224
6224
|
## 环境信息
|
|
6225
6225
|
- 操作系统: ${os_1.default.type()} ${os_1.default.release()}
|
|
6226
6226
|
- Node.js版本: ${process.version}
|
|
6227
|
-
- MCP 版本:${process.env.npm_package_version || "2.
|
|
6227
|
+
- MCP 版本:${process.env.npm_package_version || "2.3.0" || 0}
|
|
6228
6228
|
- 系统架构: ${os_1.default.arch()}
|
|
6229
6229
|
- 时间: ${new Date().toISOString()}
|
|
6230
6230
|
- 请求ID: ${requestId}
|
|
@@ -7164,12 +7164,15 @@ const IDE_TYPES = [
|
|
|
7164
7164
|
"roocode", // RooCode AI编辑器
|
|
7165
7165
|
"tongyi-lingma", // 通义灵码
|
|
7166
7166
|
"trae", // Trae AI编辑器
|
|
7167
|
+
"qoder", // Qoder AI编辑器
|
|
7168
|
+
"antigravity", // Google Antigravity AI编辑器
|
|
7167
7169
|
"vscode", // Visual Studio Code
|
|
7168
7170
|
];
|
|
7169
7171
|
// IDE到文件的映射关系
|
|
7172
|
+
// 注意:以 "/" 结尾的路径表示目录,会包含该目录下的所有文件
|
|
7170
7173
|
const IDE_FILE_MAPPINGS = {
|
|
7171
|
-
cursor: [".cursor/rules/
|
|
7172
|
-
windsurf: [".windsurf/rules/
|
|
7174
|
+
cursor: [".cursor/rules/", ".cursor/mcp.json"],
|
|
7175
|
+
windsurf: [".windsurf/rules/"],
|
|
7173
7176
|
codebuddy: [".rules/cloudbase-rules.md", "CODEBUDDY.md", ".mcp.json"],
|
|
7174
7177
|
"claude-code": [
|
|
7175
7178
|
"CLAUDE.md",
|
|
@@ -7179,7 +7182,7 @@ const IDE_FILE_MAPPINGS = {
|
|
|
7179
7182
|
".claude/commands/spec.md",
|
|
7180
7183
|
".claude/commands/no_spec.md",
|
|
7181
7184
|
],
|
|
7182
|
-
cline: [".clinerules/
|
|
7185
|
+
cline: [".clinerules/"],
|
|
7183
7186
|
"gemini-cli": [".gemini/GEMINI.md", ".gemini/settings.json"],
|
|
7184
7187
|
opencode: [".opencode.json"],
|
|
7185
7188
|
"qwen-code": [".qwen/QWEN.md", ".qwen/settings.json"],
|
|
@@ -7193,7 +7196,9 @@ const IDE_FILE_MAPPINGS = {
|
|
|
7193
7196
|
"github-copilot": [".github/copilot-instructions.md"],
|
|
7194
7197
|
roocode: [".roo/rules/cloudbaase-rules.md", ".roo/mcp.json"],
|
|
7195
7198
|
"tongyi-lingma": [".lingma/rules/cloudbaase-rules.md"],
|
|
7196
|
-
trae: [".trae/rules/
|
|
7199
|
+
trae: [".trae/rules/"],
|
|
7200
|
+
qoder: [".qoder/rules/"],
|
|
7201
|
+
antigravity: [".agent/rules/"],
|
|
7197
7202
|
vscode: [".vscode/mcp.json", ".vscode/settings.json"],
|
|
7198
7203
|
};
|
|
7199
7204
|
// 所有IDE配置文件的完整列表 - 通过IDE_FILE_MAPPINGS计算得出
|
|
@@ -7218,6 +7223,8 @@ const IDE_DESCRIPTIONS = {
|
|
|
7218
7223
|
roocode: "RooCode AI编辑器",
|
|
7219
7224
|
"tongyi-lingma": "通义灵码",
|
|
7220
7225
|
trae: "Trae AI编辑器",
|
|
7226
|
+
qoder: "Qoder AI编辑器",
|
|
7227
|
+
antigravity: "Google Antigravity AI编辑器",
|
|
7221
7228
|
vscode: "Visual Studio Code",
|
|
7222
7229
|
};
|
|
7223
7230
|
// INTEGRATION_IDE 环境变量值到 IDE 类型的映射
|
|
@@ -7239,6 +7246,8 @@ const INTEGRATION_IDE_MAPPING = {
|
|
|
7239
7246
|
RooCode: "roocode",
|
|
7240
7247
|
"Tongyi Lingma": "tongyi-lingma",
|
|
7241
7248
|
Trae: "trae",
|
|
7249
|
+
Qoder: "qoder",
|
|
7250
|
+
Antigravity: "antigravity",
|
|
7242
7251
|
VSCode: "vscode",
|
|
7243
7252
|
};
|
|
7244
7253
|
// 根据 INTEGRATION_IDE 环境变量获取默认 IDE 类型
|
|
@@ -7389,6 +7398,17 @@ function validateIDE(ide) {
|
|
|
7389
7398
|
}
|
|
7390
7399
|
return { valid: true };
|
|
7391
7400
|
}
|
|
7401
|
+
// 检查文件是否匹配给定的路径(支持文件和目录)
|
|
7402
|
+
function matchesPath(file, pathPattern) {
|
|
7403
|
+
if (pathPattern.endsWith("/")) {
|
|
7404
|
+
// 目录路径:检查文件是否在该目录下
|
|
7405
|
+
return file.startsWith(pathPattern);
|
|
7406
|
+
}
|
|
7407
|
+
else {
|
|
7408
|
+
// 文件路径:精确匹配
|
|
7409
|
+
return file === pathPattern;
|
|
7410
|
+
}
|
|
7411
|
+
}
|
|
7392
7412
|
// 文件过滤函数
|
|
7393
7413
|
function filterFilesByIDE(files, ide) {
|
|
7394
7414
|
if (ide === "all") {
|
|
@@ -7399,9 +7419,32 @@ function filterFilesByIDE(files, ide) {
|
|
|
7399
7419
|
return files; // 如果找不到映射,返回所有文件
|
|
7400
7420
|
}
|
|
7401
7421
|
// 计算需要排除的IDE文件(除了当前IDE需要的文件)
|
|
7402
|
-
const filesToExclude =
|
|
7422
|
+
const filesToExclude = [];
|
|
7423
|
+
// 遍历所有IDE文件,找出不属于当前IDE的文件
|
|
7424
|
+
for (const ideFile of ALL_IDE_FILES) {
|
|
7425
|
+
// 检查这个文件是否属于当前IDE需要的文件
|
|
7426
|
+
let isCurrentIDEFile = false;
|
|
7427
|
+
for (const currentIDEFile of ideFiles) {
|
|
7428
|
+
if (matchesPath(ideFile, currentIDEFile)) {
|
|
7429
|
+
isCurrentIDEFile = true;
|
|
7430
|
+
break;
|
|
7431
|
+
}
|
|
7432
|
+
}
|
|
7433
|
+
// 如果不属于当前IDE,加入排除列表
|
|
7434
|
+
if (!isCurrentIDEFile) {
|
|
7435
|
+
filesToExclude.push(ideFile);
|
|
7436
|
+
}
|
|
7437
|
+
}
|
|
7403
7438
|
// 排除不需要的IDE配置文件,保留其他所有文件
|
|
7404
|
-
return files.filter((file) =>
|
|
7439
|
+
return files.filter((file) => {
|
|
7440
|
+
// 检查文件是否应该被排除
|
|
7441
|
+
for (const excludePath of filesToExclude) {
|
|
7442
|
+
if (matchesPath(file, excludePath)) {
|
|
7443
|
+
return false; // 排除
|
|
7444
|
+
}
|
|
7445
|
+
}
|
|
7446
|
+
return true; // 保留
|
|
7447
|
+
});
|
|
7405
7448
|
}
|
|
7406
7449
|
// 创建过滤后的目录结构
|
|
7407
7450
|
async function createFilteredDirectory(extractDir, filteredFiles, ide) {
|
|
@@ -7428,7 +7471,7 @@ function registerSetupTools(server) {
|
|
|
7428
7471
|
title: "下载项目模板",
|
|
7429
7472
|
description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
|
|
7430
7473
|
|
|
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.
|
|
7474
|
+
**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.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
|
|
7432
7475
|
inputSchema: {
|
|
7433
7476
|
template: zod_1.z
|
|
7434
7477
|
.enum(["react", "vue", "miniprogram", "uniapp", "rules"])
|
|
@@ -8526,7 +8569,7 @@ class TelemetryReporter {
|
|
|
8526
8569
|
const nodeVersion = process.version; // Node.js版本
|
|
8527
8570
|
const arch = os_1.default.arch(); // 系统架构
|
|
8528
8571
|
// 从构建时注入的版本号获取MCP版本信息
|
|
8529
|
-
const mcpVersion = process.env.npm_package_version || "2.
|
|
8572
|
+
const mcpVersion = process.env.npm_package_version || "2.3.0" || 0;
|
|
8530
8573
|
return {
|
|
8531
8574
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
8532
8575
|
deviceId: this.deviceId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cloudbase-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
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",
|