@mcpjam/cli 5.2.0 → 5.4.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 +396 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
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';
|
|
9
9
|
import { spawn } from 'child_process';
|
|
10
10
|
import { createRequire } from 'module';
|
|
11
11
|
import os, { homedir } from 'os';
|
|
12
|
-
import { getRegistryDirectoryServerOperation, listOrganizationsOperation, listProjectsOperation, createProjectOperation, updateProjectOperation, deleteProjectOperation, connectProjectServerOperation, getProjectServerConnectionStatusOperation, listChatSessionsOperation, resolveProject, createTunnelOperation, listEvalSuiteRunsOperation, runEvalSuiteOperation, getEvalRunOperation, cancelEvalRunOperation, requestEvalRunJudgeOperation, listEvalCheckReposOperation, connectEvalCheckRepoOperation, listEvalRunIterationsOperation, getEvalIterationTraceOperation, getEvalRunStepsOperation, getEvalSuiteOperation, updateEvalSuiteOperation, deleteEvalSuiteOperation, setEvalSuiteScheduleOperation, setEvalSuiteEnvironmentsOperation, listEvalCasesOperation, getEvalCaseOperation, runEvalCaseOperation, createEvalCaseOperation, updateEvalCaseOperation, deleteEvalCaseOperation, generateEvalCasesOperation, createClientOperation, updateClientOperation, setClientServersOperation, duplicateClientOperation, createEnvironmentOperation, ensureAdhocEnvironmentOperation, nameEnvironmentOperation, updateEnvironmentOperation, createImageOperation, validateImageBlueprintOperation, updateImageOperation, runOperationWithPermalinks, withPermalinkEnvelope, PlatformApiError, installRegistryServerOperation, installRegistryDirectoryServerOperation, getProjectServerOperation, DEFAULT_PLATFORM_API_BASE_URL, projectResolutionError, listProjectServersOperation, createProjectServerOperation, updateProjectServerOperation, deleteProjectServerOperation, showServersOperation, isPlatformApiError, createEvalSuiteOperation, listEvalSuitesOperation, buildAppPermalink, resolveEnvironmentOperation, listClientsOperation, getClientOperation, deleteClientOperation, listEnvironmentsOperation, getEnvironmentOperation, getEnvironmentCapabilitiesOperation, archiveEnvironmentOperation, restoreEnvironmentOperation, listImagesOperation, getImageOperation, buildImageOperation, listImageBuildsOperation, useImageOperation, resetComputerOperation, promoteImageOperation, deleteImageOperation, listProjectSkillsOperation, getProjectSkillOperation, listJourneysOperation, listJourneyRunsOperation, getJourneyRunOperation, launchJourneyRunOperation, cancelJourneyRunOperation, listJourneyRunSessionsOperation, listScenariosOperation, getScenarioOperation, publishScenarioOperation, unpublishScenarioOperation, PlatformApiClient, listServerToolsOperation, getCapabilitiesOperation, searchSessionsOperation, sendChatMessageOperation, getChatSessionOperation, getChatSessionTraceOperation, listPersonasOperation, getPersonaOperation, createPersonaOperation, updatePersonaOperation, deletePersonaOperation, generatePersonasOperation, getJourneyOperation, createJourneyOperation, updateJourneyOperation, archiveJourneyOperation, generateJourneysOperation, getSwarmOverviewOperation, getJourneyRunScorecardOperation, listSwarmFindingsOperation, dismissSwarmFindingOperation, undismissSwarmFindingOperation, getWaveInsightsOperation, requestWaveInsightsOperation, cancelWaveInsightsOperation, listSwarmsOperation, getSwarmOperation, createSwarmOperation, updateSwarmOperation, archiveSwarmOperation, getUserTestingScenarioOperation, listUserTestingSessionsOperation, getUserTestingSessionOperation, getUserTestingMetricsOperation, getUserTestingUsageOperation, listUserTestingFindingsOperation, getUserTestingSignalsOperation, getUserTestingInsightsOperation, requestUserTestingInsightsOperation, cancelUserTestingInsightsOperation, dismissUserTestingFindingOperation, undismissUserTestingFindingOperation, updateUserTestingScenarioOperation, setUserTestingGuestExecutionOperation, rotateUserTestingLinkOperation, upsertUserTestingMemberOperation, removeUserTestingMemberOperation, rebindUserTestingScenarioOperation, startClaudeReadinessRunOperation, startOpenAIReadinessRunOperation, getReadinessRunOperation, listReadinessRunsOperation, cancelReadinessRunOperation, getReadinessReportOperation, listRegistryDirectorySourcesOperation, searchRegistryDirectoryOperation, listRegistryServersOperation, listRegistryConnectionsOperation, uninstallRegistryServerOperation } from '@mcpjam/sdk/platform';
|
|
12
|
+
import { getRegistryDirectoryServerOperation, listOrganizationsOperation, listProjectsOperation, createProjectOperation, updateProjectOperation, deleteProjectOperation, connectProjectServerOperation, getProjectServerConnectionStatusOperation, cancelProjectServerConnectionOperation, listChatSessionsOperation, resolveProject, createTunnelOperation, listEvalSuiteRunsOperation, runEvalSuiteOperation, getEvalRunOperation, cancelEvalRunOperation, requestEvalRunJudgeOperation, listEvalCheckReposOperation, connectEvalCheckRepoOperation, listEvalRunIterationsOperation, getEvalIterationTraceOperation, getEvalRunStepsOperation, getEvalSuiteOperation, updateEvalSuiteOperation, deleteEvalSuiteOperation, setEvalSuiteScheduleOperation, setEvalSuiteEnvironmentsOperation, listEvalCasesOperation, getEvalCaseOperation, runEvalCaseOperation, createEvalCaseOperation, updateEvalCaseOperation, deleteEvalCaseOperation, generateEvalCasesOperation, createClientOperation, updateClientOperation, setClientServersOperation, duplicateClientOperation, createEnvironmentOperation, ensureAdhocEnvironmentOperation, nameEnvironmentOperation, updateEnvironmentOperation, createImageOperation, validateImageBlueprintOperation, updateImageOperation, runOperationWithPermalinks, withPermalinkEnvelope, PlatformApiError, installRegistryServerOperation, installRegistryDirectoryServerOperation, getProjectServerOperation, DEFAULT_PLATFORM_API_BASE_URL, projectResolutionError, listProjectServersOperation, createProjectServerOperation, updateProjectServerOperation, deleteProjectServerOperation, showServersOperation, isPlatformApiError, createEvalSuiteOperation, listEvalSuitesOperation, buildAppPermalink, resolveEnvironmentOperation, listClientsOperation, getClientOperation, deleteClientOperation, listEnvironmentsOperation, getEnvironmentOperation, getEnvironmentCapabilitiesOperation, archiveEnvironmentOperation, restoreEnvironmentOperation, listImagesOperation, getImageOperation, buildImageOperation, listImageBuildsOperation, useImageOperation, resetComputerOperation, promoteImageOperation, deleteImageOperation, listProjectSkillsOperation, getProjectSkillOperation, listJourneysOperation, listJourneyRunsOperation, getJourneyRunOperation, launchJourneyRunOperation, cancelJourneyRunOperation, listJourneyRunSessionsOperation, listScenariosOperation, getScenarioOperation, publishScenarioOperation, unpublishScenarioOperation, PlatformApiClient, listServerToolsOperation, getCapabilitiesOperation, searchSessionsOperation, sendChatMessageOperation, getChatSessionOperation, getChatSessionTraceOperation, listPersonasOperation, getPersonaOperation, createPersonaOperation, updatePersonaOperation, deletePersonaOperation, generatePersonasOperation, getJourneyOperation, createJourneyOperation, updateJourneyOperation, archiveJourneyOperation, generateJourneysOperation, getSwarmOverviewOperation, getJourneyRunScorecardOperation, listSwarmFindingsOperation, dismissSwarmFindingOperation, undismissSwarmFindingOperation, getWaveInsightsOperation, requestWaveInsightsOperation, cancelWaveInsightsOperation, listSwarmsOperation, getSwarmOperation, createSwarmOperation, updateSwarmOperation, archiveSwarmOperation, getUserTestingScenarioOperation, listUserTestingSessionsOperation, getUserTestingSessionOperation, getUserTestingMetricsOperation, getUserTestingUsageOperation, listUserTestingFindingsOperation, getUserTestingSignalsOperation, getUserTestingInsightsOperation, requestUserTestingInsightsOperation, cancelUserTestingInsightsOperation, dismissUserTestingFindingOperation, undismissUserTestingFindingOperation, updateUserTestingScenarioOperation, setUserTestingGuestExecutionOperation, rotateUserTestingLinkOperation, upsertUserTestingMemberOperation, removeUserTestingMemberOperation, rebindUserTestingScenarioOperation, startClaudeReadinessRunOperation, startOpenAIReadinessRunOperation, getReadinessRunOperation, listReadinessRunsOperation, cancelReadinessRunOperation, getReadinessReportOperation, listRegistryDirectorySourcesOperation, searchRegistryDirectoryOperation, listRegistryServersOperation, listRegistryConnectionsOperation, uninstallRegistryServerOperation } from '@mcpjam/sdk/platform';
|
|
13
13
|
import { isDeepStrictEqual } from 'util';
|
|
14
14
|
import { MAX_BATCH_CREATE_CASES, evalSuiteFileSchema, MAX_IMPORT_NOTE_CHARS, isOpaqueId } from '@mcpjam/sdk/contract';
|
|
15
15
|
import { HOST_TEMPLATES, HOST_TEMPLATE_IDS, seedHostTemplate } from '@mcpjam/sdk/host-config/templates';
|
|
@@ -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.4.0"};
|
|
31
31
|
function conformanceExitCode(result) {
|
|
32
32
|
if (result.outcome === "incomplete") return 3;
|
|
33
33
|
if (result.outcome === "failed") return 1;
|
|
@@ -4059,6 +4059,51 @@ function resolveExplicitApiUrl(options, env) {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
return void 0;
|
|
4061
4061
|
}
|
|
4062
|
+
var RESERVED_HEADER_NAMES = /* @__PURE__ */ new Set([
|
|
4063
|
+
"authorization",
|
|
4064
|
+
"idempotency-key",
|
|
4065
|
+
"content-type"
|
|
4066
|
+
]);
|
|
4067
|
+
var HEADER_NAME_RE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
4068
|
+
function parseHeader2(raw, source) {
|
|
4069
|
+
const separator = raw.indexOf(":");
|
|
4070
|
+
if (separator < 1) {
|
|
4071
|
+
throw usageError(
|
|
4072
|
+
`${source} must be "Name: value" \u2014 got ${JSON.stringify(raw)}`
|
|
4073
|
+
);
|
|
4074
|
+
}
|
|
4075
|
+
const name = raw.slice(0, separator).trim();
|
|
4076
|
+
const value = raw.slice(separator + 1).trim();
|
|
4077
|
+
if (!HEADER_NAME_RE.test(name)) {
|
|
4078
|
+
throw usageError(`${source} has an invalid header name ${JSON.stringify(name)}`);
|
|
4079
|
+
}
|
|
4080
|
+
if (value.length === 0) {
|
|
4081
|
+
throw usageError(`${source} has an empty value for ${JSON.stringify(name)}`);
|
|
4082
|
+
}
|
|
4083
|
+
if (/[\r\n]/.test(value)) {
|
|
4084
|
+
throw usageError(`${source} value for ${JSON.stringify(name)} contains a line break`);
|
|
4085
|
+
}
|
|
4086
|
+
const lower = name.toLowerCase();
|
|
4087
|
+
if (RESERVED_HEADER_NAMES.has(lower)) {
|
|
4088
|
+
throw usageError(
|
|
4089
|
+
`${source} cannot set ${JSON.stringify(name)} \u2014 it is derived from the credential and request`
|
|
4090
|
+
);
|
|
4091
|
+
}
|
|
4092
|
+
return [lower, value];
|
|
4093
|
+
}
|
|
4094
|
+
function resolvePlatformExtraHeaders(options, env = process.env) {
|
|
4095
|
+
const headers = {};
|
|
4096
|
+
for (const line2 of (env.MCPJAM_API_HEADERS ?? "").split("\n")) {
|
|
4097
|
+
if (line2.trim().length === 0) continue;
|
|
4098
|
+
const [name, value] = parseHeader2(line2, "MCPJAM_API_HEADERS");
|
|
4099
|
+
headers[name] = value;
|
|
4100
|
+
}
|
|
4101
|
+
for (const raw of options.apiHeader ?? []) {
|
|
4102
|
+
const [name, value] = parseHeader2(raw, "--api-header");
|
|
4103
|
+
headers[name] = value;
|
|
4104
|
+
}
|
|
4105
|
+
return Object.keys(headers).length > 0 ? headers : void 0;
|
|
4106
|
+
}
|
|
4062
4107
|
function resolvePlatformBaseUrl(options, env = process.env) {
|
|
4063
4108
|
return resolveExplicitApiUrl(options, env) ?? DEFAULT_PLATFORM_API_BASE_URL;
|
|
4064
4109
|
}
|
|
@@ -4068,6 +4113,7 @@ function resolvePlatformOrigin(options, env = process.env) {
|
|
|
4068
4113
|
function buildPlatformClient(options, deps = {}) {
|
|
4069
4114
|
const env = deps.env ?? process.env;
|
|
4070
4115
|
const credential = resolvePlatformCredential(options, deps);
|
|
4116
|
+
const extraHeaders = resolvePlatformExtraHeaders(options, env);
|
|
4071
4117
|
let baseUrl = resolveExplicitApiUrl(options, env);
|
|
4072
4118
|
if (!baseUrl && credential.kind === "oauth") {
|
|
4073
4119
|
const stored = readStoredAuth(deps.authFilePath ?? getAuthFilePath({ env }));
|
|
@@ -4079,7 +4125,8 @@ function buildPlatformClient(options, deps = {}) {
|
|
|
4079
4125
|
getAuth: credential.getAuth,
|
|
4080
4126
|
...deps.fetchFn ? { fetch: deps.fetchFn } : {},
|
|
4081
4127
|
...options.timeoutMs !== void 0 ? { timeoutMs: options.timeoutMs } : {},
|
|
4082
|
-
userAgent: `mcpjam-cli/${package_default.version}
|
|
4128
|
+
userAgent: `mcpjam-cli/${package_default.version}`,
|
|
4129
|
+
...extraHeaders ? { extraHeaders } : {}
|
|
4083
4130
|
});
|
|
4084
4131
|
return { client, credentialKind: credential.kind, baseUrl: resolvedBaseUrl };
|
|
4085
4132
|
}
|
|
@@ -4275,6 +4322,9 @@ function addPlatformOptions(command) {
|
|
|
4275
4322
|
return command.option("--api-key <key>", "MCPJam sk_ API key (overrides MCPJAM_API_KEY)").option(
|
|
4276
4323
|
"--api-url <url>",
|
|
4277
4324
|
"MCPJam API base URL (defaults to https://app.mcpjam.com/api/v1)"
|
|
4325
|
+
).option(
|
|
4326
|
+
"--api-header <header...>",
|
|
4327
|
+
'Extra request header for a deployment behind an edge authenticator, as "Name: value" (repeatable; also MCPJAM_API_HEADERS, newline-separated)'
|
|
4278
4328
|
);
|
|
4279
4329
|
}
|
|
4280
4330
|
function buildCloudClientContext(options, timeoutMs) {
|
|
@@ -5320,7 +5370,10 @@ async function listToolNames(client, projectId, server, signal) {
|
|
|
5320
5370
|
{
|
|
5321
5371
|
project: projectId,
|
|
5322
5372
|
server: server.id,
|
|
5323
|
-
|
|
5373
|
+
// Presence, not truthiness: MCP 2026-07-28
|
|
5374
|
+
// `server/utilities/pagination` makes `""` a valid cursor, and
|
|
5375
|
+
// dropping it here would silently re-read page one.
|
|
5376
|
+
...cursor !== void 0 ? { cursor } : {}
|
|
5324
5377
|
},
|
|
5325
5378
|
{ client, signal }
|
|
5326
5379
|
);
|
|
@@ -5328,8 +5381,9 @@ async function listToolNames(client, projectId, server, signal) {
|
|
|
5328
5381
|
const name = tool.name;
|
|
5329
5382
|
if (typeof name === "string" && name.length > 0) names.add(name);
|
|
5330
5383
|
}
|
|
5331
|
-
|
|
5332
|
-
|
|
5384
|
+
const next = typeof result.nextCursor === "string" ? result.nextCursor : void 0;
|
|
5385
|
+
if (next === void 0) return names;
|
|
5386
|
+
cursor = next;
|
|
5333
5387
|
}
|
|
5334
5388
|
throw cliError(
|
|
5335
5389
|
"TOOL_DISCOVERY_UNAVAILABLE",
|
|
@@ -5898,6 +5952,7 @@ function buildSuiteFileFromPlatform(input) {
|
|
|
5898
5952
|
cases: cases.map((evalCase, index) => ({
|
|
5899
5953
|
id: caseIds[index],
|
|
5900
5954
|
title: evalCase.title,
|
|
5955
|
+
...evalCase.intent === void 0 ? {} : { intent: evalCase.intent },
|
|
5901
5956
|
...evalCase.iterations === repetitions ? {} : { repetitions: evalCase.iterations },
|
|
5902
5957
|
...evalCase.isNegative ? { isNegativeTest: true } : {},
|
|
5903
5958
|
...evalCase.expectedOutput === void 0 || evalCase.expectedOutput === null ? {} : { expectedOutput: evalCase.expectedOutput },
|
|
@@ -5976,6 +6031,7 @@ function fileCaseToCreateBody(testCase) {
|
|
|
5976
6031
|
return {
|
|
5977
6032
|
id: testCase.id,
|
|
5978
6033
|
title: testCase.title,
|
|
6034
|
+
...testCase.intent !== void 0 ? { intent: testCase.intent } : {},
|
|
5979
6035
|
steps: testCase.steps,
|
|
5980
6036
|
iterations: testCase.repetitions,
|
|
5981
6037
|
repetitions: testCase.repetitions,
|
|
@@ -5995,6 +6051,9 @@ function fileCaseToCreateBody(testCase) {
|
|
|
5995
6051
|
function fileCaseToUpdateBody(testCase) {
|
|
5996
6052
|
return {
|
|
5997
6053
|
title: testCase.title,
|
|
6054
|
+
// A file re-sync is authoritative: unlike an ordinary PATCH, a missing
|
|
6055
|
+
// label must clear the old one rather than preserve stale attribution.
|
|
6056
|
+
intent: testCase.intent ?? null,
|
|
5998
6057
|
steps: testCase.steps,
|
|
5999
6058
|
iterations: testCase.repetitions,
|
|
6000
6059
|
repetitions: testCase.repetitions,
|
|
@@ -7576,7 +7635,7 @@ function selectorField(singular, plural, values) {
|
|
|
7576
7635
|
}
|
|
7577
7636
|
function composeField(options) {
|
|
7578
7637
|
const models = Array.isArray(options.composeModel) ? options.composeModel : options.composeModel ? [options.composeModel] : void 0;
|
|
7579
|
-
const refinements = options.composeComputer !== void 0 || models !== void 0 || options.composeServerGroup !== void 0 || (options.composeSkill?.length ?? 0) > 0 || options.withClientDefault === true || options.saveTargets === true;
|
|
7638
|
+
const refinements = options.composeComputer !== void 0 || models !== void 0 || (options.composeServer?.length ?? 0) > 0 || options.composeServerGroup !== void 0 || options.composeHostServers === true || (options.composeSkill?.length ?? 0) > 0 || options.withClientDefault === true || options.saveTargets === true;
|
|
7580
7639
|
if (!options.composeHost) {
|
|
7581
7640
|
if (refinements) {
|
|
7582
7641
|
throw usageError(
|
|
@@ -7585,10 +7644,28 @@ function composeField(options) {
|
|
|
7585
7644
|
}
|
|
7586
7645
|
return {};
|
|
7587
7646
|
}
|
|
7647
|
+
if (options.composeServerGroup !== void 0 && options.composeServer?.length) {
|
|
7648
|
+
throw usageError(
|
|
7649
|
+
"--compose-server and --compose-server-group both pin the run's servers. Use --compose-server with server names, or --compose-server-group with an existing group ID."
|
|
7650
|
+
);
|
|
7651
|
+
}
|
|
7652
|
+
const pinsServers = options.composeServerGroup !== void 0 || (options.composeServer?.length ?? 0) > 0;
|
|
7653
|
+
if (options.composeHostServers === true && pinsServers) {
|
|
7654
|
+
throw usageError(
|
|
7655
|
+
"--compose-host-servers runs against the host's current list, so it cannot be combined with --compose-server / --compose-server-group, which pin one."
|
|
7656
|
+
);
|
|
7657
|
+
}
|
|
7658
|
+
if (!pinsServers && options.composeHostServers !== true) {
|
|
7659
|
+
throw usageError(
|
|
7660
|
+
"--compose-host needs to know which servers to test: add --compose-server <name>. To deliberately use whatever servers the host points at right now \u2014 which changes when the host is edited \u2014 pass --compose-host-servers."
|
|
7661
|
+
);
|
|
7662
|
+
}
|
|
7588
7663
|
return {
|
|
7589
7664
|
compose: {
|
|
7590
7665
|
host: options.composeHost,
|
|
7591
7666
|
...options.composeServerGroup !== void 0 ? { serverGroup: options.composeServerGroup } : {},
|
|
7667
|
+
...options.composeHostServers === true ? { hostServers: true } : {},
|
|
7668
|
+
...selectorField("server", "servers", options.composeServer),
|
|
7592
7669
|
...models !== void 0 ? { models } : {},
|
|
7593
7670
|
...options.withClientDefault === true ? { includeClientDefault: true } : {},
|
|
7594
7671
|
...options.saveTargets === true ? { saveTargets: true } : {},
|
|
@@ -9212,9 +9289,15 @@ function registerEvalCommands(program) {
|
|
|
9212
9289
|
).option(
|
|
9213
9290
|
"--save-targets",
|
|
9214
9291
|
"Attach the composed environments to the suite (append, capped at 10). Default is ephemeral."
|
|
9292
|
+
).option(
|
|
9293
|
+
"--compose-server <id-or-name...>",
|
|
9294
|
+
"Server(s) to pin on the composed stack. Snapshots them into a server group, so the run keeps testing these servers even if the host's own server list changes later. Mutually exclusive with --compose-server-group."
|
|
9215
9295
|
).option(
|
|
9216
9296
|
"--compose-server-group <id>",
|
|
9217
9297
|
"Standalone server group to pin on the composed stack"
|
|
9298
|
+
).option(
|
|
9299
|
+
"--compose-host-servers",
|
|
9300
|
+
"Run against whatever servers the host points at right now, instead of pinning a set. Editing that host later changes what a rerun tests."
|
|
9218
9301
|
).option(
|
|
9219
9302
|
"--compose-skill <id...>",
|
|
9220
9303
|
"Project-shared skill IDs to pin on the composed stack"
|
|
@@ -10251,9 +10334,15 @@ function registerEvalCommands(program) {
|
|
|
10251
10334
|
).option(
|
|
10252
10335
|
"--compose-model <id>",
|
|
10253
10336
|
"One model to run this case on. A matrix of models is suite-level (`eval run`) only."
|
|
10337
|
+
).option(
|
|
10338
|
+
"--compose-server <id-or-name...>",
|
|
10339
|
+
"Server(s) to pin on the composed stack. Snapshots them into a server group, so the run keeps testing these servers even if the host's own server list changes later. Mutually exclusive with --compose-server-group."
|
|
10254
10340
|
).option(
|
|
10255
10341
|
"--compose-server-group <id>",
|
|
10256
10342
|
"Standalone server group to pin on the composed stack"
|
|
10343
|
+
).option(
|
|
10344
|
+
"--compose-host-servers",
|
|
10345
|
+
"Run against whatever servers the host points at right now, instead of pinning a set. Editing that host later changes what a rerun tests."
|
|
10257
10346
|
).option(
|
|
10258
10347
|
"--compose-skill <id...>",
|
|
10259
10348
|
"Project-shared skill IDs to pin on the composed stack"
|
|
@@ -11517,6 +11606,8 @@ function registerProjectsCommands(program) {
|
|
|
11517
11606
|
process.stderr.write(
|
|
11518
11607
|
`Not waiting. Follow it with:
|
|
11519
11608
|
mcpjam cloud projects servers connect-status --request ${created.connectionRequestId}
|
|
11609
|
+
Or stop it with:
|
|
11610
|
+
mcpjam cloud projects servers connect-cancel --request ${created.connectionRequestId}
|
|
11520
11611
|
`
|
|
11521
11612
|
);
|
|
11522
11613
|
}
|
|
@@ -11535,6 +11626,7 @@ function registerProjectsCommands(program) {
|
|
|
11535
11626
|
process.stderr.write(
|
|
11536
11627
|
`Stopped waiting; the request is still ${latest.status} and continues in the cloud.
|
|
11537
11628
|
mcpjam cloud projects servers connect-status --request ${created.connectionRequestId}
|
|
11629
|
+
mcpjam cloud projects servers connect-cancel --request ${created.connectionRequestId}
|
|
11538
11630
|
`
|
|
11539
11631
|
);
|
|
11540
11632
|
process.exitCode = 1;
|
|
@@ -11559,6 +11651,24 @@ function registerProjectsCommands(program) {
|
|
|
11559
11651
|
writeResult(payload, globalOptions.format);
|
|
11560
11652
|
}
|
|
11561
11653
|
);
|
|
11654
|
+
servers.command("connect-cancel").description("Cancel a pending connection request started by `server connect`").requiredOption("--request <id>", "Connection request id (scr_\u2026)").action(
|
|
11655
|
+
async (options, command) => {
|
|
11656
|
+
const globalOptions = getGlobalOptions(command);
|
|
11657
|
+
const input = cancelProjectServerConnectionOperation.inputSchema.parse({
|
|
11658
|
+
connectionRequestId: options.request
|
|
11659
|
+
});
|
|
11660
|
+
const payload = await runPlatformCommand(
|
|
11661
|
+
platformOptionsOf(command),
|
|
11662
|
+
globalOptions.timeout,
|
|
11663
|
+
({ client, signal }) => cancelProjectServerConnectionOperation.execute(input, {
|
|
11664
|
+
client,
|
|
11665
|
+
signal
|
|
11666
|
+
}),
|
|
11667
|
+
{ cloudScope: { kind: "account" }, quiet: globalOptions.quiet }
|
|
11668
|
+
);
|
|
11669
|
+
writeResult(payload, globalOptions.format);
|
|
11670
|
+
}
|
|
11671
|
+
);
|
|
11562
11672
|
projects.command("status").description(
|
|
11563
11673
|
"Health-check every server in a project (hosted doctor per server)"
|
|
11564
11674
|
).option(
|
|
@@ -13901,12 +14011,12 @@ function applyHostVisibility(tools, manager, serverId, policy) {
|
|
|
13901
14011
|
var TOOLS_PAGE_CAP = 50;
|
|
13902
14012
|
async function assertToolVisibleToHost(manager, serverId, toolName, host) {
|
|
13903
14013
|
if (host.policy.respectToolVisibility === false) return;
|
|
13904
|
-
const seenCursors = /* @__PURE__ */ new Set();
|
|
13905
14014
|
let cursor;
|
|
13906
14015
|
for (let page = 0; page < TOOLS_PAGE_CAP; page++) {
|
|
13907
14016
|
const result = await manager.listTools(
|
|
13908
14017
|
serverId,
|
|
13909
|
-
|
|
14018
|
+
// Presence, not truthiness: `""` is a valid continuation cursor.
|
|
14019
|
+
cursor !== void 0 ? { cursor } : void 0
|
|
13910
14020
|
);
|
|
13911
14021
|
const tool = (result.tools ?? []).find(
|
|
13912
14022
|
(t) => t.name === toolName
|
|
@@ -13920,9 +14030,7 @@ async function assertToolVisibleToHost(manager, serverId, toolName, host) {
|
|
|
13920
14030
|
return;
|
|
13921
14031
|
}
|
|
13922
14032
|
cursor = result.nextCursor;
|
|
13923
|
-
if (
|
|
13924
|
-
if (seenCursors.has(cursor)) break;
|
|
13925
|
-
seenCursors.add(cursor);
|
|
14033
|
+
if (cursor === void 0) return;
|
|
13926
14034
|
}
|
|
13927
14035
|
throw usageError(
|
|
13928
14036
|
`Could not verify "${toolName}" is visible to host "${host.id}" \u2014 the server's tool list is too long to page through. Omit --host to call it as an operator.`
|
|
@@ -14454,12 +14562,31 @@ function applyInteractiveElicitationCapability(config) {
|
|
|
14454
14562
|
}
|
|
14455
14563
|
};
|
|
14456
14564
|
}
|
|
14565
|
+
function applySkillsExtensionCapability(config) {
|
|
14566
|
+
const exact = config.clientCapabilities;
|
|
14567
|
+
if (exact) {
|
|
14568
|
+
const extensions = isRecord3(exact.extensions) ? exact.extensions : {};
|
|
14569
|
+
if (extensions[MCP_SKILLS_EXTENSION_ID] == null) {
|
|
14570
|
+
throw usageError(
|
|
14571
|
+
`\`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.`
|
|
14572
|
+
);
|
|
14573
|
+
}
|
|
14574
|
+
return config;
|
|
14575
|
+
}
|
|
14576
|
+
return {
|
|
14577
|
+
...config,
|
|
14578
|
+
capabilities: withSkillsExtensionCapability(
|
|
14579
|
+
config.capabilities ?? {}
|
|
14580
|
+
)
|
|
14581
|
+
};
|
|
14582
|
+
}
|
|
14457
14583
|
function isRecord3(value) {
|
|
14458
14584
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
14459
14585
|
}
|
|
14460
14586
|
async function withEphemeralManager(config, fn, options) {
|
|
14461
14587
|
const hostConfig = options?.host ? applyHostToConfig(config, options.host) : config;
|
|
14462
|
-
const
|
|
14588
|
+
const elicitationConfig = options?.interactiveElicitation ? applyInteractiveElicitationCapability(hostConfig) : hostConfig;
|
|
14589
|
+
const resolvedConfig = options?.skillsExtension ? applySkillsExtensionCapability(elicitationConfig) : elicitationConfig;
|
|
14463
14590
|
return withEphemeralClient(resolvedConfig, fn, {
|
|
14464
14591
|
serverId: "__cli__",
|
|
14465
14592
|
clientName: "mcpjam",
|
|
@@ -14529,8 +14656,8 @@ function registerCompatCommands(program) {
|
|
|
14529
14656
|
tools.push(
|
|
14530
14657
|
...result2.tools
|
|
14531
14658
|
);
|
|
14532
|
-
cursor = result2.nextCursor;
|
|
14533
|
-
if (
|
|
14659
|
+
cursor = typeof result2.nextCursor === "string" ? result2.nextCursor : void 0;
|
|
14660
|
+
if (cursor === void 0) break;
|
|
14534
14661
|
if (page === TOOLS_PAGE_CAP2 - 1) truncated = true;
|
|
14535
14662
|
}
|
|
14536
14663
|
const toolsData = { tools };
|
|
@@ -14874,7 +15001,7 @@ function formatServerDoctorHuman(result, options = {}) {
|
|
|
14874
15001
|
`Connection: ${result.connection.status} (${result.connection.detail})`
|
|
14875
15002
|
);
|
|
14876
15003
|
lines.push(
|
|
14877
|
-
`Counts: tools ${result.tools.length}, resources ${result.resources.length}, resourceTemplates ${result.resourceTemplates.length}, prompts ${result.prompts.length}`
|
|
15004
|
+
`Counts: tools ${result.tools.length}, resources ${result.resources.length}, resourceTemplates ${result.resourceTemplates.length}, prompts ${result.prompts.length}, skills ${result.skills.length}`
|
|
14878
15005
|
);
|
|
14879
15006
|
if (result.status === "oauth_required" && result.probe) {
|
|
14880
15007
|
const strategies = result.probe.oauth.registrationStrategies.join(", ") || "none";
|
|
@@ -14917,7 +15044,8 @@ function extractHeaders(headers) {
|
|
|
14917
15044
|
async function listToolsWithMetadata(manager, params) {
|
|
14918
15045
|
const result = await manager.listTools(
|
|
14919
15046
|
params.serverId,
|
|
14920
|
-
|
|
15047
|
+
// Presence, not truthiness: `""` is a valid continuation cursor.
|
|
15048
|
+
params.cursor !== void 0 ? { cursor: params.cursor } : void 0
|
|
14921
15049
|
);
|
|
14922
15050
|
const tools = result.tools ?? [];
|
|
14923
15051
|
const toolsMetadata = manager.getAllToolsMetadata(params.serverId);
|
|
@@ -15087,7 +15215,16 @@ function createMcpJamMcpServer(options) {
|
|
|
15087
15215
|
{
|
|
15088
15216
|
defaultClientName: "mcpjam",
|
|
15089
15217
|
defaultClientVersion: options.version,
|
|
15090
|
-
defaultTimeout: defaultTimeoutMs
|
|
15218
|
+
defaultTimeout: defaultTimeoutMs,
|
|
15219
|
+
// Skills over MCP is mutually declared, so `skills/*` is refused to a
|
|
15220
|
+
// client that never advertised it — the skill tools below would be
|
|
15221
|
+
// correct and useless without this.
|
|
15222
|
+
//
|
|
15223
|
+
// On DEFAULTS rather than per-server `clientCapabilities`, which the
|
|
15224
|
+
// manager advertises verbatim: a verbatim set would drop whatever else
|
|
15225
|
+
// the defaults carry, and would also override a caller who pinned their
|
|
15226
|
+
// own set. Defaults merge, and a pinned set still wins.
|
|
15227
|
+
defaultCapabilities: withSkillsExtensionCapability({})
|
|
15091
15228
|
}
|
|
15092
15229
|
);
|
|
15093
15230
|
const notifications = [];
|
|
@@ -15306,7 +15443,7 @@ function createMcpJamMcpServer(options) {
|
|
|
15306
15443
|
},
|
|
15307
15444
|
async ({ server: name, cursor, templates }) => runTool(async () => {
|
|
15308
15445
|
requireConnected(name);
|
|
15309
|
-
const params = cursor ? { cursor } : void 0;
|
|
15446
|
+
const params = cursor !== void 0 ? { cursor } : void 0;
|
|
15310
15447
|
return templates ? manager.listResourceTemplates(name, params) : manager.listResources(name, params);
|
|
15311
15448
|
})
|
|
15312
15449
|
);
|
|
@@ -15326,6 +15463,78 @@ function createMcpJamMcpServer(options) {
|
|
|
15326
15463
|
return manager.readResource(name, { uri });
|
|
15327
15464
|
})
|
|
15328
15465
|
);
|
|
15466
|
+
server.registerTool(
|
|
15467
|
+
"list_skills",
|
|
15468
|
+
{
|
|
15469
|
+
title: "List the target server's skills",
|
|
15470
|
+
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.",
|
|
15471
|
+
inputSchema: z.object({
|
|
15472
|
+
server: z.string().describe("Connection name from connect_server")
|
|
15473
|
+
}),
|
|
15474
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
15475
|
+
},
|
|
15476
|
+
async ({ server: name }) => runTool(async () => {
|
|
15477
|
+
requireConnected(name);
|
|
15478
|
+
return listServerSkillCatalog(manager, name);
|
|
15479
|
+
})
|
|
15480
|
+
);
|
|
15481
|
+
server.registerTool(
|
|
15482
|
+
"get_skill",
|
|
15483
|
+
{
|
|
15484
|
+
title: "Get a skill from the target server",
|
|
15485
|
+
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.",
|
|
15486
|
+
inputSchema: z.object({
|
|
15487
|
+
server: z.string().describe("Connection name from connect_server"),
|
|
15488
|
+
uri: z.string().describe(
|
|
15489
|
+
"Skill URI. Usually from list_skills, but any uri works \u2014 a skill absent from a partial listing may still be served."
|
|
15490
|
+
)
|
|
15491
|
+
}),
|
|
15492
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
15493
|
+
},
|
|
15494
|
+
async ({ server: name, uri }) => runTool(async () => {
|
|
15495
|
+
requireConnected(name);
|
|
15496
|
+
try {
|
|
15497
|
+
return { skill: await getVerifiedServerSkill(manager, { serverId: name, uri }) };
|
|
15498
|
+
} catch (error) {
|
|
15499
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
15500
|
+
throw error;
|
|
15501
|
+
}
|
|
15502
|
+
})
|
|
15503
|
+
);
|
|
15504
|
+
server.registerTool(
|
|
15505
|
+
"read_skill_file",
|
|
15506
|
+
{
|
|
15507
|
+
title: "Read a skill's supporting file",
|
|
15508
|
+
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.",
|
|
15509
|
+
inputSchema: z.object({
|
|
15510
|
+
server: z.string().describe("Connection name from connect_server"),
|
|
15511
|
+
skillUri: z.string().describe("URI of the skill that owns the file"),
|
|
15512
|
+
resourceUri: z.string().describe(
|
|
15513
|
+
"URI of the supporting file, which must appear in that skill's manifest \u2014 the manifest is the read allowlist."
|
|
15514
|
+
)
|
|
15515
|
+
}),
|
|
15516
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
15517
|
+
},
|
|
15518
|
+
async ({ server: name, skillUri, resourceUri }) => runTool(async () => {
|
|
15519
|
+
requireConnected(name);
|
|
15520
|
+
try {
|
|
15521
|
+
const skill = await getVerifiedServerSkill(manager, {
|
|
15522
|
+
serverId: name,
|
|
15523
|
+
uri: skillUri
|
|
15524
|
+
});
|
|
15525
|
+
return {
|
|
15526
|
+
file: await readVerifiedServerSkillFile(manager, {
|
|
15527
|
+
serverId: name,
|
|
15528
|
+
entry: { uri: skill.skillUri, resources: skill.resources },
|
|
15529
|
+
resourceUri
|
|
15530
|
+
})
|
|
15531
|
+
};
|
|
15532
|
+
} catch (error) {
|
|
15533
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
15534
|
+
throw error;
|
|
15535
|
+
}
|
|
15536
|
+
})
|
|
15537
|
+
);
|
|
15329
15538
|
server.registerTool(
|
|
15330
15539
|
"list_prompts",
|
|
15331
15540
|
{
|
|
@@ -15339,7 +15548,10 @@ function createMcpJamMcpServer(options) {
|
|
|
15339
15548
|
},
|
|
15340
15549
|
async ({ server: name, cursor }) => runTool(async () => {
|
|
15341
15550
|
requireConnected(name);
|
|
15342
|
-
return manager.listPrompts(
|
|
15551
|
+
return manager.listPrompts(
|
|
15552
|
+
name,
|
|
15553
|
+
cursor !== void 0 ? { cursor } : void 0
|
|
15554
|
+
);
|
|
15343
15555
|
})
|
|
15344
15556
|
);
|
|
15345
15557
|
server.registerTool(
|
|
@@ -17400,7 +17612,8 @@ function registerResourcesCommands(program) {
|
|
|
17400
17612
|
config,
|
|
17401
17613
|
(manager, serverId) => manager.listResourceTemplates(
|
|
17402
17614
|
serverId,
|
|
17403
|
-
|
|
17615
|
+
// Presence, not truthiness: `""` is a valid continuation cursor.
|
|
17616
|
+
options.cursor !== void 0 ? { cursor: options.cursor } : void 0
|
|
17404
17617
|
),
|
|
17405
17618
|
{
|
|
17406
17619
|
timeout: globalOptions.timeout,
|
|
@@ -17415,6 +17628,166 @@ function registerResourcesCommands(program) {
|
|
|
17415
17628
|
);
|
|
17416
17629
|
});
|
|
17417
17630
|
}
|
|
17631
|
+
function registerServerSkillsCommands(program) {
|
|
17632
|
+
const skills = program.command("skills").description(
|
|
17633
|
+
"Inspect the Agent Skills an MCP server serves (SEP-2640). For your project's Cloud Skills, see `mcpjam cloud skills`."
|
|
17634
|
+
);
|
|
17635
|
+
addHostOption(
|
|
17636
|
+
addRetryOptions(
|
|
17637
|
+
addSharedServerOptions(
|
|
17638
|
+
skills.command("list").description(
|
|
17639
|
+
"List the skills a server serves, including ones it advertises that cannot be verified"
|
|
17640
|
+
)
|
|
17641
|
+
)
|
|
17642
|
+
)
|
|
17643
|
+
).action(async (options, command) => {
|
|
17644
|
+
const globalOptions = getGlobalOptions(command);
|
|
17645
|
+
const retryPolicy = parseRetryPolicy(options);
|
|
17646
|
+
const host = resolveHostFromOptions(options);
|
|
17647
|
+
const target = describeTarget(options);
|
|
17648
|
+
const collector = globalOptions.rpc ? createCliRpcLogCollector({ __cli__: target }) : void 0;
|
|
17649
|
+
const config = parseServerConfig({
|
|
17650
|
+
...options,
|
|
17651
|
+
timeout: globalOptions.timeout
|
|
17652
|
+
});
|
|
17653
|
+
const result = await withEphemeralManager(
|
|
17654
|
+
config,
|
|
17655
|
+
(manager, serverId) => listServerSkillCatalog(manager, serverId),
|
|
17656
|
+
{
|
|
17657
|
+
timeout: globalOptions.timeout,
|
|
17658
|
+
rpcLogger: collector?.rpcLogger,
|
|
17659
|
+
retryPolicy,
|
|
17660
|
+
host: host?.connection,
|
|
17661
|
+
skillsExtension: true
|
|
17662
|
+
}
|
|
17663
|
+
);
|
|
17664
|
+
writeResult(
|
|
17665
|
+
withRpcLogsIfRequested(result, collector, globalOptions),
|
|
17666
|
+
globalOptions.format
|
|
17667
|
+
);
|
|
17668
|
+
});
|
|
17669
|
+
addHostOption(
|
|
17670
|
+
addRetryOptions(
|
|
17671
|
+
addSharedServerOptions(
|
|
17672
|
+
skills.command("get").description(
|
|
17673
|
+
"Fetch one skill by uri and verify it against its manifest, frontmatter and identity"
|
|
17674
|
+
).option("--skill-uri <uri>", "Skill URI").option("--uri <uri>", "Alias for --skill-uri")
|
|
17675
|
+
)
|
|
17676
|
+
)
|
|
17677
|
+
).action(async (options, command) => {
|
|
17678
|
+
const globalOptions = getGlobalOptions(command);
|
|
17679
|
+
const retryPolicy = parseRetryPolicy(options);
|
|
17680
|
+
const host = resolveHostFromOptions(options);
|
|
17681
|
+
const target = describeTarget(options);
|
|
17682
|
+
const collector = globalOptions.rpc ? createCliRpcLogCollector({ __cli__: target }) : void 0;
|
|
17683
|
+
const skillUri = resolveAliasedStringOption(
|
|
17684
|
+
options,
|
|
17685
|
+
[
|
|
17686
|
+
{ key: "skillUri", flag: "--skill-uri" },
|
|
17687
|
+
{ key: "uri", flag: "--uri" }
|
|
17688
|
+
],
|
|
17689
|
+
"Skill URI",
|
|
17690
|
+
{ required: true }
|
|
17691
|
+
);
|
|
17692
|
+
const config = parseServerConfig({
|
|
17693
|
+
...options,
|
|
17694
|
+
timeout: globalOptions.timeout
|
|
17695
|
+
});
|
|
17696
|
+
const result = await withEphemeralManager(
|
|
17697
|
+
config,
|
|
17698
|
+
async (manager, serverId) => {
|
|
17699
|
+
try {
|
|
17700
|
+
return {
|
|
17701
|
+
skill: await getVerifiedServerSkill(manager, {
|
|
17702
|
+
serverId,
|
|
17703
|
+
uri: skillUri
|
|
17704
|
+
})
|
|
17705
|
+
};
|
|
17706
|
+
} catch (error) {
|
|
17707
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
17708
|
+
throw error;
|
|
17709
|
+
}
|
|
17710
|
+
},
|
|
17711
|
+
{
|
|
17712
|
+
timeout: globalOptions.timeout,
|
|
17713
|
+
rpcLogger: collector?.rpcLogger,
|
|
17714
|
+
retryPolicy,
|
|
17715
|
+
host: host?.connection,
|
|
17716
|
+
skillsExtension: true
|
|
17717
|
+
}
|
|
17718
|
+
);
|
|
17719
|
+
writeResult(
|
|
17720
|
+
withRpcLogsIfRequested(result, collector, globalOptions),
|
|
17721
|
+
globalOptions.format
|
|
17722
|
+
);
|
|
17723
|
+
});
|
|
17724
|
+
addHostOption(
|
|
17725
|
+
addRetryOptions(
|
|
17726
|
+
addSharedServerOptions(
|
|
17727
|
+
skills.command("read").description(
|
|
17728
|
+
"Read one of a skill's supporting files, verified against that skill's manifest"
|
|
17729
|
+
).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")
|
|
17730
|
+
)
|
|
17731
|
+
)
|
|
17732
|
+
).action(async (options, command) => {
|
|
17733
|
+
const globalOptions = getGlobalOptions(command);
|
|
17734
|
+
const retryPolicy = parseRetryPolicy(options);
|
|
17735
|
+
const host = resolveHostFromOptions(options);
|
|
17736
|
+
const target = describeTarget(options);
|
|
17737
|
+
const collector = globalOptions.rpc ? createCliRpcLogCollector({ __cli__: target }) : void 0;
|
|
17738
|
+
const skillUri = resolveAliasedStringOption(
|
|
17739
|
+
options,
|
|
17740
|
+
[{ key: "skillUri", flag: "--skill-uri" }],
|
|
17741
|
+
"Skill URI",
|
|
17742
|
+
{ required: true }
|
|
17743
|
+
);
|
|
17744
|
+
const resourceUri = resolveAliasedStringOption(
|
|
17745
|
+
options,
|
|
17746
|
+
[
|
|
17747
|
+
{ key: "resourceUri", flag: "--resource-uri" },
|
|
17748
|
+
{ key: "uri", flag: "--uri" }
|
|
17749
|
+
],
|
|
17750
|
+
"Resource URI",
|
|
17751
|
+
{ required: true }
|
|
17752
|
+
);
|
|
17753
|
+
const config = parseServerConfig({
|
|
17754
|
+
...options,
|
|
17755
|
+
timeout: globalOptions.timeout
|
|
17756
|
+
});
|
|
17757
|
+
const result = await withEphemeralManager(
|
|
17758
|
+
config,
|
|
17759
|
+
async (manager, serverId) => {
|
|
17760
|
+
try {
|
|
17761
|
+
const skill = await getVerifiedServerSkill(manager, {
|
|
17762
|
+
serverId,
|
|
17763
|
+
uri: skillUri
|
|
17764
|
+
});
|
|
17765
|
+
return {
|
|
17766
|
+
file: await readVerifiedServerSkillFile(manager, {
|
|
17767
|
+
serverId,
|
|
17768
|
+
entry: { uri: skill.skillUri, resources: skill.resources },
|
|
17769
|
+
resourceUri
|
|
17770
|
+
})
|
|
17771
|
+
};
|
|
17772
|
+
} catch (error) {
|
|
17773
|
+
if (isServerSkillRefusalError(error)) return { refusal: error.refusal };
|
|
17774
|
+
throw error;
|
|
17775
|
+
}
|
|
17776
|
+
},
|
|
17777
|
+
{
|
|
17778
|
+
timeout: globalOptions.timeout,
|
|
17779
|
+
rpcLogger: collector?.rpcLogger,
|
|
17780
|
+
retryPolicy,
|
|
17781
|
+
host: host?.connection,
|
|
17782
|
+
skillsExtension: true
|
|
17783
|
+
}
|
|
17784
|
+
);
|
|
17785
|
+
writeResult(
|
|
17786
|
+
withRpcLogsIfRequested(result, collector, globalOptions),
|
|
17787
|
+
globalOptions.format
|
|
17788
|
+
);
|
|
17789
|
+
});
|
|
17790
|
+
}
|
|
17418
17791
|
function registerServerCommands(program) {
|
|
17419
17792
|
const server = program.command("server").description("Inspect MCP server connectivity and capabilities");
|
|
17420
17793
|
addRetryOptions(
|
|
@@ -21013,6 +21386,7 @@ async function main(argv = process.argv, dependencies = {}) {
|
|
|
21013
21386
|
registerServerCommands(program);
|
|
21014
21387
|
registerToolsCommands(program);
|
|
21015
21388
|
registerResourcesCommands(program);
|
|
21389
|
+
registerServerSkillsCommands(program);
|
|
21016
21390
|
registerSubscriptionsCommands(program);
|
|
21017
21391
|
registerCompatCommands(program);
|
|
21018
21392
|
registerPromptCommands(program);
|