@mcpcloud/cli 0.24.0 → 0.24.1-next-20260922014410
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 +5 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6220,10 +6220,6 @@ function parseToolList(raw) {
|
|
|
6220
6220
|
}
|
|
6221
6221
|
return trimmed.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
6222
6222
|
}
|
|
6223
|
-
async function listServerToolNames(orgId, projectId, serverId) {
|
|
6224
|
-
const { rows } = await fetchAllPagesWithEnvelope("/api/v1/project/tools", { organizationId: orgId, projectId }, "tools");
|
|
6225
|
-
return rows.filter((row) => row.serverId === serverId).map((row) => row.name).sort((left, right) => left.localeCompare(right));
|
|
6226
|
-
}
|
|
6227
6223
|
function registerServerEndUserCommands(servers) {
|
|
6228
6224
|
const endUser = servers.command("end-user").alias("end-users").description("Read and set a server's end-user plane: the access switch and the tool allowlist customers may call.");
|
|
6229
6225
|
endUser.command("get <server>").description("Show the end-user access configuration: switch, connect page, allowed tools, branding, and how customers sign in.").option("--org <organizationId>", "Organization ID").addHelpText("after", [
|
|
@@ -6269,18 +6265,14 @@ function registerServerEndUserCommands(servers) {
|
|
|
6269
6265
|
const current = await readEndUserAccess(serverRef, opts);
|
|
6270
6266
|
const orgId = await resolveOrgId(opts.org);
|
|
6271
6267
|
const enabled = opts.enable ? true : opts.disable ? false : current.endUserAccess === "enabled";
|
|
6272
|
-
|
|
6273
|
-
if (opts.allowTools) {
|
|
6274
|
-
allowedTools = parseToolList(opts.allowTools);
|
|
6275
|
-
} else if (opts.allowAllTools) {
|
|
6276
|
-
allowedTools = await listServerToolNames(orgId, current.server.projectId, current.server.id);
|
|
6277
|
-
}
|
|
6268
|
+
const allowedTools = opts.allowTools ? parseToolList(opts.allowTools) : null;
|
|
6278
6269
|
await api.put(END_USER_PATH, {
|
|
6279
6270
|
organizationId: orgId,
|
|
6280
6271
|
projectId: current.server.projectId,
|
|
6281
6272
|
serverId: current.server.id,
|
|
6282
6273
|
enabled,
|
|
6283
|
-
...allowedTools === null ? {} : { allowedTools }
|
|
6274
|
+
...allowedTools === null ? {} : { allowedTools },
|
|
6275
|
+
...opts.allowAllTools ? { allowAllTools: true } : {}
|
|
6284
6276
|
});
|
|
6285
6277
|
const updated = await readEndUserAccess(serverRef, opts);
|
|
6286
6278
|
if (isJsonMode()) {
|
|
@@ -29795,7 +29787,7 @@ function collectScope(value, previous) {
|
|
|
29795
29787
|
}
|
|
29796
29788
|
function grantBodyFromOptions(opts) {
|
|
29797
29789
|
if (opts.preset && opts.scope && opts.scope.length > 0) {
|
|
29798
|
-
throw new Error("--preset and --scope are mutually exclusive.");
|
|
29790
|
+
throw new Error("--preset and --scope are mutually exclusive. To take a preset and add to it, create the key with --preset, read the scopes it printed, then create another with those plus your extra --scope flags.");
|
|
29799
29791
|
}
|
|
29800
29792
|
return {
|
|
29801
29793
|
...opts.preset ? { preset: opts.preset } : {},
|
|
@@ -29849,7 +29841,7 @@ function registerApiKeyCommands(program) {
|
|
|
29849
29841
|
{ key: "expires", label: "Expires", width: 22 }
|
|
29850
29842
|
], data);
|
|
29851
29843
|
}));
|
|
29852
|
-
apiKeys.command("create").description("Create a new API key (the secret is shown once)").requiredOption("--name <name>", "Display name for the key").option("--expires-in <duration>", "Auto-expire the key after this long: 90d, 12w, 6m, or a day count (1–365). Default: never.").option("--preset <preset>", "Scope preset: full, agent, read-only, ci-deploy (redeploy the stored bundle), or ci-build (also regenerate
|
|
29844
|
+
apiKeys.command("create").description("Create a new API key (the secret is shown once)").requiredOption("--name <name>", "Display name for the key").option("--expires-in <duration>", "Auto-expire the key after this long: 90d, 12w, 6m, or a day count (1–365). Default: never.").option("--preset <preset>", "Scope preset: full, agent, read-only, ci-deploy (redeploy the stored bundle), or ci-build (also push a spec, regenerate, deploy, test and set end-user access). Default: full authority. The exact scopes a preset resolves to are printed when the key is created, and by `mcp api-keys list --json`.").option("--scope <scope>", "Grant a single scope (repeatable, e.g. --scope servers:read --scope servers:deploy). Mutually exclusive with --preset.", collectScope, []).option("--org <orgId>", "Pin the key to one organization (must be one you belong to).").action(runAction(async (opts) => {
|
|
29853
29845
|
const name = opts.name.trim();
|
|
29854
29846
|
if (!name)
|
|
29855
29847
|
throw new Error("--name must not be empty.");
|
package/package.json
CHANGED