@mcpjam/cli 5.2.0 → 5.3.0
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 +271 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Command, CommanderError, Option } from 'commander';
|
|
3
3
|
import { realpathSync, readFileSync, existsSync, mkdirSync, writeFileSync, unlinkSync, statSync, closeSync, renameSync, openSync } from 'fs';
|
|
4
4
|
import { pathToFileURL } from 'url';
|
|
5
|
-
import { probeMcpServer, redactForTelemetry, runServerDoctor, collectServerSnapshot, serializeStableServerSnapshot, serializeServerSnapshot, buildServerDiffReport, classifyMcpHeader, validateToolCallResult, isCallToolResultError, buildToolCallValidationReport, listResources, readResource, SubscriptionCoordinator, listTools, listPrompts, getPrompt, MCPAppsConformanceTest, scoreFromAppsResult, MCPAppsConformanceSuite, MCPTasksConformanceTest, scoreFromTasksResult, runOAuthLogin, OAuthConformanceTest, scoreFromOAuthResult, OAuthConformanceSuite, runXaaFlow, MCPConformanceTest, scoreFromProtocolResult, MCPConformanceSuite, runConformance, isConformanceReportingConfigured, reportConformanceRun, reportConformanceRunSafely, OPENAI_SUBMISSION_MODES, withEphemeralClient, diffServerSnapshots, ServerSnapshotFormatError, renderStructuredRunJUnitXml, renderStructuredRunHtml, renderStructuredRunJson, DEFAULT_SUBSCRIPTION_RECONNECT_POLICY, isKnownProtocolVersion, describeConformanceScore, toConformanceReport, buildConformanceRunReport, renderConformanceReportJUnitXml, renderConformanceReportJson, formatOAuthConformanceHuman, formatOAuthConformanceSuiteHuman, fetchOAuthMetadata, executeOAuthProxy, executeDebugOAuthProxy, normalizeRegistrationStrategy, normalizeXaaClientAuth, normalizeIdentityAssertionFormat, IDENTITY_ASSERTION_FORMATS, XAA_CONFIDENTIAL_CIMD_ORIGIN, getLocalConfidentialCimdProvider, MCP_PROTOCOL_VERSIONS, gatherClaudeReadinessEvidence, gradeClaudeReadiness, gatherOpenAIReadinessEvidence, xmldomParseXml, gradeOpenAIReadiness, openUrlInBrowser, buildEvalRunReport, GATE_WAIVER_MAX_REASON_LENGTH, GATE_WAIVER_REASON_NOTICE, MCPClientManager, decodeMcpHeaderValue, canDeclareTasksExtension, createStrictElicitationContentValidator, MCP_APPS_CHECK_CATEGORIES, MCP_APPS_CHECK_IDS, MCP_TASKS_CHECK_CATEGORIES, MCP_TASKS_CHECK_IDS, OAuthProxyError, isLoopbackHost, MCP_CHECK_CATEGORIES, MCP_CHECK_IDS, OPENAI_SUBMISSION_MODE_SHAPES, createDirectoryPluginFileSource, collectZipArchiveObservations, createZipPluginFileSource, generateRandomString, generateCodeChallenge, createInteractiveAuthorizationSession, loadEvalSuiteFile, declareEvalSuiteFileValidity, formatEvalRunDecisionSummary, gateOutcomeVerdict, applyGateWaiver, formatGateReport, formatGateWaiverLine, detectFlakyCases, evaluateCompareGates, buildRunCompareReport, formatSuiteFileFindings, serializeEvalSuiteFile, MAX_SUITE_FILE_BYTES, buildCorpus, HostedOnlyCaseError, verifyCorpusLock, TaskLifecycleEngine, driveTaskToTerminal, extensionTaskToObservation, legacyTaskToObservation, canonicalDigest, readEvalRunDecisionSummary as readEvalRunDecisionSummary$1, buildEvalRunDecisionSummary, evaluateGates, gateInputFromPlatformRun, isGateWaiverInForce, calculateLatencyStats, CORPUS_LOCK_VERSION, suiteFilePointer, passRateFractionFromPercent, DEFAULT_MIN_EFFECT_SIZE, DEFAULT_MIN_SAMPLE_SIZE, isUnknownTaskError, isMCPTasksWireError, LEGACY_TASK_STATUSES } from '@mcpjam/sdk';
|
|
5
|
+
import { probeMcpServer, redactForTelemetry, runServerDoctor, collectServerSnapshot, serializeStableServerSnapshot, serializeServerSnapshot, buildServerDiffReport, classifyMcpHeader, validateToolCallResult, isCallToolResultError, buildToolCallValidationReport, listResources, readResource, listServerSkillCatalog, getVerifiedServerSkill, isServerSkillRefusalError, readVerifiedServerSkillFile, SubscriptionCoordinator, listTools, listPrompts, getPrompt, MCPAppsConformanceTest, scoreFromAppsResult, MCPAppsConformanceSuite, MCPTasksConformanceTest, scoreFromTasksResult, runOAuthLogin, OAuthConformanceTest, scoreFromOAuthResult, OAuthConformanceSuite, runXaaFlow, MCPConformanceTest, scoreFromProtocolResult, MCPConformanceSuite, runConformance, isConformanceReportingConfigured, reportConformanceRun, reportConformanceRunSafely, OPENAI_SUBMISSION_MODES, withEphemeralClient, diffServerSnapshots, ServerSnapshotFormatError, renderStructuredRunJUnitXml, renderStructuredRunHtml, renderStructuredRunJson, DEFAULT_SUBSCRIPTION_RECONNECT_POLICY, isKnownProtocolVersion, describeConformanceScore, toConformanceReport, buildConformanceRunReport, renderConformanceReportJUnitXml, renderConformanceReportJson, formatOAuthConformanceHuman, formatOAuthConformanceSuiteHuman, fetchOAuthMetadata, executeOAuthProxy, executeDebugOAuthProxy, normalizeRegistrationStrategy, normalizeXaaClientAuth, normalizeIdentityAssertionFormat, IDENTITY_ASSERTION_FORMATS, XAA_CONFIDENTIAL_CIMD_ORIGIN, getLocalConfidentialCimdProvider, MCP_PROTOCOL_VERSIONS, gatherClaudeReadinessEvidence, gradeClaudeReadiness, gatherOpenAIReadinessEvidence, xmldomParseXml, gradeOpenAIReadiness, openUrlInBrowser, buildEvalRunReport, GATE_WAIVER_MAX_REASON_LENGTH, GATE_WAIVER_REASON_NOTICE, MCPClientManager, withSkillsExtensionCapability, MCP_SKILLS_EXTENSION_ID, decodeMcpHeaderValue, canDeclareTasksExtension, createStrictElicitationContentValidator, MCP_APPS_CHECK_CATEGORIES, MCP_APPS_CHECK_IDS, MCP_TASKS_CHECK_CATEGORIES, MCP_TASKS_CHECK_IDS, OAuthProxyError, isLoopbackHost, MCP_CHECK_CATEGORIES, MCP_CHECK_IDS, OPENAI_SUBMISSION_MODE_SHAPES, createDirectoryPluginFileSource, collectZipArchiveObservations, createZipPluginFileSource, generateRandomString, generateCodeChallenge, createInteractiveAuthorizationSession, loadEvalSuiteFile, declareEvalSuiteFileValidity, formatEvalRunDecisionSummary, gateOutcomeVerdict, applyGateWaiver, formatGateReport, formatGateWaiverLine, detectFlakyCases, evaluateCompareGates, buildRunCompareReport, formatSuiteFileFindings, serializeEvalSuiteFile, MAX_SUITE_FILE_BYTES, buildCorpus, HostedOnlyCaseError, verifyCorpusLock, TaskLifecycleEngine, driveTaskToTerminal, extensionTaskToObservation, legacyTaskToObservation, canonicalDigest, readEvalRunDecisionSummary as readEvalRunDecisionSummary$1, buildEvalRunDecisionSummary, evaluateGates, gateInputFromPlatformRun, isGateWaiverInForce, calculateLatencyStats, CORPUS_LOCK_VERSION, suiteFilePointer, passRateFractionFromPercent, DEFAULT_MIN_EFFECT_SIZE, DEFAULT_MIN_SAMPLE_SIZE, isUnknownTaskError, isMCPTasksWireError, LEGACY_TASK_STATUSES } from '@mcpjam/sdk';
|
|
6
6
|
import path7, { join, dirname, basename } from 'path';
|
|
7
7
|
import { randomUUID, randomBytes, createHash } from 'crypto';
|
|
8
8
|
import { mkdir, writeFile, readFile, chmod, rename, rm, open, unlink, stat } from 'fs/promises';
|
|
@@ -27,7 +27,7 @@ import { PostHog } from 'posthog-node';
|
|
|
27
27
|
|
|
28
28
|
// package.json
|
|
29
29
|
var package_default = {
|
|
30
|
-
version: "5.
|
|
30
|
+
version: "5.3.0"};
|
|
31
31
|
function conformanceExitCode(result) {
|
|
32
32
|
if (result.outcome === "incomplete") return 3;
|
|
33
33
|
if (result.outcome === "failed") return 1;
|
|
@@ -5898,6 +5898,7 @@ function buildSuiteFileFromPlatform(input) {
|
|
|
5898
5898
|
cases: cases.map((evalCase, index) => ({
|
|
5899
5899
|
id: caseIds[index],
|
|
5900
5900
|
title: evalCase.title,
|
|
5901
|
+
...evalCase.intent === void 0 ? {} : { intent: evalCase.intent },
|
|
5901
5902
|
...evalCase.iterations === repetitions ? {} : { repetitions: evalCase.iterations },
|
|
5902
5903
|
...evalCase.isNegative ? { isNegativeTest: true } : {},
|
|
5903
5904
|
...evalCase.expectedOutput === void 0 || evalCase.expectedOutput === null ? {} : { expectedOutput: evalCase.expectedOutput },
|
|
@@ -5976,6 +5977,7 @@ function fileCaseToCreateBody(testCase) {
|
|
|
5976
5977
|
return {
|
|
5977
5978
|
id: testCase.id,
|
|
5978
5979
|
title: testCase.title,
|
|
5980
|
+
...testCase.intent !== void 0 ? { intent: testCase.intent } : {},
|
|
5979
5981
|
steps: testCase.steps,
|
|
5980
5982
|
iterations: testCase.repetitions,
|
|
5981
5983
|
repetitions: testCase.repetitions,
|
|
@@ -5995,6 +5997,9 @@ function fileCaseToCreateBody(testCase) {
|
|
|
5995
5997
|
function fileCaseToUpdateBody(testCase) {
|
|
5996
5998
|
return {
|
|
5997
5999
|
title: testCase.title,
|
|
6000
|
+
// A file re-sync is authoritative: unlike an ordinary PATCH, a missing
|
|
6001
|
+
// label must clear the old one rather than preserve stale attribution.
|
|
6002
|
+
intent: testCase.intent ?? null,
|
|
5998
6003
|
steps: testCase.steps,
|
|
5999
6004
|
iterations: testCase.repetitions,
|
|
6000
6005
|
repetitions: testCase.repetitions,
|
|
@@ -14454,12 +14459,31 @@ function applyInteractiveElicitationCapability(config) {
|
|
|
14454
14459
|
}
|
|
14455
14460
|
};
|
|
14456
14461
|
}
|
|
14462
|
+
function applySkillsExtensionCapability(config) {
|
|
14463
|
+
const exact = config.clientCapabilities;
|
|
14464
|
+
if (exact) {
|
|
14465
|
+
const extensions = isRecord3(exact.extensions) ? exact.extensions : {};
|
|
14466
|
+
if (extensions[MCP_SKILLS_EXTENSION_ID] == null) {
|
|
14467
|
+
throw usageError(
|
|
14468
|
+
`\`skills\` requires the advertised client capabilities to include the \`${MCP_SKILLS_EXTENSION_ID}\` extension, but --client-capabilities/--host pinned an exact set without it. That host would not see this server's skills at all. Add \`"extensions": { "${MCP_SKILLS_EXTENSION_ID}": {} }\` to the capabilities, or drop the host pin.`
|
|
14469
|
+
);
|
|
14470
|
+
}
|
|
14471
|
+
return config;
|
|
14472
|
+
}
|
|
14473
|
+
return {
|
|
14474
|
+
...config,
|
|
14475
|
+
capabilities: withSkillsExtensionCapability(
|
|
14476
|
+
config.capabilities ?? {}
|
|
14477
|
+
)
|
|
14478
|
+
};
|
|
14479
|
+
}
|
|
14457
14480
|
function isRecord3(value) {
|
|
14458
14481
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
14459
14482
|
}
|
|
14460
14483
|
async function withEphemeralManager(config, fn, options) {
|
|
14461
14484
|
const hostConfig = options?.host ? applyHostToConfig(config, options.host) : config;
|
|
14462
|
-
const
|
|
14485
|
+
const elicitationConfig = options?.interactiveElicitation ? applyInteractiveElicitationCapability(hostConfig) : hostConfig;
|
|
14486
|
+
const resolvedConfig = options?.skillsExtension ? applySkillsExtensionCapability(elicitationConfig) : elicitationConfig;
|
|
14463
14487
|
return withEphemeralClient(resolvedConfig, fn, {
|
|
14464
14488
|
serverId: "__cli__",
|
|
14465
14489
|
clientName: "mcpjam",
|
|
@@ -14874,7 +14898,7 @@ function formatServerDoctorHuman(result, options = {}) {
|
|
|
14874
14898
|
`Connection: ${result.connection.status} (${result.connection.detail})`
|
|
14875
14899
|
);
|
|
14876
14900
|
lines.push(
|
|
14877
|
-
`Counts: tools ${result.tools.length}, resources ${result.resources.length}, resourceTemplates ${result.resourceTemplates.length}, prompts ${result.prompts.length}`
|
|
14901
|
+
`Counts: tools ${result.tools.length}, resources ${result.resources.length}, resourceTemplates ${result.resourceTemplates.length}, prompts ${result.prompts.length}, skills ${result.skills.length}`
|
|
14878
14902
|
);
|
|
14879
14903
|
if (result.status === "oauth_required" && result.probe) {
|
|
14880
14904
|
const strategies = result.probe.oauth.registrationStrategies.join(", ") || "none";
|
|
@@ -15087,7 +15111,16 @@ function createMcpJamMcpServer(options) {
|
|
|
15087
15111
|
{
|
|
15088
15112
|
defaultClientName: "mcpjam",
|
|
15089
15113
|
defaultClientVersion: options.version,
|
|
15090
|
-
defaultTimeout: defaultTimeoutMs
|
|
15114
|
+
defaultTimeout: defaultTimeoutMs,
|
|
15115
|
+
// Skills over MCP is mutually declared, so `skills/*` is refused to a
|
|
15116
|
+
// client that never advertised it — the skill tools below would be
|
|
15117
|
+
// correct and useless without this.
|
|
15118
|
+
//
|
|
15119
|
+
// On DEFAULTS rather than per-server `clientCapabilities`, which the
|
|
15120
|
+
// manager advertises verbatim: a verbatim set would drop whatever else
|
|
15121
|
+
// the defaults carry, and would also override a caller who pinned their
|
|
15122
|
+
// own set. Defaults merge, and a pinned set still wins.
|
|
15123
|
+
defaultCapabilities: withSkillsExtensionCapability({})
|
|
15091
15124
|
}
|
|
15092
15125
|
);
|
|
15093
15126
|
const notifications = [];
|
|
@@ -15326,6 +15359,78 @@ function createMcpJamMcpServer(options) {
|
|
|
15326
15359
|
return manager.readResource(name, { uri });
|
|
15327
15360
|
})
|
|
15328
15361
|
);
|
|
15362
|
+
server.registerTool(
|
|
15363
|
+
"list_skills",
|
|
15364
|
+
{
|
|
15365
|
+
title: "List the target server's skills",
|
|
15366
|
+
description: "List the Agent Skills a connected server serves over the skills extension (SEP-2640), including ones it advertises that cannot be verified, each with the reason.",
|
|
15367
|
+
inputSchema: z.object({
|
|
15368
|
+
server: z.string().describe("Connection name from connect_server")
|
|
15369
|
+
}),
|
|
15370
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
15371
|
+
},
|
|
15372
|
+
async ({ server: name }) => runTool(async () => {
|
|
15373
|
+
requireConnected(name);
|
|
15374
|
+
return listServerSkillCatalog(manager, name);
|
|
15375
|
+
})
|
|
15376
|
+
);
|
|
15377
|
+
server.registerTool(
|
|
15378
|
+
"get_skill",
|
|
15379
|
+
{
|
|
15380
|
+
title: "Get a skill from the target server",
|
|
15381
|
+
description: "Fetch one skill by uri and verify it before returning content: the SKILL.md digest against the manifest, the fetched frontmatter against what the listing advertised, and the name against the uri. Answers with the skill, or with a refusal naming the check that failed.",
|
|
15382
|
+
inputSchema: z.object({
|
|
15383
|
+
server: z.string().describe("Connection name from connect_server"),
|
|
15384
|
+
uri: z.string().describe(
|
|
15385
|
+
"Skill URI. Usually from list_skills, but any uri works \u2014 a skill absent from a partial listing may still be served."
|
|
15386
|
+
)
|
|
15387
|
+
}),
|
|
15388
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
15389
|
+
},
|
|
15390
|
+
async ({ server: name, uri }) => runTool(async () => {
|
|
15391
|
+
requireConnected(name);
|
|
15392
|
+
try {
|
|
15393
|
+
return { skill: await getVerifiedServerSkill(manager, { serverId: name, uri }) };
|
|
15394
|
+
} catch (error) {
|
|
15395
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
15396
|
+
throw error;
|
|
15397
|
+
}
|
|
15398
|
+
})
|
|
15399
|
+
);
|
|
15400
|
+
server.registerTool(
|
|
15401
|
+
"read_skill_file",
|
|
15402
|
+
{
|
|
15403
|
+
title: "Read a skill's supporting file",
|
|
15404
|
+
description: "Read one supporting file of a skill served by a connected server, checked against that skill's own manifest for byte length and digest.",
|
|
15405
|
+
inputSchema: z.object({
|
|
15406
|
+
server: z.string().describe("Connection name from connect_server"),
|
|
15407
|
+
skillUri: z.string().describe("URI of the skill that owns the file"),
|
|
15408
|
+
resourceUri: z.string().describe(
|
|
15409
|
+
"URI of the supporting file, which must appear in that skill's manifest \u2014 the manifest is the read allowlist."
|
|
15410
|
+
)
|
|
15411
|
+
}),
|
|
15412
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
15413
|
+
},
|
|
15414
|
+
async ({ server: name, skillUri, resourceUri }) => runTool(async () => {
|
|
15415
|
+
requireConnected(name);
|
|
15416
|
+
try {
|
|
15417
|
+
const skill = await getVerifiedServerSkill(manager, {
|
|
15418
|
+
serverId: name,
|
|
15419
|
+
uri: skillUri
|
|
15420
|
+
});
|
|
15421
|
+
return {
|
|
15422
|
+
file: await readVerifiedServerSkillFile(manager, {
|
|
15423
|
+
serverId: name,
|
|
15424
|
+
entry: { uri: skill.skillUri, resources: skill.resources },
|
|
15425
|
+
resourceUri
|
|
15426
|
+
})
|
|
15427
|
+
};
|
|
15428
|
+
} catch (error) {
|
|
15429
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
15430
|
+
throw error;
|
|
15431
|
+
}
|
|
15432
|
+
})
|
|
15433
|
+
);
|
|
15329
15434
|
server.registerTool(
|
|
15330
15435
|
"list_prompts",
|
|
15331
15436
|
{
|
|
@@ -17415,6 +17520,166 @@ function registerResourcesCommands(program) {
|
|
|
17415
17520
|
);
|
|
17416
17521
|
});
|
|
17417
17522
|
}
|
|
17523
|
+
function registerServerSkillsCommands(program) {
|
|
17524
|
+
const skills = program.command("skills").description(
|
|
17525
|
+
"Inspect the Agent Skills an MCP server serves (SEP-2640). For your project's Cloud Skills, see `mcpjam cloud skills`."
|
|
17526
|
+
);
|
|
17527
|
+
addHostOption(
|
|
17528
|
+
addRetryOptions(
|
|
17529
|
+
addSharedServerOptions(
|
|
17530
|
+
skills.command("list").description(
|
|
17531
|
+
"List the skills a server serves, including ones it advertises that cannot be verified"
|
|
17532
|
+
)
|
|
17533
|
+
)
|
|
17534
|
+
)
|
|
17535
|
+
).action(async (options, command) => {
|
|
17536
|
+
const globalOptions = getGlobalOptions(command);
|
|
17537
|
+
const retryPolicy = parseRetryPolicy(options);
|
|
17538
|
+
const host = resolveHostFromOptions(options);
|
|
17539
|
+
const target = describeTarget(options);
|
|
17540
|
+
const collector = globalOptions.rpc ? createCliRpcLogCollector({ __cli__: target }) : void 0;
|
|
17541
|
+
const config = parseServerConfig({
|
|
17542
|
+
...options,
|
|
17543
|
+
timeout: globalOptions.timeout
|
|
17544
|
+
});
|
|
17545
|
+
const result = await withEphemeralManager(
|
|
17546
|
+
config,
|
|
17547
|
+
(manager, serverId) => listServerSkillCatalog(manager, serverId),
|
|
17548
|
+
{
|
|
17549
|
+
timeout: globalOptions.timeout,
|
|
17550
|
+
rpcLogger: collector?.rpcLogger,
|
|
17551
|
+
retryPolicy,
|
|
17552
|
+
host: host?.connection,
|
|
17553
|
+
skillsExtension: true
|
|
17554
|
+
}
|
|
17555
|
+
);
|
|
17556
|
+
writeResult(
|
|
17557
|
+
withRpcLogsIfRequested(result, collector, globalOptions),
|
|
17558
|
+
globalOptions.format
|
|
17559
|
+
);
|
|
17560
|
+
});
|
|
17561
|
+
addHostOption(
|
|
17562
|
+
addRetryOptions(
|
|
17563
|
+
addSharedServerOptions(
|
|
17564
|
+
skills.command("get").description(
|
|
17565
|
+
"Fetch one skill by uri and verify it against its manifest, frontmatter and identity"
|
|
17566
|
+
).option("--skill-uri <uri>", "Skill URI").option("--uri <uri>", "Alias for --skill-uri")
|
|
17567
|
+
)
|
|
17568
|
+
)
|
|
17569
|
+
).action(async (options, command) => {
|
|
17570
|
+
const globalOptions = getGlobalOptions(command);
|
|
17571
|
+
const retryPolicy = parseRetryPolicy(options);
|
|
17572
|
+
const host = resolveHostFromOptions(options);
|
|
17573
|
+
const target = describeTarget(options);
|
|
17574
|
+
const collector = globalOptions.rpc ? createCliRpcLogCollector({ __cli__: target }) : void 0;
|
|
17575
|
+
const skillUri = resolveAliasedStringOption(
|
|
17576
|
+
options,
|
|
17577
|
+
[
|
|
17578
|
+
{ key: "skillUri", flag: "--skill-uri" },
|
|
17579
|
+
{ key: "uri", flag: "--uri" }
|
|
17580
|
+
],
|
|
17581
|
+
"Skill URI",
|
|
17582
|
+
{ required: true }
|
|
17583
|
+
);
|
|
17584
|
+
const config = parseServerConfig({
|
|
17585
|
+
...options,
|
|
17586
|
+
timeout: globalOptions.timeout
|
|
17587
|
+
});
|
|
17588
|
+
const result = await withEphemeralManager(
|
|
17589
|
+
config,
|
|
17590
|
+
async (manager, serverId) => {
|
|
17591
|
+
try {
|
|
17592
|
+
return {
|
|
17593
|
+
skill: await getVerifiedServerSkill(manager, {
|
|
17594
|
+
serverId,
|
|
17595
|
+
uri: skillUri
|
|
17596
|
+
})
|
|
17597
|
+
};
|
|
17598
|
+
} catch (error) {
|
|
17599
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
17600
|
+
throw error;
|
|
17601
|
+
}
|
|
17602
|
+
},
|
|
17603
|
+
{
|
|
17604
|
+
timeout: globalOptions.timeout,
|
|
17605
|
+
rpcLogger: collector?.rpcLogger,
|
|
17606
|
+
retryPolicy,
|
|
17607
|
+
host: host?.connection,
|
|
17608
|
+
skillsExtension: true
|
|
17609
|
+
}
|
|
17610
|
+
);
|
|
17611
|
+
writeResult(
|
|
17612
|
+
withRpcLogsIfRequested(result, collector, globalOptions),
|
|
17613
|
+
globalOptions.format
|
|
17614
|
+
);
|
|
17615
|
+
});
|
|
17616
|
+
addHostOption(
|
|
17617
|
+
addRetryOptions(
|
|
17618
|
+
addSharedServerOptions(
|
|
17619
|
+
skills.command("read").description(
|
|
17620
|
+
"Read one of a skill's supporting files, verified against that skill's manifest"
|
|
17621
|
+
).option("--skill-uri <uri>", "URI of the skill that owns the file").option("--resource-uri <uri>", "URI of the supporting file").option("--uri <uri>", "Alias for --resource-uri")
|
|
17622
|
+
)
|
|
17623
|
+
)
|
|
17624
|
+
).action(async (options, command) => {
|
|
17625
|
+
const globalOptions = getGlobalOptions(command);
|
|
17626
|
+
const retryPolicy = parseRetryPolicy(options);
|
|
17627
|
+
const host = resolveHostFromOptions(options);
|
|
17628
|
+
const target = describeTarget(options);
|
|
17629
|
+
const collector = globalOptions.rpc ? createCliRpcLogCollector({ __cli__: target }) : void 0;
|
|
17630
|
+
const skillUri = resolveAliasedStringOption(
|
|
17631
|
+
options,
|
|
17632
|
+
[{ key: "skillUri", flag: "--skill-uri" }],
|
|
17633
|
+
"Skill URI",
|
|
17634
|
+
{ required: true }
|
|
17635
|
+
);
|
|
17636
|
+
const resourceUri = resolveAliasedStringOption(
|
|
17637
|
+
options,
|
|
17638
|
+
[
|
|
17639
|
+
{ key: "resourceUri", flag: "--resource-uri" },
|
|
17640
|
+
{ key: "uri", flag: "--uri" }
|
|
17641
|
+
],
|
|
17642
|
+
"Resource URI",
|
|
17643
|
+
{ required: true }
|
|
17644
|
+
);
|
|
17645
|
+
const config = parseServerConfig({
|
|
17646
|
+
...options,
|
|
17647
|
+
timeout: globalOptions.timeout
|
|
17648
|
+
});
|
|
17649
|
+
const result = await withEphemeralManager(
|
|
17650
|
+
config,
|
|
17651
|
+
async (manager, serverId) => {
|
|
17652
|
+
try {
|
|
17653
|
+
const skill = await getVerifiedServerSkill(manager, {
|
|
17654
|
+
serverId,
|
|
17655
|
+
uri: skillUri
|
|
17656
|
+
});
|
|
17657
|
+
return {
|
|
17658
|
+
file: await readVerifiedServerSkillFile(manager, {
|
|
17659
|
+
serverId,
|
|
17660
|
+
entry: { uri: skill.skillUri, resources: skill.resources },
|
|
17661
|
+
resourceUri
|
|
17662
|
+
})
|
|
17663
|
+
};
|
|
17664
|
+
} catch (error) {
|
|
17665
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
17666
|
+
throw error;
|
|
17667
|
+
}
|
|
17668
|
+
},
|
|
17669
|
+
{
|
|
17670
|
+
timeout: globalOptions.timeout,
|
|
17671
|
+
rpcLogger: collector?.rpcLogger,
|
|
17672
|
+
retryPolicy,
|
|
17673
|
+
host: host?.connection,
|
|
17674
|
+
skillsExtension: true
|
|
17675
|
+
}
|
|
17676
|
+
);
|
|
17677
|
+
writeResult(
|
|
17678
|
+
withRpcLogsIfRequested(result, collector, globalOptions),
|
|
17679
|
+
globalOptions.format
|
|
17680
|
+
);
|
|
17681
|
+
});
|
|
17682
|
+
}
|
|
17418
17683
|
function registerServerCommands(program) {
|
|
17419
17684
|
const server = program.command("server").description("Inspect MCP server connectivity and capabilities");
|
|
17420
17685
|
addRetryOptions(
|
|
@@ -21013,6 +21278,7 @@ async function main(argv = process.argv, dependencies = {}) {
|
|
|
21013
21278
|
registerServerCommands(program);
|
|
21014
21279
|
registerToolsCommands(program);
|
|
21015
21280
|
registerResourcesCommands(program);
|
|
21281
|
+
registerServerSkillsCommands(program);
|
|
21016
21282
|
registerSubscriptionsCommands(program);
|
|
21017
21283
|
registerCompatCommands(program);
|
|
21018
21284
|
registerPromptCommands(program);
|