@mcpcloud/cli 0.22.1-next-20260907002512 → 0.22.2-next-20260909201421
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 +108 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -569,7 +569,7 @@ _Generated from the live command tree by `bun run docs:readme` — do not edit b
|
|
|
569
569
|
| `mcp skills delete <skill>` | Permanently delete a draft skill. Requires --confirm "<exact name>". Published skills with versions/installs are rejected (archive instead). |
|
|
570
570
|
| `mcp skills deploy <skill>` | Deploy a published skill version as an MCP endpoint (newest version by default) |
|
|
571
571
|
| `mcp skills get <skill>` | Get details for a single skill (accepts id or name) |
|
|
572
|
-
| `mcp skills install <skill>` | Install a skill into the caller's project |
|
|
572
|
+
| `mcp skills install <skill>` | Install a skill into the caller's project, or a marketplace skill by registry artifact id |
|
|
573
573
|
| `mcp skills installations <skill>` | List the installation footprint of a skill (which orgs / users installed it) |
|
|
574
574
|
| `mcp skills invoke <skill>` | Run a deployed skill from the terminal. Resolves the skill’s MCP endpoint, auto-discovers its single tool, and calls it. |
|
|
575
575
|
| `mcp skills list` | List skills in an organization |
|
package/dist/index.js
CHANGED
|
@@ -11536,36 +11536,6 @@ function registerSkillMutationCommands(skills) {
|
|
|
11536
11536
|
}
|
|
11537
11537
|
printSuccess(`Deleted skill ${data.deleted.name} (${data.deleted.id}).`);
|
|
11538
11538
|
}));
|
|
11539
|
-
skills.command("install <skill>").description("Install a skill into the caller's project").option("--org <organizationId>", "Organization ID").option("--project <project>", "Project (id or name; defaults to the skill's project)").option("--pin <semver>", "Pin a specific skill version (sent as `version` on the wire)").option("--config <json>", "Per-installation runtime config (passed verbatim to the skill)").action(runAction(async (skillRef, opts) => {
|
|
11540
|
-
const orgId = await resolveOrgId(opts.org);
|
|
11541
|
-
const projectOverride = await resolveOptionalProjectId(opts.project, orgId);
|
|
11542
|
-
const skillId = await resolveSkillId(skillRef, orgId, projectOverride);
|
|
11543
|
-
const { projectId } = await resolveSkillProject(orgId, skillId, projectOverride);
|
|
11544
|
-
const body = {
|
|
11545
|
-
organizationId: orgId,
|
|
11546
|
-
projectId,
|
|
11547
|
-
skillId
|
|
11548
|
-
};
|
|
11549
|
-
if (opts.pin !== undefined)
|
|
11550
|
-
body["version"] = opts.pin;
|
|
11551
|
-
if (opts.config !== undefined)
|
|
11552
|
-
body["config"] = opts.config;
|
|
11553
|
-
const data = await api.post("/api/v1/skill/install", body);
|
|
11554
|
-
if (isJsonMode()) {
|
|
11555
|
-
printJson(data);
|
|
11556
|
-
return;
|
|
11557
|
-
}
|
|
11558
|
-
const i = data.installation;
|
|
11559
|
-
printSuccess(`Skill ${skillId} installed (installation ${i.id}).`);
|
|
11560
|
-
printKeyValue({
|
|
11561
|
-
"installation id": i.id,
|
|
11562
|
-
"skill id": i.artifactId,
|
|
11563
|
-
version: i.version,
|
|
11564
|
-
status: i.status,
|
|
11565
|
-
"project id": projectId,
|
|
11566
|
-
installed: formatDate(i.createdAt)
|
|
11567
|
-
});
|
|
11568
|
-
}));
|
|
11569
11539
|
skills.command("uninstall <skill>").description("Mark the caller's installation of this skill as removed").option("--org <organizationId>", "Organization ID").option("--project <project>", "Project (id or name; defaults to the skill's project)").action(runAction(async (skillRef, opts) => {
|
|
11570
11540
|
const orgId = await resolveOrgId(opts.org);
|
|
11571
11541
|
const projectOverride = await resolveOptionalProjectId(opts.project, orgId);
|
|
@@ -12056,6 +12026,113 @@ function invokeResultToJson(result) {
|
|
|
12056
12026
|
};
|
|
12057
12027
|
}
|
|
12058
12028
|
|
|
12029
|
+
// src/commands/skills-install.ts
|
|
12030
|
+
async function probeRegistryArtifact(artifactId) {
|
|
12031
|
+
try {
|
|
12032
|
+
const data = await api.get("/api/v1/registry/artifact", { artifactId });
|
|
12033
|
+
return data.artifact ?? null;
|
|
12034
|
+
} catch (error) {
|
|
12035
|
+
if (error instanceof McpCloudApiError)
|
|
12036
|
+
return null;
|
|
12037
|
+
throw error;
|
|
12038
|
+
}
|
|
12039
|
+
}
|
|
12040
|
+
function isSkillMiss(error) {
|
|
12041
|
+
if (error instanceof CliExitError)
|
|
12042
|
+
return true;
|
|
12043
|
+
return error instanceof McpCloudApiError && error.status === 404;
|
|
12044
|
+
}
|
|
12045
|
+
async function resolveInstallTarget(ref, orgId, projectOverride) {
|
|
12046
|
+
let skillMiss;
|
|
12047
|
+
try {
|
|
12048
|
+
const skillId = await resolveSkillId(ref, orgId, projectOverride);
|
|
12049
|
+
const { projectId } = await resolveSkillProject(orgId, skillId, projectOverride);
|
|
12050
|
+
return { kind: "skill", projectId, skillId };
|
|
12051
|
+
} catch (error) {
|
|
12052
|
+
if (!isSkillMiss(error) || !isIdShape(ref.trim()))
|
|
12053
|
+
throw error;
|
|
12054
|
+
skillMiss = error;
|
|
12055
|
+
}
|
|
12056
|
+
const artifact = await probeRegistryArtifact(ref.trim());
|
|
12057
|
+
if (!artifact)
|
|
12058
|
+
throw skillMiss;
|
|
12059
|
+
if (artifact.artifactType !== "skill") {
|
|
12060
|
+
throw new CliExitError(1, `${ref} is a marketplace ${artifact.artifactType}, not a skill. Install it with \`mcp marketplace install ${ref}\`.`);
|
|
12061
|
+
}
|
|
12062
|
+
return { artifact, kind: "registry" };
|
|
12063
|
+
}
|
|
12064
|
+
async function installRegistryArtifact(artifact, orgId, opts, projectOverride) {
|
|
12065
|
+
if (projectOverride || opts.config !== undefined) {
|
|
12066
|
+
throw new CliExitError(1, `${artifact.name} is a marketplace skill: it installs into your organization as published, so --project and --config do not apply. Re-run without them.`);
|
|
12067
|
+
}
|
|
12068
|
+
const data = await api.post("/api/v1/registry/install", {
|
|
12069
|
+
organizationId: orgId,
|
|
12070
|
+
artifactId: artifact.id,
|
|
12071
|
+
...opts.pin !== undefined ? { version: opts.pin } : {}
|
|
12072
|
+
});
|
|
12073
|
+
if (isJsonMode()) {
|
|
12074
|
+
printJson(data);
|
|
12075
|
+
return;
|
|
12076
|
+
}
|
|
12077
|
+
const i = data.installation;
|
|
12078
|
+
printSuccess(`Installed marketplace skill ${c.bold(artifact.name)} v${i.version} (installation ${i.id}).`);
|
|
12079
|
+
printKeyValue({
|
|
12080
|
+
"installation id": i.id,
|
|
12081
|
+
"artifact id": i.primaryArtifactId,
|
|
12082
|
+
version: i.version,
|
|
12083
|
+
status: i.status
|
|
12084
|
+
});
|
|
12085
|
+
printStep(`Fetch it for your agent: \`mcp skills pull ${artifact.id}\``);
|
|
12086
|
+
}
|
|
12087
|
+
function registerSkillInstallCommand(skills) {
|
|
12088
|
+
skills.command("install <skill>").description("Install a skill into the caller's project, or a marketplace skill by registry artifact id").option("--org <organizationId>", "Organization ID").option("--project <project>", "Project (id or name; defaults to the skill's project)").option("--pin <semver>", "Pin a specific skill version (sent as `version` on the wire)").option("--config <json>", "Per-installation runtime config (passed verbatim to the skill)").addHelpText("after", [
|
|
12089
|
+
"",
|
|
12090
|
+
"Notes:",
|
|
12091
|
+
" <skill> is a skill in your organization (id, name, or project/name).",
|
|
12092
|
+
" A marketplace registry artifact id installs that published skill into",
|
|
12093
|
+
" your organization instead (same as `mcp marketplace install`);",
|
|
12094
|
+
" --project and --config do not apply there.",
|
|
12095
|
+
"",
|
|
12096
|
+
"Examples:",
|
|
12097
|
+
' $ mcp skills install "Refund flow" --pin 1.2.0',
|
|
12098
|
+
" $ mcp skills install p179hst... # a marketplace skill, by artifact id",
|
|
12099
|
+
" $ mcp skills pull p179hst... # then fetch its SKILL.md"
|
|
12100
|
+
].join(`
|
|
12101
|
+
`)).action(runAction(async (skillRef, opts) => {
|
|
12102
|
+
const orgId = await resolveOrgId(opts.org);
|
|
12103
|
+
const projectOverride = await resolveOptionalProjectId(opts.project, orgId);
|
|
12104
|
+
const target = await resolveInstallTarget(skillRef, orgId, projectOverride);
|
|
12105
|
+
if (target.kind === "registry") {
|
|
12106
|
+
await installRegistryArtifact(target.artifact, orgId, opts, projectOverride);
|
|
12107
|
+
return;
|
|
12108
|
+
}
|
|
12109
|
+
const body = {
|
|
12110
|
+
organizationId: orgId,
|
|
12111
|
+
projectId: target.projectId,
|
|
12112
|
+
skillId: target.skillId
|
|
12113
|
+
};
|
|
12114
|
+
if (opts.pin !== undefined)
|
|
12115
|
+
body["version"] = opts.pin;
|
|
12116
|
+
if (opts.config !== undefined)
|
|
12117
|
+
body["config"] = opts.config;
|
|
12118
|
+
const data = await api.post("/api/v1/skill/install", body);
|
|
12119
|
+
if (isJsonMode()) {
|
|
12120
|
+
printJson(data);
|
|
12121
|
+
return;
|
|
12122
|
+
}
|
|
12123
|
+
const i = data.installation;
|
|
12124
|
+
printSuccess(`Skill ${target.skillId} installed (installation ${i.id}).`);
|
|
12125
|
+
printKeyValue({
|
|
12126
|
+
"installation id": i.id,
|
|
12127
|
+
"skill id": i.artifactId,
|
|
12128
|
+
version: i.version,
|
|
12129
|
+
status: i.status,
|
|
12130
|
+
"project id": target.projectId,
|
|
12131
|
+
installed: formatDate(i.createdAt)
|
|
12132
|
+
});
|
|
12133
|
+
}));
|
|
12134
|
+
}
|
|
12135
|
+
|
|
12059
12136
|
// src/commands/skills-pull.ts
|
|
12060
12137
|
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync7 } from "node:fs";
|
|
12061
12138
|
import { dirname as dirname6, isAbsolute as isAbsolute3, join as join11, resolve as resolve7 } from "node:path";
|
|
@@ -12259,6 +12336,7 @@ async function runClaudeMcpAdd(connectionName, mcpUrl, bearerToken) {
|
|
|
12259
12336
|
function registerSkillCommands(program) {
|
|
12260
12337
|
const skills = program.command("skills").description("Manage skills");
|
|
12261
12338
|
registerSkillMutationCommands(skills);
|
|
12339
|
+
registerSkillInstallCommand(skills);
|
|
12262
12340
|
registerSkillLifecycleCommands(skills);
|
|
12263
12341
|
registerSkillTestCommands(skills);
|
|
12264
12342
|
registerSkillInvokeCommand(skills);
|
package/package.json
CHANGED