@mcpcloud/cli 0.17.1 → 0.17.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/README.md +1 -1
- package/dist/index.js +70 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -367,7 +367,7 @@ _Generated from the live command tree by `bun run docs:readme` — do not edit b
|
|
|
367
367
|
| `mcp servers test-suites get <suiteId>` | Show one server test suite including its scenario membership |
|
|
368
368
|
| `mcp servers test-suites list <server>` | List test suites bound to a server |
|
|
369
369
|
| `mcp servers test-suites run <server>` | Run the server’s test scenarios and report the suite result |
|
|
370
|
-
| `mcp servers update <server>` | Update a server (name, description, runtime token TTL) |
|
|
370
|
+
| `mcp servers update <server>` | Update a server (name, description, tool surface, upstream key mode, runtime token TTL) |
|
|
371
371
|
| `mcp servers variables` | Inspect and set the sandbox variables that scenario arguments reference |
|
|
372
372
|
| `mcp servers variables list <server>` | List a server’s sandbox variables and which ones still need a value |
|
|
373
373
|
| `mcp servers variables set <server>` | Set or clear sandbox variables (repeat --set; an empty value clears) |
|
package/dist/index.js
CHANGED
|
@@ -7674,10 +7674,37 @@ function registerServerExportCommands(servers) {
|
|
|
7674
7674
|
}));
|
|
7675
7675
|
}
|
|
7676
7676
|
|
|
7677
|
+
// src/lib/validate-choice.ts
|
|
7678
|
+
function validateChoice(name, value, allowed) {
|
|
7679
|
+
const trimmed = value.trim();
|
|
7680
|
+
const match = allowed.find((option) => option.toLowerCase() === trimmed.toLowerCase());
|
|
7681
|
+
if (!match) {
|
|
7682
|
+
throw new Error(`Invalid --${name}: ${value}. Expected one of: ${allowed.join(", ")}.`);
|
|
7683
|
+
}
|
|
7684
|
+
return match;
|
|
7685
|
+
}
|
|
7686
|
+
|
|
7677
7687
|
// src/commands/servers-lifecycle.ts
|
|
7678
7688
|
import { existsSync as existsSync6 } from "node:fs";
|
|
7679
7689
|
import { isAbsolute as isAbsolute2, resolve as resolve4 } from "node:path";
|
|
7680
7690
|
|
|
7691
|
+
// src/lib/deployment-display.ts
|
|
7692
|
+
function formatDeploymentExposure(deployment) {
|
|
7693
|
+
const exposure = deployment.exposureTarget ?? null;
|
|
7694
|
+
if (exposure === "platformSubdomain")
|
|
7695
|
+
return "Platform subdomain";
|
|
7696
|
+
if (exposure === "managedDomain")
|
|
7697
|
+
return "Premium subdomain";
|
|
7698
|
+
if (exposure === "workersDev")
|
|
7699
|
+
return "workers.dev";
|
|
7700
|
+
const target = deployment.target ?? null;
|
|
7701
|
+
if (target === "managedDomain")
|
|
7702
|
+
return "Premium subdomain";
|
|
7703
|
+
if (target === "workersDev")
|
|
7704
|
+
return "Platform default";
|
|
7705
|
+
return target ?? "unknown";
|
|
7706
|
+
}
|
|
7707
|
+
|
|
7681
7708
|
// src/lib/dev/spec-watcher.ts
|
|
7682
7709
|
import { createHash as createHash2 } from "node:crypto";
|
|
7683
7710
|
import {
|
|
@@ -7808,13 +7835,6 @@ var ACCESS_MODES = [
|
|
|
7808
7835
|
"privateOrg",
|
|
7809
7836
|
"unlisted"
|
|
7810
7837
|
];
|
|
7811
|
-
function validateChoice(name, value, allowed) {
|
|
7812
|
-
const v2 = value.trim();
|
|
7813
|
-
if (!allowed.includes(v2)) {
|
|
7814
|
-
throw new Error(`Invalid --${name}: ${value}. Expected one of: ${allowed.join(", ")}.`);
|
|
7815
|
-
}
|
|
7816
|
-
return v2;
|
|
7817
|
-
}
|
|
7818
7838
|
function reportDeployFailure(terminalEvent) {
|
|
7819
7839
|
if (!terminalEvent || !isFailureEvent(terminalEvent))
|
|
7820
7840
|
return false;
|
|
@@ -7899,8 +7919,17 @@ function registerServerLifecycleCommands(servers) {
|
|
|
7899
7919
|
}
|
|
7900
7920
|
}
|
|
7901
7921
|
const deployFailed = dep.status === "failed" || Boolean(terminalEvent && isFailureEvent(terminalEvent));
|
|
7922
|
+
let final = dep;
|
|
7923
|
+
if (opts.wait && waitDone) {
|
|
7924
|
+
try {
|
|
7925
|
+
const refreshed = await api.get(`/api/v1/server/deployments?organizationId=${encodeURIComponent(orgId)}&serverId=${encodeURIComponent(serverId)}&limit=5`);
|
|
7926
|
+
const row = (refreshed.deployments ?? []).find((entry) => entry.id === dep.deploymentId);
|
|
7927
|
+
if (row)
|
|
7928
|
+
final = { ...dep, ...row };
|
|
7929
|
+
} catch {}
|
|
7930
|
+
}
|
|
7902
7931
|
if (isJsonMode()) {
|
|
7903
|
-
printJson({ deployment:
|
|
7932
|
+
printJson({ deployment: final, waitDone, terminalEvent });
|
|
7904
7933
|
if (opts.wait && (!waitDone || deployFailed))
|
|
7905
7934
|
throw new CliExitError(1);
|
|
7906
7935
|
return;
|
|
@@ -7908,11 +7937,11 @@ function registerServerLifecycleCommands(servers) {
|
|
|
7908
7937
|
printSuccess(`Deployment ${c.bold(dep.deploymentId)} created.`);
|
|
7909
7938
|
printKeyValue({
|
|
7910
7939
|
id: dep.deploymentId,
|
|
7911
|
-
...
|
|
7912
|
-
|
|
7940
|
+
...final.deploymentUrl ? { url: final.deploymentUrl } : {},
|
|
7941
|
+
exposure: formatDeploymentExposure(final),
|
|
7913
7942
|
"access mode": dep.accessMode,
|
|
7914
|
-
status:
|
|
7915
|
-
health:
|
|
7943
|
+
status: final.status,
|
|
7944
|
+
health: final.healthStatus,
|
|
7916
7945
|
...terminalEvent ? {
|
|
7917
7946
|
"terminal event": `${terminalEvent.stage} (${terminalEvent.level}) — ${terminalEvent.message}`,
|
|
7918
7947
|
"terminal at": formatDate(terminalEvent.timestamp)
|
|
@@ -8200,23 +8229,41 @@ function registerServerMutationCommands(servers) {
|
|
|
8200
8229
|
created: formatDate(s.createdAt)
|
|
8201
8230
|
});
|
|
8202
8231
|
}));
|
|
8203
|
-
servers.command("update <server>").description("Update a server (name, description, runtime token TTL)").option("--org <organizationId>", "Organization ID").option("--name <name>", "New display name").option("--description <text>", "New description").option("--runtime-token-ttl <seconds|default>", 'Runtime token lifetime in seconds (60-86400; the default AND cap for minted tokens). Pass "default" to restore the 300s platform default.').addHelpText("after", [
|
|
8232
|
+
servers.command("update <server>").description("Update a server (name, description, tool surface, upstream key mode, runtime token TTL)").option("--org <organizationId>", "Organization ID").option("--name <name>", "New display name").option("--description <text>", "New description").option("--discovery-mode <all|wrapper>", 'Tool surface: "all" registers every operation; "wrapper" registers searchTools/getToolDefinition/useTool INSTEAD (operations are called through useTool).').option("--code-mode <off|opt-in|default>", "Code Mode: expose codemode_execute so an agent can script several calls in one sandboxed run. Served by the edge, so it takes effect on the next deploy.").option("--upstream-api-key-mode <shared|perMember>", "Whose upstream credential the server uses: one shared key, or each member their own (Pro and above).").option("--runtime-token-ttl <seconds|default>", 'Runtime token lifetime in seconds (60-86400; the default AND cap for minted tokens). Pass "default" to restore the 300s platform default.').addHelpText("after", [
|
|
8204
8233
|
"",
|
|
8205
8234
|
"Notes:",
|
|
8206
8235
|
" Runtime defaults (oauth, deploymentDefaults, runtime bindings) are not",
|
|
8207
|
-
" v1 PATCH-able. Change them via `mcp servers deploy --upstream-*`."
|
|
8236
|
+
" v1 PATCH-able. Change them via `mcp servers deploy --upstream-*`.",
|
|
8237
|
+
" --discovery-mode and --code-mode change the server's TOOL SURFACE and",
|
|
8238
|
+
" reach clients on the next `mcp servers deploy`. Check what is live with",
|
|
8239
|
+
" `mcp servers get <server> --probe`."
|
|
8208
8240
|
].join(`
|
|
8209
8241
|
`)).action(runAction(async (serverRef, opts) => {
|
|
8210
8242
|
const orgId = await resolveOrgId(opts.org);
|
|
8211
8243
|
const serverId = await resolveServerId(serverRef, orgId);
|
|
8244
|
+
const serverData = await api.get("/api/v1/server", { organizationId: orgId, serverId });
|
|
8212
8245
|
const body = {
|
|
8213
8246
|
organizationId: orgId,
|
|
8247
|
+
projectId: serverData.server.projectId,
|
|
8214
8248
|
serverId
|
|
8215
8249
|
};
|
|
8216
8250
|
if (opts.name !== undefined)
|
|
8217
8251
|
body["name"] = opts.name;
|
|
8218
8252
|
if (opts.description !== undefined)
|
|
8219
8253
|
body["description"] = opts.description;
|
|
8254
|
+
if (opts.discoveryMode !== undefined) {
|
|
8255
|
+
body["discoveryMode"] = validateChoice("discovery-mode", opts.discoveryMode, ["all", "wrapper"]);
|
|
8256
|
+
}
|
|
8257
|
+
if (opts.codeMode !== undefined) {
|
|
8258
|
+
body["codeModeMode"] = validateChoice("code-mode", opts.codeMode, [
|
|
8259
|
+
"off",
|
|
8260
|
+
"opt-in",
|
|
8261
|
+
"default"
|
|
8262
|
+
]);
|
|
8263
|
+
}
|
|
8264
|
+
if (opts.upstreamApiKeyMode !== undefined) {
|
|
8265
|
+
body["upstreamApiKeyMode"] = validateChoice("upstream-api-key-mode", opts.upstreamApiKeyMode, ["shared", "perMember"]);
|
|
8266
|
+
}
|
|
8220
8267
|
if (opts.runtimeTokenTtl !== undefined) {
|
|
8221
8268
|
if (opts.runtimeTokenTtl === "default") {
|
|
8222
8269
|
body["runtimeTokenTtlSeconds"] = null;
|
|
@@ -8228,8 +8275,8 @@ function registerServerMutationCommands(servers) {
|
|
|
8228
8275
|
body["runtimeTokenTtlSeconds"] = ttl;
|
|
8229
8276
|
}
|
|
8230
8277
|
}
|
|
8231
|
-
if (Object.keys(body).length ===
|
|
8232
|
-
throw new Error("Provide at least one of --name, --description, or --runtime-token-ttl.");
|
|
8278
|
+
if (Object.keys(body).length === 3) {
|
|
8279
|
+
throw new Error("Provide at least one of --name, --description, --discovery-mode, --code-mode, --upstream-api-key-mode, or --runtime-token-ttl.");
|
|
8233
8280
|
}
|
|
8234
8281
|
const data = await api.patch("/api/v1/server", body);
|
|
8235
8282
|
if (isJsonMode()) {
|
|
@@ -32385,18 +32432,11 @@ var SELECTOR_HELP = [
|
|
|
32385
32432
|
" $ mcp deployments get dep_123 # bare ids still work, no --server"
|
|
32386
32433
|
].join(`
|
|
32387
32434
|
`);
|
|
32388
|
-
function validateChoice4(name, value, allowed) {
|
|
32389
|
-
const v2 = value.trim().toLowerCase();
|
|
32390
|
-
if (!allowed.includes(v2)) {
|
|
32391
|
-
throw new Error(`Invalid --${name}: ${value}. Expected one of: ${allowed.join(", ")}.`);
|
|
32392
|
-
}
|
|
32393
|
-
return v2;
|
|
32394
|
-
}
|
|
32395
32435
|
function registerDeploymentCommands(program2) {
|
|
32396
32436
|
const deployments = program2.command("deployments").description("Inspect deployments");
|
|
32397
32437
|
deployments.command("list").description("List deployments in an organization").option("--org <organizationId>", "Organization ID").option("--status <status>", `Filter: ${DEPLOYMENT_STATUSES.join(" | ")}`, "active").option("--limit <n>", "Maximum results (default 25)", parsePositiveIntOption("limit"), "25").action(runAction(async (opts) => {
|
|
32398
32438
|
const orgId = await resolveOrgId(opts.org);
|
|
32399
|
-
const status =
|
|
32439
|
+
const status = validateChoice("status", opts.status, DEPLOYMENT_STATUSES);
|
|
32400
32440
|
const data = await api.get("/api/v1/deployments", {
|
|
32401
32441
|
organizationId: orgId,
|
|
32402
32442
|
status,
|
|
@@ -32406,7 +32446,7 @@ function registerDeploymentCommands(program2) {
|
|
|
32406
32446
|
id: d.id,
|
|
32407
32447
|
server: d.serverName,
|
|
32408
32448
|
project: d.projectName,
|
|
32409
|
-
|
|
32449
|
+
exposure: formatDeploymentExposure(d),
|
|
32410
32450
|
access: d.accessMode,
|
|
32411
32451
|
status: d.status,
|
|
32412
32452
|
version: d.version,
|
|
@@ -32443,7 +32483,7 @@ function registerDeploymentCommands(program2) {
|
|
|
32443
32483
|
project: `${d.projectName} (${d.projectId})`,
|
|
32444
32484
|
url: d.deploymentUrl ?? "—",
|
|
32445
32485
|
hostname: d.hostname ?? "—",
|
|
32446
|
-
|
|
32486
|
+
exposure: formatDeploymentExposure(d),
|
|
32447
32487
|
"access mode": d.accessMode,
|
|
32448
32488
|
status: d.status,
|
|
32449
32489
|
version: d.version,
|
|
@@ -32541,7 +32581,7 @@ function registerDeploymentCommands(program2) {
|
|
|
32541
32581
|
status: d.status,
|
|
32542
32582
|
"access mode": d.accessMode,
|
|
32543
32583
|
url: d.deploymentUrl ?? "—",
|
|
32544
|
-
|
|
32584
|
+
exposure: formatDeploymentExposure(d),
|
|
32545
32585
|
version: d.version,
|
|
32546
32586
|
demoted: d.demotedDeploymentId ?? "—",
|
|
32547
32587
|
"rolled back at": formatDate(d.rolledBackAt)
|
|
@@ -34140,7 +34180,7 @@ async function resolveArtifactId(reference, scope = {}) {
|
|
|
34140
34180
|
// src/commands/marketplace.ts
|
|
34141
34181
|
var ARTIFACT_TYPE_FILTERS = ["all", "server", "skill"];
|
|
34142
34182
|
var ACCESS_FILTERS = ["all", "public", "privateOrg"];
|
|
34143
|
-
function
|
|
34183
|
+
function validateChoice4(name, value, allowed) {
|
|
34144
34184
|
const v2 = value.trim();
|
|
34145
34185
|
if (!allowed.includes(v2)) {
|
|
34146
34186
|
throw new Error(`Invalid --${name}: ${value}. Expected one of: ${allowed.join(", ")}.`);
|
|
@@ -34158,8 +34198,8 @@ function registerMarketplaceCommands(program2) {
|
|
|
34158
34198
|
" $ mcp --json marketplace list --type server | jq '.artifacts[].id'"
|
|
34159
34199
|
].join(`
|
|
34160
34200
|
`)).action(runAction(async (opts) => {
|
|
34161
|
-
const artifactType =
|
|
34162
|
-
const access =
|
|
34201
|
+
const artifactType = validateChoice4("type", opts.type, ARTIFACT_TYPE_FILTERS);
|
|
34202
|
+
const access = validateChoice4("access", opts.access, ACCESS_FILTERS);
|
|
34163
34203
|
const params = { limit: opts.limit };
|
|
34164
34204
|
if (artifactType !== "all")
|
|
34165
34205
|
params["artifactType"] = artifactType;
|