@cloudbase/cloudbase-mcp 1.8.4 → 1.8.6
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 +143 -3
- package/dist/cli.cjs +32 -14
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +31 -13
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +32 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112,7 +112,7 @@ var init_logger = __esm({
|
|
|
112
112
|
logger = new Logger({
|
|
113
113
|
enabled: (process.env.MCP_DEBUG ?? "true") === "true",
|
|
114
114
|
level: 0 /* DEBUG */,
|
|
115
|
-
console: process.env.
|
|
115
|
+
console: process.env.MCP_CONSOLE_LOG === "true"
|
|
116
116
|
});
|
|
117
117
|
debug = (message, data) => logger.debug(message, data);
|
|
118
118
|
info = (message, data) => logger.info(message, data);
|
|
@@ -171,9 +171,18 @@ __export(interactive_server_exports, {
|
|
|
171
171
|
import express from "express";
|
|
172
172
|
import http from "http";
|
|
173
173
|
import { WebSocketServer } from "ws";
|
|
174
|
-
import open from "open";
|
|
175
174
|
import path2 from "path";
|
|
176
175
|
import { fileURLToPath } from "url";
|
|
176
|
+
async function openUrl(url, options) {
|
|
177
|
+
try {
|
|
178
|
+
const openModule = await import("open");
|
|
179
|
+
const open = openModule.default || openModule;
|
|
180
|
+
return await open(url, options);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
error("Failed to import or use open module", err);
|
|
183
|
+
warn(`Please manually open: ${url}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
177
186
|
function getInteractiveServer() {
|
|
178
187
|
if (!interactiveServerInstance) {
|
|
179
188
|
interactiveServerInstance = new InteractiveServer();
|
|
@@ -213,7 +222,10 @@ var init_interactive_server = __esm({
|
|
|
213
222
|
if (typeof globalThis.__filename === "string") {
|
|
214
223
|
return globalThis.__filename;
|
|
215
224
|
}
|
|
216
|
-
|
|
225
|
+
if (typeof __require !== "undefined" && __require.main && __require.main.filename) {
|
|
226
|
+
return __require.main.filename;
|
|
227
|
+
}
|
|
228
|
+
return path2.join(process.cwd(), "interactive-server.js");
|
|
217
229
|
};
|
|
218
230
|
__filename = getFilename();
|
|
219
231
|
__dirname = path2.dirname(__filename);
|
|
@@ -449,7 +461,7 @@ var init_interactive_server = __esm({
|
|
|
449
461
|
const url = `http://localhost:${port}/env-setup/${sessionId}`;
|
|
450
462
|
info(`Opening browser: ${url}`);
|
|
451
463
|
try {
|
|
452
|
-
await
|
|
464
|
+
await openUrl(url, { wait: false });
|
|
453
465
|
info("Browser opened successfully");
|
|
454
466
|
} catch (browserError) {
|
|
455
467
|
error("Failed to open browser", browserError);
|
|
@@ -479,7 +491,7 @@ var init_interactive_server = __esm({
|
|
|
479
491
|
this.sessionData.delete(sessionId);
|
|
480
492
|
}, 5 * 60 * 1e3);
|
|
481
493
|
const url = `http://localhost:${port}/clarification/${sessionId}`;
|
|
482
|
-
await
|
|
494
|
+
await openUrl(url);
|
|
483
495
|
return new Promise((resolve2) => {
|
|
484
496
|
this.currentResolver = resolve2;
|
|
485
497
|
});
|
|
@@ -3121,10 +3133,9 @@ function registerEnvTools(server) {
|
|
|
3121
3133
|
"envQuery",
|
|
3122
3134
|
{
|
|
3123
3135
|
title: "\u73AF\u5883\u67E5\u8BE2",
|
|
3124
|
-
description: "\u67E5\u8BE2\u4E91\u5F00\u53D1\u73AF\u5883\u76F8\u5173\u4FE1\u606F\uFF0C\u652F\u6301\u67E5\u8BE2\u73AF\u5883\u5217\u8868\u3001\u5F53\u524D\u73AF\u5883\u4FE1\u606F\u548C\u5B89\u5168\u57DF\u540D",
|
|
3136
|
+
description: "\u67E5\u8BE2\u4E91\u5F00\u53D1\u73AF\u5883\u76F8\u5173\u4FE1\u606F\uFF0C\u652F\u6301\u67E5\u8BE2\u73AF\u5883\u5217\u8868\u3001\u5F53\u524D\u73AF\u5883\u4FE1\u606F\u548C\u5B89\u5168\u57DF\u540D\u3002\uFF08\u539F\u5DE5\u5177\u540D\uFF1AlistEnvs/getEnvInfo/getEnvAuthDomains\uFF0C\u4E3A\u517C\u5BB9\u65E7AI\u89C4\u5219\u53EF\u7EE7\u7EED\u4F7F\u7528\u8FD9\u4E9B\u540D\u79F0\uFF09",
|
|
3125
3137
|
inputSchema: {
|
|
3126
|
-
action: z2.enum(["list", "info", "domains"]).describe("\u67E5\u8BE2\u7C7B\u578B\uFF1Alist=\u73AF\u5883\u5217\u8868\uFF0Cinfo=\u5F53\u524D\u73AF\u5883\u4FE1\u606F\uFF0Cdomains=\u5B89\u5168\u57DF\u540D\u5217\u8868")
|
|
3127
|
-
confirm: z2.literal("yes").optional().describe("\u786E\u8BA4\u64CD\u4F5C\uFF0C\u9ED8\u8BA4\u4F20 yes")
|
|
3138
|
+
action: z2.enum(["list", "info", "domains"]).describe("\u67E5\u8BE2\u7C7B\u578B\uFF1Alist=\u73AF\u5883\u5217\u8868\uFF0Cinfo=\u5F53\u524D\u73AF\u5883\u4FE1\u606F\uFF0Cdomains=\u5B89\u5168\u57DF\u540D\u5217\u8868")
|
|
3128
3139
|
},
|
|
3129
3140
|
annotations: {
|
|
3130
3141
|
readOnlyHint: true,
|
|
@@ -3171,7 +3182,7 @@ function registerEnvTools(server) {
|
|
|
3171
3182
|
"envDomainManagement",
|
|
3172
3183
|
{
|
|
3173
3184
|
title: "\u73AF\u5883\u57DF\u540D\u7BA1\u7406",
|
|
3174
|
-
description: "\u7BA1\u7406\u4E91\u5F00\u53D1\u73AF\u5883\u7684\u5B89\u5168\u57DF\u540D\uFF0C\u652F\u6301\u6DFB\u52A0\u548C\u5220\u9664\u64CD\u4F5C",
|
|
3185
|
+
description: "\u7BA1\u7406\u4E91\u5F00\u53D1\u73AF\u5883\u7684\u5B89\u5168\u57DF\u540D\uFF0C\u652F\u6301\u6DFB\u52A0\u548C\u5220\u9664\u64CD\u4F5C\u3002\uFF08\u539F\u5DE5\u5177\u540D\uFF1AcreateEnvDomain/deleteEnvDomain\uFF0C\u4E3A\u517C\u5BB9\u65E7AI\u89C4\u5219\u53EF\u7EE7\u7EED\u4F7F\u7528\u8FD9\u4E9B\u540D\u79F0\uFF09",
|
|
3175
3186
|
inputSchema: {
|
|
3176
3187
|
action: z2.enum(["create", "delete"]).describe("\u64CD\u4F5C\u7C7B\u578B\uFF1Acreate=\u6DFB\u52A0\u57DF\u540D\uFF0Cdelete=\u5220\u9664\u57DF\u540D"),
|
|
3177
3188
|
domains: z2.array(z2.string()).describe("\u5B89\u5168\u57DF\u540D\u6570\u7EC4")
|
|
@@ -4015,7 +4026,7 @@ function registerDatabaseTools(server) {
|
|
|
4015
4026
|
"collectionQuery",
|
|
4016
4027
|
{
|
|
4017
4028
|
title: "\u96C6\u5408\u67E5\u8BE2",
|
|
4018
|
-
description: "\u6570\u636E\u5E93\u96C6\u5408\u7684\u67E5\u8BE2\u64CD\u4F5C\uFF0C\u652F\u6301\u68C0\u67E5\u5B58\u5728\u6027\u3001\u67E5\u770B\u8BE6\u60C5\u548C\u5217\u8868\u67E5\u8BE2",
|
|
4029
|
+
description: "\u6570\u636E\u5E93\u96C6\u5408\u7684\u67E5\u8BE2\u64CD\u4F5C\uFF0C\u652F\u6301\u68C0\u67E5\u5B58\u5728\u6027\u3001\u67E5\u770B\u8BE6\u60C5\u548C\u5217\u8868\u67E5\u8BE2\u3002\uFF08\u539F\u5DE5\u5177\u540D\uFF1AcheckCollectionExists/describeCollection/listCollections\uFF0C\u4E3A\u517C\u5BB9\u65E7AI\u89C4\u5219\u53EF\u7EE7\u7EED\u4F7F\u7528\u8FD9\u4E9B\u540D\u79F0\uFF09",
|
|
4019
4030
|
inputSchema: {
|
|
4020
4031
|
action: z4.enum(["check", "describe", "list"]).describe("\u64CD\u4F5C\u7C7B\u578B\uFF1Acheck=\u68C0\u67E5\u662F\u5426\u5B58\u5728\uFF0Cdescribe=\u67E5\u770B\u8BE6\u60C5\uFF0Clist=\u5217\u8868\u67E5\u8BE2"),
|
|
4021
4032
|
collectionName: z4.string().optional().describe("\u96C6\u5408\u540D\u79F0\uFF08check\u3001describe\u64CD\u4F5C\u65F6\u5FC5\u586B\uFF09"),
|
|
@@ -5637,8 +5648,15 @@ var TelemetryReporter = class {
|
|
|
5637
5648
|
try {
|
|
5638
5649
|
mcpVersion = process.env.npm_package_version || "";
|
|
5639
5650
|
if (!mcpVersion) {
|
|
5640
|
-
|
|
5641
|
-
|
|
5651
|
+
let __dirname2;
|
|
5652
|
+
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
5653
|
+
const __filename2 = fileURLToPath2(import.meta.url);
|
|
5654
|
+
__dirname2 = dirname2(__filename2);
|
|
5655
|
+
} else if (typeof globalThis.__filename !== "undefined") {
|
|
5656
|
+
__dirname2 = dirname2(globalThis.__filename);
|
|
5657
|
+
} else {
|
|
5658
|
+
__dirname2 = process.cwd();
|
|
5659
|
+
}
|
|
5642
5660
|
const packageJsonPath = join3(__dirname2, "../../package.json");
|
|
5643
5661
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
5644
5662
|
mcpVersion = packageJson.version || "unknown";
|
|
@@ -5738,7 +5756,7 @@ var TelemetryReporter = class {
|
|
|
5738
5756
|
A101: this.userAgent,
|
|
5739
5757
|
// 运行环境信息
|
|
5740
5758
|
from: "cloudbase-mcp",
|
|
5741
|
-
xDeployEnv:
|
|
5759
|
+
xDeployEnv: "production",
|
|
5742
5760
|
...this.additionalParams
|
|
5743
5761
|
},
|
|
5744
5762
|
events: [
|