@cloudbase/cloudbase-mcp 2.15.2-beta.2 → 2.15.2

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
@@ -289,6 +289,20 @@ async function getGuidePrompt(server) {
289
289
  return "";
290
290
  }
291
291
  }
292
+ function normalizeOptionalToolString(value) {
293
+ return typeof value === "string" && value.trim().length > 0
294
+ ? value.trim()
295
+ : undefined;
296
+ }
297
+ function normalizeOptionalToolBoolean(value) {
298
+ return typeof value === "boolean" ? value : undefined;
299
+ }
300
+ function resolveToolAuthOptions(server, overrides) {
301
+ return (0, auth_js_1.resolveAuthOptions)({
302
+ ...overrides,
303
+ serverAuthOptions: server.authOptions,
304
+ });
305
+ }
292
306
  function registerEnvTools(server) {
293
307
  // 获取 cloudBaseOptions,如果没有则为 undefined
294
308
  const cloudBaseOptions = server.cloudBaseOptions;
@@ -321,6 +335,18 @@ function registerEnvTools(server) {
321
335
  .enum(["device", "web"])
322
336
  .optional()
323
337
  .describe("认证模式:device=设备码授权,web=浏览器回调授权"),
338
+ oauthEndpoint: zod_1.z
339
+ .string()
340
+ .optional()
341
+ .describe("高级可选:自定义 device-code 登录 endpoint。配置后 oauthCustom 默认按 true 处理"),
342
+ clientId: zod_1.z
343
+ .string()
344
+ .optional()
345
+ .describe("高级可选:自定义 device-code 登录 client_id,不传则使用默认值"),
346
+ oauthCustom: zod_1.z
347
+ .boolean()
348
+ .optional()
349
+ .describe("高级可选:自定义 endpoint 返回格式开关。未配置 endpoint 时默认 false;配置 endpoint 后默认 true,且不能设为 false"),
324
350
  }
325
351
  : {}),
326
352
  envId: zod_1.z
@@ -348,8 +374,18 @@ function registerEnvTools(server) {
348
374
  const authMode = rawArgs.authMode === "device" || rawArgs.authMode === "web"
349
375
  ? rawArgs.authMode
350
376
  : undefined;
377
+ const oauthEndpoint = normalizeOptionalToolString(rawArgs.oauthEndpoint);
378
+ const clientId = normalizeOptionalToolString(rawArgs.clientId);
379
+ const oauthCustom = normalizeOptionalToolBoolean(rawArgs.oauthCustom);
351
380
  const envId = rawArgs.envId;
352
381
  const confirm = rawArgs.confirm === "yes" ? "yes" : undefined;
382
+ const resolvedAuthOptions = resolveToolAuthOptions(server, {
383
+ authMode,
384
+ oauthEndpoint,
385
+ clientId,
386
+ oauthCustom,
387
+ });
388
+ const authConfigSummary = (0, auth_js_1.buildAuthConfigSummary)(resolvedAuthOptions);
353
389
  let deviceAuthInfo;
354
390
  const onDeviceCode = (info) => {
355
391
  deviceAuthInfo = info;
@@ -406,6 +442,7 @@ function registerEnvTools(server) {
406
442
  auth_status: authStatus,
407
443
  env_status: envStatus,
408
444
  current_env_id: envId || null,
445
+ auth_config: authConfigSummary,
409
446
  ...buildEnvCandidatePayload(envCandidates),
410
447
  auth_challenge: authFlowState.status === "PENDING" && authFlowState.authChallenge
411
448
  ? {
@@ -474,12 +511,20 @@ function registerEnvTools(server) {
474
511
  catch {
475
512
  // 忽略 getLoginState 错误,继续尝试发起登录
476
513
  }
514
+ const validationError = (0, auth_js_1.getAuthConfigValidationError)(resolvedAuthOptions);
515
+ if (validationError) {
516
+ return (0, tool_result_js_1.buildJsonToolResult)({
517
+ ok: false,
518
+ code: "INVALID_ARGS",
519
+ message: validationError,
520
+ auth_config: authConfigSummary,
521
+ next_step: (0, tool_result_js_1.buildAuthNextStep)("start_auth", {
522
+ suggestedArgs: { action: "start_auth", authMode: "device" },
523
+ }),
524
+ });
525
+ }
477
526
  // 2. 设备码模式:监听到 device code 即返回 AUTH_PENDING,后续由 toolbox 异步轮询并更新本地 credential
478
- const effectiveMode = authMode && (authMode === "device" || authMode === "web")
479
- ? authMode
480
- : process.env.TCB_AUTH_MODE === "web"
481
- ? "web"
482
- : "device";
527
+ const effectiveMode = resolvedAuthOptions.authMode;
483
528
  if (effectiveMode === "device") {
484
529
  let resolveCode;
485
530
  let rejectCode;
@@ -498,6 +543,15 @@ function registerEnvTools(server) {
498
543
  auth
499
544
  .loginByWebAuth({
500
545
  flow: "device",
546
+ ...(resolvedAuthOptions.clientId
547
+ ? { client_id: resolvedAuthOptions.clientId }
548
+ : {}),
549
+ ...(resolvedAuthOptions.oauthEndpoint
550
+ ? { getOAuthEndpoint: () => resolvedAuthOptions.oauthEndpoint }
551
+ : {}),
552
+ ...(resolvedAuthOptions.oauthCustom
553
+ ? { custom: true }
554
+ : {}),
501
555
  onDeviceCode: deviceOnCode,
502
556
  })
503
557
  .then(() => {
@@ -556,6 +610,9 @@ function registerEnvTools(server) {
556
610
  const loginState = await (0, auth_js_1.ensureLogin)({
557
611
  region,
558
612
  authMode: effectiveMode,
613
+ clientId: resolvedAuthOptions.clientId,
614
+ oauthEndpoint: resolvedAuthOptions.oauthEndpoint,
615
+ oauthCustom: resolvedAuthOptions.oauthCustom,
559
616
  });
560
617
  if (!loginState) {
561
618
  return (0, tool_result_js_1.buildJsonToolResult)({
@@ -1209,7 +1266,7 @@ ${envIdSection}
1209
1266
  ## 环境信息
1210
1267
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
1211
1268
  - Node.js版本: ${process.version}
1212
- - MCP 版本:${process.env.npm_package_version || "2.15.2-beta.2" || 0}
1269
+ - MCP 版本:${process.env.npm_package_version || "2.15.2" || 0}
1213
1270
  - 系统架构: ${os_1.default.arch()}
1214
1271
  - 时间: ${new Date().toISOString()}
1215
1272
  - 请求ID: ${requestId}
@@ -1525,7 +1582,7 @@ function parseEnabledPlugins(pluginsEnabled, pluginsDisabled) {
1525
1582
  * await server.connect(transport);
1526
1583
  */
1527
1584
  async function createCloudBaseMcpServer(options) {
1528
- const { name = "cloudbase-mcp", version = "1.0.0", enableTelemetry = true, cloudBaseOptions, cloudMode = false, ide, logger, pluginsEnabled, pluginsDisabled, } = options ?? {};
1585
+ const { name = "cloudbase-mcp", version = "1.0.0", enableTelemetry = true, cloudBaseOptions, authOptions, cloudMode = false, ide, logger, pluginsEnabled, pluginsDisabled, } = options ?? {};
1529
1586
  // Enable cloud mode if specified
1530
1587
  if (cloudMode) {
1531
1588
  (0, cloud_mode_js_1.enableCloudMode)();
@@ -1563,6 +1620,9 @@ async function createCloudBaseMcpServer(options) {
1563
1620
  if (cloudBaseOptions) {
1564
1621
  server.cloudBaseOptions = cloudBaseOptions;
1565
1622
  }
1623
+ if (authOptions) {
1624
+ server.authOptions = authOptions;
1625
+ }
1566
1626
  // Store ide in server instance for telemetry
1567
1627
  if (ide) {
1568
1628
  server.ide = ide;
@@ -6152,6 +6212,7 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
6152
6212
  region,
6153
6213
  authMode: options?.authMode,
6154
6214
  clientId: options?.clientId,
6215
+ serverAuthOptions: server?.authOptions,
6155
6216
  onDeviceCode: options?.onDeviceCode,
6156
6217
  });
6157
6218
  (0, logger_js_1.debug)("[interactive] Login state:", {
@@ -7170,7 +7231,7 @@ deleteCollection: 删除集合`),
7170
7231
  // writeNoSqlDatabaseContent
7171
7232
  server.registerTool?.("writeNoSqlDatabaseContent", {
7172
7233
  title: "修改 NoSQL 数据库数据记录",
7173
- description: "修改 NoSQL 数据库数据记录",
7234
+ description: "修改 NoSQL 数据库数据记录。可按 MongoDB updateOne/updateMany 的心智模型理解:部分更新必须使用 $set/$inc/$push 等更新操作符;如果直接传 { field: value } 这类普通对象,底层会把它当作替换内容,存在覆盖整条文档的风险。",
7174
7235
  inputSchema: {
7175
7236
  action: zod_1.z
7176
7237
  .enum(["insert", "update", "delete"])
@@ -7187,7 +7248,7 @@ deleteCollection: 删除集合`),
7187
7248
  update: zod_1.z
7188
7249
  .union([zod_1.z.object({}).passthrough(), zod_1.z.string()])
7189
7250
  .optional()
7190
- .describe("更新内容(对象或字符串,推荐对象)(update 操作必填)"),
7251
+ .describe("更新内容(对象或字符串,推荐对象)(update 操作必填)。按 MongoDB 更新语义传入 MgoUpdate:部分更新请使用 $set/$inc/$unset/$push 等操作符,例如 { \"$set\": { \"status\": \"pending\" } };不要直接传 { \"status\": \"pending\" },否则可能替换整条文档。"),
7191
7252
  isMulti: zod_1.z
7192
7253
  .boolean()
7193
7254
  .optional()
@@ -8870,11 +8931,11 @@ async function registerRagTools(server) {
8870
8931
  }
8871
8932
  server.registerTool?.("searchKnowledgeBase", {
8872
8933
  title: "云开发知识库检索",
8873
- description: `云开发知识库智能检索工具,支持向量查询 (vector)、固定文档 (doc) 和 OpenAPI 文档 (openapi) 查询。
8934
+ description: `云开发知识库智能检索工具,支持向量查询 (vector)、固定技能文档 (skill) 和 OpenAPI 文档 (openapi) 查询。
8874
8935
 
8875
- 强烈推荐始终优先使用固定文档 (doc) 或 OpenAPI 文档 (openapi) 模式进行检索,仅当固定文档无法覆盖你的问题时,再使用向量查询 (vector) 模式。
8936
+ 强烈推荐始终优先使用固定技能文档 (skill) 或 OpenAPI 文档 (openapi) 模式进行检索,仅当固定技能文档无法覆盖你的问题时,再使用向量查询 (vector) 模式。
8876
8937
 
8877
- 固定文档 (doc) 查询当前支持 ${skills.length} 个固定文档,分别是:
8938
+ 固定技能文档 (skill) 查询当前支持 ${skills.length} 个固定文档,分别是:
8878
8939
  ${skills
8879
8940
  .map((skill) => `文档名:${path.basename(path.dirname(skill.absolutePath))} 文档介绍:${skill.description}`)
8880
8941
  .join("\n")}
@@ -8884,11 +8945,11 @@ async function registerRagTools(server) {
8884
8945
  .map((api) => `API名:${api.name} API介绍:${api.description}`)
8885
8946
  .join("\n")}`,
8886
8947
  inputSchema: {
8887
- mode: zod_1.z.enum(["vector", "doc", "openapi"]),
8888
- docName: zod_1.z
8948
+ mode: zod_1.z.enum(["vector", "skill", "openapi"]),
8949
+ skillName: zod_1.z
8889
8950
  .enum(skills.map((skill) => path.basename(path.dirname(skill.absolutePath))))
8890
8951
  .optional()
8891
- .describe("mode=doc 时指定。文档名称。"),
8952
+ .describe("mode=skill 时指定。技能名称。"),
8892
8953
  apiName: zod_1.z
8893
8954
  .enum(openapis.map((api) => api.name))
8894
8955
  .optional()
@@ -8922,14 +8983,14 @@ async function registerRagTools(server) {
8922
8983
  openWorldHint: true,
8923
8984
  category: "rag",
8924
8985
  },
8925
- }, async ({ id, content, options: { chunkExpand = [3, 3] } = {}, limit = 5, threshold = 0.5, mode, docName, apiName, }) => {
8926
- if (mode === "doc") {
8927
- const absolutePath = skills.find((skill) => skill.absolutePath.includes(docName)).absolutePath;
8986
+ }, async ({ id, content, options: { chunkExpand = [3, 3] } = {}, limit = 5, threshold = 0.5, mode, skillName, apiName, }) => {
8987
+ if (mode === "skill") {
8988
+ const absolutePath = skills.find((skill) => skill.absolutePath.includes(skillName)).absolutePath;
8928
8989
  return {
8929
8990
  content: [
8930
8991
  {
8931
8992
  type: "text",
8932
- text: `The doc's absolute path is: ${absolutePath}. ${(await fs.readFile(absolutePath)).toString()}`,
8993
+ text: `The skill doc's absolute path is: ${absolutePath}. ${(await fs.readFile(absolutePath)).toString()}`,
8933
8994
  },
8934
8995
  ],
8935
8996
  };
@@ -10531,7 +10592,7 @@ class TelemetryReporter {
10531
10592
  const nodeVersion = process.version; // Node.js版本
10532
10593
  const arch = os_1.default.arch(); // 系统架构
10533
10594
  // 从构建时注入的版本号获取MCP版本信息
10534
- const mcpVersion = process.env.npm_package_version || "2.15.2-beta.2" || 0;
10595
+ const mcpVersion = process.env.npm_package_version || "2.15.2" || 0;
10535
10596
  return {
10536
10597
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
10537
10598
  deviceId: this.deviceId,
@@ -12363,7 +12424,7 @@ function registerSetupTools(server) {
12363
12424
  title: "下载项目模板",
12364
12425
  description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
12365
12426
 
12366
- **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.2-beta.2" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
12427
+ **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.2" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
12367
12428
  inputSchema: {
12368
12429
  template: zod_1.z
12369
12430
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])
@@ -14311,6 +14372,9 @@ function registerHostingTools(server) {
14311
14372
  Object.defineProperty(exports, "__esModule", ({ value: true }));
14312
14373
  exports.getAuthProgressStateSync = getAuthProgressStateSync;
14313
14374
  exports.getAuthProgressState = getAuthProgressState;
14375
+ exports.resolveAuthOptions = resolveAuthOptions;
14376
+ exports.getAuthConfigValidationError = getAuthConfigValidationError;
14377
+ exports.buildAuthConfigSummary = buildAuthConfigSummary;
14314
14378
  exports.setPendingAuthProgressState = setPendingAuthProgressState;
14315
14379
  exports.resolveAuthProgressState = resolveAuthProgressState;
14316
14380
  exports.rejectAuthProgressState = rejectAuthProgressState;
@@ -14327,6 +14391,32 @@ const authProgressState = {
14327
14391
  status: "IDLE",
14328
14392
  updatedAt: Date.now(),
14329
14393
  };
14394
+ function normalizeOptionalString(value) {
14395
+ if (typeof value !== "string") {
14396
+ return undefined;
14397
+ }
14398
+ const trimmed = value.trim();
14399
+ return trimmed.length > 0 ? trimmed : undefined;
14400
+ }
14401
+ function normalizeAuthMode(value) {
14402
+ return value === "web" || value === "device" ? value : undefined;
14403
+ }
14404
+ function normalizeOptionalBoolean(value) {
14405
+ if (typeof value === "boolean") {
14406
+ return value;
14407
+ }
14408
+ if (typeof value !== "string") {
14409
+ return undefined;
14410
+ }
14411
+ const normalized = value.trim().toLowerCase();
14412
+ if (normalized === "true") {
14413
+ return true;
14414
+ }
14415
+ if (normalized === "false") {
14416
+ return false;
14417
+ }
14418
+ return undefined;
14419
+ }
14330
14420
  function updateAuthProgressState(partial) {
14331
14421
  Object.assign(authProgressState, partial, {
14332
14422
  updatedAt: Date.now(),
@@ -14384,6 +14474,68 @@ async function getAuthProgressState() {
14384
14474
  }
14385
14475
  return getAuthProgressStateSync();
14386
14476
  }
14477
+ function resolveAuthOptions(options) {
14478
+ const envAuthMode = options?.ignoreEnvVars
14479
+ ? undefined
14480
+ : normalizeAuthMode(process.env.TCB_AUTH_MODE);
14481
+ const envClientId = options?.ignoreEnvVars
14482
+ ? undefined
14483
+ : normalizeOptionalString(process.env.TCB_AUTH_CLIENT_ID);
14484
+ const envOAuthEndpoint = options?.ignoreEnvVars
14485
+ ? undefined
14486
+ : normalizeOptionalString(process.env.TCB_AUTH_OAUTH_ENDPOINT);
14487
+ const envOAuthCustom = options?.ignoreEnvVars
14488
+ ? undefined
14489
+ : normalizeOptionalBoolean(process.env.TCB_AUTH_OAUTH_CUSTOM);
14490
+ const explicitAuthMode = normalizeAuthMode(options?.authMode) ??
14491
+ normalizeAuthMode(options?.serverAuthOptions?.authMode) ??
14492
+ envAuthMode;
14493
+ const clientId = normalizeOptionalString(options?.clientId) ??
14494
+ normalizeOptionalString(options?.serverAuthOptions?.clientId) ??
14495
+ envClientId;
14496
+ const oauthEndpoint = normalizeOptionalString(options?.oauthEndpoint) ??
14497
+ normalizeOptionalString(options?.serverAuthOptions?.oauthEndpoint) ??
14498
+ envOAuthEndpoint;
14499
+ const explicitOAuthCustom = normalizeOptionalBoolean(options?.oauthCustom) ??
14500
+ normalizeOptionalBoolean(options?.serverAuthOptions?.oauthCustom) ??
14501
+ envOAuthCustom;
14502
+ const oauthCustom = explicitOAuthCustom ?? (oauthEndpoint ? true : false);
14503
+ const authMode = explicitAuthMode ?? "device";
14504
+ return {
14505
+ authMode,
14506
+ clientId,
14507
+ oauthEndpoint,
14508
+ oauthCustom,
14509
+ usesToolboxDefaults: explicitAuthMode === undefined &&
14510
+ clientId === undefined &&
14511
+ oauthEndpoint === undefined &&
14512
+ oauthCustom === false,
14513
+ };
14514
+ }
14515
+ function getAuthConfigValidationError(options) {
14516
+ if (options.authMode === "web" &&
14517
+ (options.clientId !== undefined ||
14518
+ options.oauthEndpoint !== undefined ||
14519
+ options.oauthCustom)) {
14520
+ return "自定义 device 登录参数仅支持 authMode=device。";
14521
+ }
14522
+ if (options.oauthCustom && !options.oauthEndpoint) {
14523
+ return "oauthCustom=true 时必须同时提供 oauthEndpoint。";
14524
+ }
14525
+ if (options.oauthEndpoint && !options.oauthCustom) {
14526
+ return "配置自定义 oauthEndpoint 时必须启用 oauthCustom=true。";
14527
+ }
14528
+ return null;
14529
+ }
14530
+ function buildAuthConfigSummary(options) {
14531
+ return {
14532
+ auth_mode: options.authMode,
14533
+ client_id: options.clientId ?? null,
14534
+ oauth_endpoint: options.oauthEndpoint ?? null,
14535
+ oauth_custom: options.oauthCustom,
14536
+ uses_toolbox_defaults: options.usesToolboxDefaults,
14537
+ };
14538
+ }
14387
14539
  function setPendingAuthProgressState(challenge, authMode = "device") {
14388
14540
  return updateAuthProgressState({
14389
14541
  status: "PENDING",
@@ -14427,9 +14579,19 @@ async function ensureLogin(options) {
14427
14579
  ignoreEnvVars: options?.ignoreEnvVars,
14428
14580
  });
14429
14581
  if (!loginState) {
14430
- const envMode = process.env.TCB_AUTH_MODE;
14431
- const normalizedEnvMode = envMode === "web" || envMode === "device" ? envMode : undefined;
14432
- const mode = options?.authMode || normalizedEnvMode || "device";
14582
+ const resolvedAuthOptions = resolveAuthOptions({
14583
+ authMode: options?.authMode,
14584
+ clientId: options?.clientId,
14585
+ oauthEndpoint: options?.oauthEndpoint,
14586
+ oauthCustom: options?.oauthCustom,
14587
+ ignoreEnvVars: options?.ignoreEnvVars,
14588
+ serverAuthOptions: options?.serverAuthOptions,
14589
+ });
14590
+ const validationError = getAuthConfigValidationError(resolvedAuthOptions);
14591
+ if (validationError) {
14592
+ throw new Error(validationError);
14593
+ }
14594
+ const mode = resolvedAuthOptions.authMode;
14433
14595
  const loginOptions = { flow: mode };
14434
14596
  if (mode === "web") {
14435
14597
  loginOptions.getAuthUrl =
@@ -14448,8 +14610,14 @@ async function ensureLogin(options) {
14448
14610
  };
14449
14611
  }
14450
14612
  else {
14451
- if (options?.clientId) {
14452
- loginOptions.client_id = options.clientId;
14613
+ if (resolvedAuthOptions.clientId) {
14614
+ loginOptions.client_id = resolvedAuthOptions.clientId;
14615
+ }
14616
+ if (resolvedAuthOptions.oauthEndpoint) {
14617
+ loginOptions.getOAuthEndpoint = () => resolvedAuthOptions.oauthEndpoint;
14618
+ }
14619
+ if (resolvedAuthOptions.oauthCustom) {
14620
+ loginOptions.custom = true;
14453
14621
  }
14454
14622
  if (options?.onDeviceCode) {
14455
14623
  loginOptions.onDeviceCode = (info) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cloudbase-mcp",
3
- "version": "2.15.2-beta.2",
3
+ "version": "2.15.2",
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",