@cloudbase/cloudbase-mcp 2.25.3 → 2.25.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/cli.cjs +3 -3
- package/dist/index.cjs +168 -11
- package/dist/index.js +168 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2772,7 +2772,7 @@ ${envIdSection}
|
|
|
2772
2772
|
## 环境信息
|
|
2773
2773
|
- 操作系统: ${os_1.default.type()} ${os_1.default.release()}
|
|
2774
2774
|
- Node.js版本: ${process.version}
|
|
2775
|
-
- MCP 版本:${process.env.npm_package_version || "2.25.
|
|
2775
|
+
- MCP 版本:${process.env.npm_package_version || "2.25.4" || 0}
|
|
2776
2776
|
- 系统架构: ${os_1.default.arch()}
|
|
2777
2777
|
- 时间: ${new Date().toISOString()}
|
|
2778
2778
|
- 请求ID: ${requestId}
|
|
@@ -2853,7 +2853,7 @@ function createWrappedHandler(name, handler, server) {
|
|
|
2853
2853
|
requestId: (typeof error === 'object' && error && 'requestId' in error) ? error.requestId : '',
|
|
2854
2854
|
ide: server.ide || process.env.INTEGRATION_IDE || ''
|
|
2855
2855
|
});
|
|
2856
|
-
const mcpVersion = true ? "2.25.
|
|
2856
|
+
const mcpVersion = true ? "2.25.4" : 0;
|
|
2857
2857
|
const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
|
|
2858
2858
|
const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
|
|
2859
2859
|
// 创建新的错误对象,保持原有的错误类型但更新消息
|
|
@@ -7840,6 +7840,7 @@ const QUERY_GATEWAY_ACTIONS = [
|
|
|
7840
7840
|
"listRoutes",
|
|
7841
7841
|
"getRoute",
|
|
7842
7842
|
"listCustomDomains",
|
|
7843
|
+
"getPrivilege",
|
|
7843
7844
|
];
|
|
7844
7845
|
const MANAGE_GATEWAY_ACTIONS = [
|
|
7845
7846
|
"createRoute",
|
|
@@ -7847,6 +7848,8 @@ const MANAGE_GATEWAY_ACTIONS = [
|
|
|
7847
7848
|
"deleteRoute",
|
|
7848
7849
|
"bindCustomDomain",
|
|
7849
7850
|
"deleteCustomDomain",
|
|
7851
|
+
"enableService",
|
|
7852
|
+
"authSwitch",
|
|
7850
7853
|
];
|
|
7851
7854
|
/** DomainType of the environment default HTTP service (gateway) domain. */
|
|
7852
7855
|
const HTTP_SERVICE_DOMAIN_TYPE = "HTTPSERVICE";
|
|
@@ -7943,6 +7946,28 @@ function registerGatewayTools(server) {
|
|
|
7943
7946
|
candidates.find((item) => item.Enable !== false) ??
|
|
7944
7947
|
candidates[0]);
|
|
7945
7948
|
};
|
|
7949
|
+
const getGatewayPrivilege = async () => {
|
|
7950
|
+
const cloudbase = await getManager();
|
|
7951
|
+
const result = await cloudbase
|
|
7952
|
+
.commonService("tcb", "2018-06-08")
|
|
7953
|
+
.call({
|
|
7954
|
+
Action: "DescribeCloudBaseGWPrivilege",
|
|
7955
|
+
Param: {
|
|
7956
|
+
ServiceId: await resolveEnvId(),
|
|
7957
|
+
},
|
|
7958
|
+
});
|
|
7959
|
+
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
7960
|
+
return result ?? {};
|
|
7961
|
+
};
|
|
7962
|
+
const buildPrivilegeDescription = (privilege) => {
|
|
7963
|
+
const serviceStatus = privilege.EnableService === true ? "已开启" : "未开启";
|
|
7964
|
+
const authStatus = privilege.EnableAuth === undefined
|
|
7965
|
+
? "未知"
|
|
7966
|
+
: privilege.EnableAuth === true
|
|
7967
|
+
? "已开启"
|
|
7968
|
+
: "未开启";
|
|
7969
|
+
return `HTTP 网关${serviceStatus},访问鉴权${authStatus}`;
|
|
7970
|
+
};
|
|
7946
7971
|
const resolveDefaultHttpDomain = async () => {
|
|
7947
7972
|
// Match console DescribeHTTPServiceRoute usage: filter DomainType=HTTPSERVICE.
|
|
7948
7973
|
// Envs often also expose an IsDefault STATIC_STORE domain (*.tcloudbaseapp.com);
|
|
@@ -8115,6 +8140,28 @@ function registerGatewayTools(server) {
|
|
|
8115
8140
|
},
|
|
8116
8141
|
]);
|
|
8117
8142
|
}
|
|
8143
|
+
case "getPrivilege": {
|
|
8144
|
+
const privilege = await getGatewayPrivilege();
|
|
8145
|
+
const enableService = privilege.EnableService === true;
|
|
8146
|
+
const enableAuth = privilege.EnableAuth === true;
|
|
8147
|
+
return buildEnvelope({
|
|
8148
|
+
action: input.action,
|
|
8149
|
+
enableService,
|
|
8150
|
+
enableAuth,
|
|
8151
|
+
raw: privilege,
|
|
8152
|
+
}, buildPrivilegeDescription(privilege) +
|
|
8153
|
+
(enableService
|
|
8154
|
+
? ""
|
|
8155
|
+
: ";若路由创建成功但访问报 HTTPSERVICE_NONACTIVATED(403),请先开启 HTTP 网关"), enableService
|
|
8156
|
+
? undefined
|
|
8157
|
+
: [
|
|
8158
|
+
{
|
|
8159
|
+
tool: "manageGateway",
|
|
8160
|
+
action: "enableService",
|
|
8161
|
+
reason: "开启 HTTP 网关总开关(EnableService),开启后路由即可通过默认域访问",
|
|
8162
|
+
},
|
|
8163
|
+
]);
|
|
8164
|
+
}
|
|
8118
8165
|
default:
|
|
8119
8166
|
throw new Error(`不支持的操作类型: ${input.action}`);
|
|
8120
8167
|
}
|
|
@@ -8145,6 +8192,28 @@ function registerGatewayTools(server) {
|
|
|
8145
8192
|
throw err;
|
|
8146
8193
|
}
|
|
8147
8194
|
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
8195
|
+
// 探测 HTTP 网关总开关:未开启时提示 HTTPSERVICE_NONACTIVATED 风险并引导开启。
|
|
8196
|
+
// 探测失败不阻断路由创建结果,仅追加弱提示。
|
|
8197
|
+
let privilegeHint = "";
|
|
8198
|
+
let privilegeNextActions = [];
|
|
8199
|
+
try {
|
|
8200
|
+
const privilege = await getGatewayPrivilege();
|
|
8201
|
+
if (privilege.EnableService !== true) {
|
|
8202
|
+
privilegeHint =
|
|
8203
|
+
"⚠️ HTTP 网关总开关未开启,路由创建成功后访问仍将返回 HTTPSERVICE_NONACTIVATED(403);请先调用 manageGateway(action=\"enableService\", enable=true) 开启,再等待 30 秒到 3 分钟访问。";
|
|
8204
|
+
privilegeNextActions = [
|
|
8205
|
+
{
|
|
8206
|
+
tool: "manageGateway",
|
|
8207
|
+
action: "enableService",
|
|
8208
|
+
reason: "开启 HTTP 网关总开关(EnableService),否则访问路由会报 HTTPSERVICE_NONACTIVATED(403)",
|
|
8209
|
+
},
|
|
8210
|
+
];
|
|
8211
|
+
}
|
|
8212
|
+
}
|
|
8213
|
+
catch {
|
|
8214
|
+
privilegeHint =
|
|
8215
|
+
"(无法确认 HTTP 网关开关状态;若访问报 HTTPSERVICE_NONACTIVATED,请用 queryGateway(action=\"getPrivilege\") 查询后用 manageGateway(action=\"enableService\") 开启)";
|
|
8216
|
+
}
|
|
8148
8217
|
return buildEnvelope({
|
|
8149
8218
|
action: input.action,
|
|
8150
8219
|
model: "httpServiceRoute",
|
|
@@ -8167,7 +8236,12 @@ function registerGatewayTools(server) {
|
|
|
8167
8236
|
: payload.resolved.enablePathTransmission === false
|
|
8168
8237
|
? ";路径透传关闭(网关会剥掉触发路径前缀后再转发给后端)"
|
|
8169
8238
|
: ";路径透传未显式设置(平台默认 false,会剥掉触发路径前缀)") +
|
|
8170
|
-
`。注意:路由配置传播通常需要等待 30 秒到 3
|
|
8239
|
+
`。注意:路由配置传播通常需要等待 30 秒到 3 分钟,请勿立即访问。该操作只创建网关入口,不会自动放开上游权限;若上游是云函数且需要匿名或浏览器直接访问,请继续检查函数资源权限。` +
|
|
8240
|
+
(privilegeHint ? ` ${privilegeHint}` : ""), [
|
|
8241
|
+
...privilegeNextActions,
|
|
8242
|
+
...(routeMutationNextActions(payload.resolved.upstreamResourceName) ??
|
|
8243
|
+
[]),
|
|
8244
|
+
]);
|
|
8171
8245
|
}
|
|
8172
8246
|
case "updateRoute": {
|
|
8173
8247
|
const cloudbase = await getManager();
|
|
@@ -8258,6 +8332,60 @@ function registerGatewayTools(server) {
|
|
|
8258
8332
|
raw: result,
|
|
8259
8333
|
}, "自定义域名删除成功");
|
|
8260
8334
|
}
|
|
8335
|
+
case "enableService": {
|
|
8336
|
+
if (typeof input.enable !== "boolean") {
|
|
8337
|
+
throw new Error('action=enableService 时必须提供 enable 参数(boolean),如 enable=true 开启 HTTP 网关总开关、enable=false 关闭;禁止省略或传非布尔值。');
|
|
8338
|
+
}
|
|
8339
|
+
const cloudbase = await getManager();
|
|
8340
|
+
const result = await cloudbase.access.switchAuth(input.enable);
|
|
8341
|
+
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
8342
|
+
const serviceText = input.enable ? "开启" : "关闭";
|
|
8343
|
+
return buildEnvelope({
|
|
8344
|
+
action: input.action,
|
|
8345
|
+
enable: input.enable,
|
|
8346
|
+
raw: result,
|
|
8347
|
+
}, `HTTP 网关总开关${serviceText}成功`, [
|
|
8348
|
+
{
|
|
8349
|
+
tool: "queryGateway",
|
|
8350
|
+
action: "getPrivilege",
|
|
8351
|
+
reason: "复核 HTTP 网关总开关与访问鉴权状态",
|
|
8352
|
+
},
|
|
8353
|
+
]);
|
|
8354
|
+
}
|
|
8355
|
+
case "authSwitch": {
|
|
8356
|
+
if (typeof input.enable !== "boolean") {
|
|
8357
|
+
throw new Error('action=authSwitch 时必须提供 enable 参数(boolean),如 enable=true 开启访问鉴权、enable=false 关闭;禁止省略或传非布尔值。');
|
|
8358
|
+
}
|
|
8359
|
+
const cloudbase = await getManager();
|
|
8360
|
+
const result = await cloudbase
|
|
8361
|
+
.commonService("tcb", "2018-06-08")
|
|
8362
|
+
.call({
|
|
8363
|
+
Action: "ModifyCloudBaseGWPrivilege",
|
|
8364
|
+
Param: {
|
|
8365
|
+
ServiceId: await resolveEnvId(),
|
|
8366
|
+
EnableService: input.enable,
|
|
8367
|
+
Options: [
|
|
8368
|
+
{
|
|
8369
|
+
Key: "authswitch",
|
|
8370
|
+
Value: input.enable ? "true" : "false",
|
|
8371
|
+
},
|
|
8372
|
+
],
|
|
8373
|
+
},
|
|
8374
|
+
});
|
|
8375
|
+
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
8376
|
+
const serviceText = input.enable ? "开启" : "关闭";
|
|
8377
|
+
return buildEnvelope({
|
|
8378
|
+
action: input.action,
|
|
8379
|
+
enable: input.enable,
|
|
8380
|
+
raw: result,
|
|
8381
|
+
}, `HTTP 访问服务鉴权${serviceText}成功`, [
|
|
8382
|
+
{
|
|
8383
|
+
tool: "queryGateway",
|
|
8384
|
+
action: "getPrivilege",
|
|
8385
|
+
reason: "复核 HTTP 网关总开关与访问鉴权状态",
|
|
8386
|
+
},
|
|
8387
|
+
]);
|
|
8388
|
+
}
|
|
8261
8389
|
default:
|
|
8262
8390
|
throw new Error(`不支持的操作类型: ${input.action}`);
|
|
8263
8391
|
}
|
|
@@ -8266,12 +8394,14 @@ function registerGatewayTools(server) {
|
|
|
8266
8394
|
title: "查询 CloudBase 网关",
|
|
8267
8395
|
description: "CloudBase HTTP 网关统一只读入口(Domain/Route)。查询域名下路径路由及其上游:" +
|
|
8268
8396
|
"WEB_SCF/SCF=云函数,CBR=云托管,STATIC_STORE=静态托管,LH=轻量应用服务器。" +
|
|
8269
|
-
"主键为 Domain + Path;listRoutes / getRoute / listCustomDomains。" +
|
|
8397
|
+
"主键为 Domain + Path;listRoutes / getRoute / listCustomDomains / getPrivilege。" +
|
|
8398
|
+
"getPrivilege 查询 HTTP 网关总开关(enableService)与访问鉴权(enableAuth)状态。" +
|
|
8270
8399
|
"实现自定义域名访问前,先 listCustomDomains:若已有自定义域名,优先 createRoute 挂路由(无需证书 ID);仅在没有可用自定义域名时才 bindCustomDomain。",
|
|
8271
8400
|
inputSchema: {
|
|
8272
8401
|
action: zod_1.z
|
|
8273
8402
|
.enum(QUERY_GATEWAY_ACTIONS)
|
|
8274
|
-
.describe("只读操作类型:listRoutes、getRoute、listCustomDomains。" +
|
|
8403
|
+
.describe("只读操作类型:listRoutes、getRoute、listCustomDomains、getPrivilege。" +
|
|
8404
|
+
"getPrivilege 无需其他参数,直接返回 HTTP 网关总开关与访问鉴权状态。" +
|
|
8275
8405
|
"自定义域名访问场景先 listCustomDomains 确认是否已有域名可复用。"),
|
|
8276
8406
|
targetName: zod_1.z
|
|
8277
8407
|
.string()
|
|
@@ -8304,11 +8434,13 @@ function registerGatewayTools(server) {
|
|
|
8304
8434
|
"createRoute 只建网关入口,不改上游权限。" +
|
|
8305
8435
|
"enablePathTransmission:默认 false 剥触发路径前缀;true 透传完整路径(CBR 多路由、WEB_SCF 自管子路径常需 true;STATIC_STORE 自定义触发路径映射站点根通常 false)。" +
|
|
8306
8436
|
"⚠️ 自定义域名访问:若环境已有自定义域名(先 queryGateway listCustomDomains),优先 createRoute 并显式传入该 domain,无需 certificateId;" +
|
|
8307
|
-
"仅首次绑定全新自定义域名时用 bindCustomDomain(需 certificateId)。CORS/安全域名用 envDomainManagement。"
|
|
8437
|
+
"仅首次绑定全新自定义域名时用 bindCustomDomain(需 certificateId)。CORS/安全域名用 envDomainManagement。" +
|
|
8438
|
+
"enableService/authSwitch:HTTP 网关总开关与访问鉴权开关;createRoute 后若访问报 HTTPSERVICE_NONACTIVATED,通常是总开关未开启(用 queryGateway getPrivilege 查询、enableService 开启)。",
|
|
8308
8439
|
inputSchema: {
|
|
8309
8440
|
action: zod_1.z
|
|
8310
8441
|
.enum(MANAGE_GATEWAY_ACTIONS)
|
|
8311
|
-
.describe("写操作:createRoute/updateRoute/deleteRoute 管理路由;bindCustomDomain/deleteCustomDomain
|
|
8442
|
+
.describe("写操作:createRoute/updateRoute/deleteRoute 管理路由;bindCustomDomain/deleteCustomDomain 管理自定义域名;" +
|
|
8443
|
+
"enableService/authSwitch 开关 HTTP 网关总开关与访问鉴权(需配合 enable 参数)。" +
|
|
8312
8444
|
"createRoute/updateRoute 必须提供 upstreamResourceType。" +
|
|
8313
8445
|
"已有自定义域名时优先 createRoute(domain=已有域名) 实现访问,不必再次 bindCustomDomain / 传入 certificateId;" +
|
|
8314
8446
|
"bindCustomDomain 仅用于首次绑定新域名。"),
|
|
@@ -8374,6 +8506,11 @@ function registerGatewayTools(server) {
|
|
|
8374
8506
|
.optional()
|
|
8375
8507
|
.describe("证书 ID。仅首次 bindCustomDomain 必填。" +
|
|
8376
8508
|
"在已有自定义域名上 createRoute / updateRoute / deleteRoute 不需要 certificateId。"),
|
|
8509
|
+
enable: zod_1.z
|
|
8510
|
+
.boolean()
|
|
8511
|
+
.optional()
|
|
8512
|
+
.describe("开关目标状态(仅 enableService / authSwitch 使用,必填):" +
|
|
8513
|
+
"enable=true 开启,enable=false 关闭。省略或非布尔值会返回参数错误。"),
|
|
8377
8514
|
},
|
|
8378
8515
|
annotations: {
|
|
8379
8516
|
readOnlyHint: false,
|
|
@@ -10410,6 +10547,22 @@ function buildLoginConfigNextStep(loginMethods) {
|
|
|
10410
10547
|
},
|
|
10411
10548
|
};
|
|
10412
10549
|
}
|
|
10550
|
+
/**
|
|
10551
|
+
* 短信验证码默认通道提示:开启 phone 登录后即可用云开发默认短信通道收发验证码,
|
|
10552
|
+
* 不需要配置短信签名/模板/自定义 Provider。仅当需要自定义模板、签名或更换短信服务商时,
|
|
10553
|
+
* 才需要配置 SmsVerificationConfig / 自定义短信通道。
|
|
10554
|
+
*/
|
|
10555
|
+
function buildSmsHint(loginMethods) {
|
|
10556
|
+
if (!loginMethods.phone) {
|
|
10557
|
+
return undefined;
|
|
10558
|
+
}
|
|
10559
|
+
return {
|
|
10560
|
+
defaultChannelReady: true,
|
|
10561
|
+
message: "短信验证码登录已开启,可直接使用云开发默认短信通道收发验证码,无需配置短信签名/模板/自定义 Provider。" +
|
|
10562
|
+
"前端调用 auth.getVerification({ phone_number }) 发送验证码、auth.signInWithSms({ verificationInfo, verificationCode, phoneNum }) 登录。" +
|
|
10563
|
+
"仅当需要自定义短信模板/签名或更换短信服务商时,才需要配置 SmsVerificationConfig 或接入自定义短信通道。",
|
|
10564
|
+
};
|
|
10565
|
+
}
|
|
10413
10566
|
function extractProviders(value) {
|
|
10414
10567
|
const payload = normalizePlainObject(value, "providersResult");
|
|
10415
10568
|
const providers = payload?.Providers ?? payload?.ProviderList ?? payload?.Data ?? [];
|
|
@@ -10590,12 +10743,14 @@ function registerAppAuthTools(server) {
|
|
|
10590
10743
|
const loginMethods = buildLoginMethods(result);
|
|
10591
10744
|
const nextStep = buildLoginConfigNextStep(loginMethods);
|
|
10592
10745
|
const webSdkHint = buildWebSdkHint(loginMethods);
|
|
10746
|
+
const smsHint = buildSmsHint(loginMethods);
|
|
10593
10747
|
return buildSupabaseLikeAuthResponse({
|
|
10594
10748
|
success: true,
|
|
10595
10749
|
envId,
|
|
10596
10750
|
loginMethods,
|
|
10597
10751
|
...(nextStep ? { next_step: nextStep } : {}),
|
|
10598
10752
|
...(webSdkHint ? { webSdkHint } : {}),
|
|
10753
|
+
...(smsHint ? { smsHint } : {}),
|
|
10599
10754
|
});
|
|
10600
10755
|
}
|
|
10601
10756
|
case "listProviders": {
|
|
@@ -10671,7 +10826,7 @@ function registerAppAuthTools(server) {
|
|
|
10671
10826
|
}));
|
|
10672
10827
|
server.registerTool?.("manageAppAuth", {
|
|
10673
10828
|
title: "管理 CloudBase 应用认证配置",
|
|
10674
|
-
description: "CloudBase 应用侧认证配置写入口。用于修改登录方式、provider、client 配置,确保 publishable key,以及创建或删除 API key、自定义登录密钥。⚠️ 本工具为管理端配置工具,不执行用户登录。当任务要求编写客户端登录代码时(例如「用 JS SDK 登录」),应先通过本工具完成配置(如启用 usernamePassword、获取 publishable key),再在项目代码中编写 @cloudbase/js-sdk 客户端登录代码(如 auth.signInWithPassword()),而非使用本工具完成登录。若前端要接受普通用户名样式标识符,应先执行 action=patchLoginStrategy 并传入 patch={ usernamePassword: true },再实现对应前端登录逻辑。⚠️ action=createApiKey 返回体中的 created 字段表示是否真正新建:created=false 说明复用了环境中已存在的 key,此时 keyName/expireIn 入参不会生效,返回的 keyName/expireAt 均为服务端真实值,并会附带 warnings,切勿把它当作临时凭证分发。",
|
|
10829
|
+
description: "CloudBase 应用侧认证配置写入口。用于修改登录方式、provider、client 配置,确保 publishable key,以及创建或删除 API key、自定义登录密钥。⚠️ 本工具为管理端配置工具,不执行用户登录。当任务要求编写客户端登录代码时(例如「用 JS SDK 登录」),应先通过本工具完成配置(如启用 usernamePassword、获取 publishable key),再在项目代码中编写 @cloudbase/js-sdk 客户端登录代码(如 auth.signInWithPassword()),而非使用本工具完成登录。若前端要接受普通用户名样式标识符,应先执行 action=patchLoginStrategy 并传入 patch={ usernamePassword: true },再实现对应前端登录逻辑。⚠️ 短信验证码登录(patch={ phone: true })使用云开发默认短信通道,开启后即可收发验证码,不需要配置短信签名/模板/自定义 Provider;仅当需要自定义模板/签名或更换短信服务商时才需配置 SmsVerificationConfig 或自定义短信通道。⚠️ action=createApiKey 返回体中的 created 字段表示是否真正新建:created=false 说明复用了环境中已存在的 key,此时 keyName/expireIn 入参不会生效,返回的 keyName/expireAt 均为服务端真实值,并会附带 warnings,切勿把它当作临时凭证分发。",
|
|
10675
10830
|
inputSchema: {
|
|
10676
10831
|
action: zod_1.z.enum(MANAGE_APP_AUTH_ACTIONS),
|
|
10677
10832
|
patch: zod_1.z
|
|
@@ -10737,12 +10892,14 @@ function registerAppAuthTools(server) {
|
|
|
10737
10892
|
const loginMethods = buildLoginMethods(confirmed);
|
|
10738
10893
|
const nextStep = buildLoginConfigNextStep(loginMethods);
|
|
10739
10894
|
const webSdkHint = buildWebSdkHint(loginMethods);
|
|
10895
|
+
const smsHint = buildSmsHint(loginMethods);
|
|
10740
10896
|
return buildSupabaseLikeAuthResponse({
|
|
10741
10897
|
success: true,
|
|
10742
10898
|
envId,
|
|
10743
10899
|
loginMethods,
|
|
10744
10900
|
...(nextStep ? { next_step: nextStep } : {}),
|
|
10745
10901
|
...(webSdkHint ? { webSdkHint } : {}),
|
|
10902
|
+
...(smsHint ? { smsHint } : {}),
|
|
10746
10903
|
});
|
|
10747
10904
|
}
|
|
10748
10905
|
case "addProvider": {
|
|
@@ -10977,7 +11134,7 @@ class TelemetryReporter {
|
|
|
10977
11134
|
const nodeVersion = process.version; // Node.js版本
|
|
10978
11135
|
const arch = os_1.default.arch(); // 系统架构
|
|
10979
11136
|
// 从构建时注入的版本号获取MCP版本信息
|
|
10980
|
-
const mcpVersion = process.env.npm_package_version || "2.25.
|
|
11137
|
+
const mcpVersion = process.env.npm_package_version || "2.25.4" || 0;
|
|
10981
11138
|
return {
|
|
10982
11139
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
10983
11140
|
deviceId: this.deviceId,
|
|
@@ -11489,7 +11646,7 @@ const TRIGGER_SCHEMA = zod_1.z.object({
|
|
|
11489
11646
|
const CREATE_FUNCTION_SCHEMA = zod_1.z.object({
|
|
11490
11647
|
name: zod_1.z.string().describe("函数名称"),
|
|
11491
11648
|
type: zod_1.z.enum(["Event", "HTTP"]).optional().describe("函数类型"),
|
|
11492
|
-
protocolType: zod_1.z.enum(["
|
|
11649
|
+
protocolType: zod_1.z.enum(["WS"]).optional().describe("HTTP 函数访问协议,当前仅支持 WebSockets,取值为 WS(配合 protocolParams.wsParams 使用)。普通 HTTP 函数不要传此字段;传其他值(如 HTTP)会报 InvalidParameterValue.ProtocolType。"),
|
|
11493
11650
|
protocolParams: zod_1.z
|
|
11494
11651
|
.object({
|
|
11495
11652
|
wsParams: zod_1.z
|
|
@@ -15459,7 +15616,7 @@ function registerSetupTools(server) {
|
|
|
15459
15616
|
server.registerTool("downloadTemplate", {
|
|
15460
15617
|
title: "下载项目模板",
|
|
15461
15618
|
description: `自动下载并部署CloudBase项目模板。
|
|
15462
|
-
**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\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.25.
|
|
15619
|
+
**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\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.25.4" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
|
|
15463
15620
|
inputSchema: {
|
|
15464
15621
|
template: zod_1.z
|
|
15465
15622
|
.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.25.
|
|
3
|
+
"version": "2.25.4",
|
|
4
4
|
"packageManager": "pnpm@10.8.0",
|
|
5
5
|
"description": "CloudBase MCP Server — operate Tencent CloudBase (database, auth, functions, storage, hosting) from AI coding tools via the Model Context Protocol. Part of CloudBase AI Toolkit.",
|
|
6
6
|
"main": "./dist/index.cjs",
|