@mcpjam/cli 5.3.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 CHANGED
@@ -9,7 +9,7 @@ import { mkdir, writeFile, readFile, chmod, rename, rm, open, unlink, stat } fro
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.3.0"};
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
- ...cursor ? { cursor } : {}
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
- if (!result.nextCursor) return names;
5332
- cursor = result.nextCursor;
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",
@@ -7581,7 +7635,7 @@ function selectorField(singular, plural, values) {
7581
7635
  }
7582
7636
  function composeField(options) {
7583
7637
  const models = Array.isArray(options.composeModel) ? options.composeModel : options.composeModel ? [options.composeModel] : void 0;
7584
- 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;
7585
7639
  if (!options.composeHost) {
7586
7640
  if (refinements) {
7587
7641
  throw usageError(
@@ -7590,10 +7644,28 @@ function composeField(options) {
7590
7644
  }
7591
7645
  return {};
7592
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
+ }
7593
7663
  return {
7594
7664
  compose: {
7595
7665
  host: options.composeHost,
7596
7666
  ...options.composeServerGroup !== void 0 ? { serverGroup: options.composeServerGroup } : {},
7667
+ ...options.composeHostServers === true ? { hostServers: true } : {},
7668
+ ...selectorField("server", "servers", options.composeServer),
7597
7669
  ...models !== void 0 ? { models } : {},
7598
7670
  ...options.withClientDefault === true ? { includeClientDefault: true } : {},
7599
7671
  ...options.saveTargets === true ? { saveTargets: true } : {},
@@ -9217,9 +9289,15 @@ function registerEvalCommands(program) {
9217
9289
  ).option(
9218
9290
  "--save-targets",
9219
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."
9220
9295
  ).option(
9221
9296
  "--compose-server-group <id>",
9222
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."
9223
9301
  ).option(
9224
9302
  "--compose-skill <id...>",
9225
9303
  "Project-shared skill IDs to pin on the composed stack"
@@ -10256,9 +10334,15 @@ function registerEvalCommands(program) {
10256
10334
  ).option(
10257
10335
  "--compose-model <id>",
10258
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."
10259
10340
  ).option(
10260
10341
  "--compose-server-group <id>",
10261
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."
10262
10346
  ).option(
10263
10347
  "--compose-skill <id...>",
10264
10348
  "Project-shared skill IDs to pin on the composed stack"
@@ -11522,6 +11606,8 @@ function registerProjectsCommands(program) {
11522
11606
  process.stderr.write(
11523
11607
  `Not waiting. Follow it with:
11524
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}
11525
11611
  `
11526
11612
  );
11527
11613
  }
@@ -11540,6 +11626,7 @@ function registerProjectsCommands(program) {
11540
11626
  process.stderr.write(
11541
11627
  `Stopped waiting; the request is still ${latest.status} and continues in the cloud.
11542
11628
  mcpjam cloud projects servers connect-status --request ${created.connectionRequestId}
11629
+ mcpjam cloud projects servers connect-cancel --request ${created.connectionRequestId}
11543
11630
  `
11544
11631
  );
11545
11632
  process.exitCode = 1;
@@ -11564,6 +11651,24 @@ function registerProjectsCommands(program) {
11564
11651
  writeResult(payload, globalOptions.format);
11565
11652
  }
11566
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
+ );
11567
11672
  projects.command("status").description(
11568
11673
  "Health-check every server in a project (hosted doctor per server)"
11569
11674
  ).option(
@@ -13906,12 +14011,12 @@ function applyHostVisibility(tools, manager, serverId, policy) {
13906
14011
  var TOOLS_PAGE_CAP = 50;
13907
14012
  async function assertToolVisibleToHost(manager, serverId, toolName, host) {
13908
14013
  if (host.policy.respectToolVisibility === false) return;
13909
- const seenCursors = /* @__PURE__ */ new Set();
13910
14014
  let cursor;
13911
14015
  for (let page = 0; page < TOOLS_PAGE_CAP; page++) {
13912
14016
  const result = await manager.listTools(
13913
14017
  serverId,
13914
- cursor ? { cursor } : void 0
14018
+ // Presence, not truthiness: `""` is a valid continuation cursor.
14019
+ cursor !== void 0 ? { cursor } : void 0
13915
14020
  );
13916
14021
  const tool = (result.tools ?? []).find(
13917
14022
  (t) => t.name === toolName
@@ -13925,9 +14030,7 @@ async function assertToolVisibleToHost(manager, serverId, toolName, host) {
13925
14030
  return;
13926
14031
  }
13927
14032
  cursor = result.nextCursor;
13928
- if (!cursor) return;
13929
- if (seenCursors.has(cursor)) break;
13930
- seenCursors.add(cursor);
14033
+ if (cursor === void 0) return;
13931
14034
  }
13932
14035
  throw usageError(
13933
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.`
@@ -14553,8 +14656,8 @@ function registerCompatCommands(program) {
14553
14656
  tools.push(
14554
14657
  ...result2.tools
14555
14658
  );
14556
- cursor = result2.nextCursor;
14557
- if (!cursor) break;
14659
+ cursor = typeof result2.nextCursor === "string" ? result2.nextCursor : void 0;
14660
+ if (cursor === void 0) break;
14558
14661
  if (page === TOOLS_PAGE_CAP2 - 1) truncated = true;
14559
14662
  }
14560
14663
  const toolsData = { tools };
@@ -14941,7 +15044,8 @@ function extractHeaders(headers) {
14941
15044
  async function listToolsWithMetadata(manager, params) {
14942
15045
  const result = await manager.listTools(
14943
15046
  params.serverId,
14944
- params.cursor ? { cursor: params.cursor } : void 0
15047
+ // Presence, not truthiness: `""` is a valid continuation cursor.
15048
+ params.cursor !== void 0 ? { cursor: params.cursor } : void 0
14945
15049
  );
14946
15050
  const tools = result.tools ?? [];
14947
15051
  const toolsMetadata = manager.getAllToolsMetadata(params.serverId);
@@ -15339,7 +15443,7 @@ function createMcpJamMcpServer(options) {
15339
15443
  },
15340
15444
  async ({ server: name, cursor, templates }) => runTool(async () => {
15341
15445
  requireConnected(name);
15342
- const params = cursor ? { cursor } : void 0;
15446
+ const params = cursor !== void 0 ? { cursor } : void 0;
15343
15447
  return templates ? manager.listResourceTemplates(name, params) : manager.listResources(name, params);
15344
15448
  })
15345
15449
  );
@@ -15444,7 +15548,10 @@ function createMcpJamMcpServer(options) {
15444
15548
  },
15445
15549
  async ({ server: name, cursor }) => runTool(async () => {
15446
15550
  requireConnected(name);
15447
- return manager.listPrompts(name, cursor ? { cursor } : void 0);
15551
+ return manager.listPrompts(
15552
+ name,
15553
+ cursor !== void 0 ? { cursor } : void 0
15554
+ );
15448
15555
  })
15449
15556
  );
15450
15557
  server.registerTool(
@@ -17505,7 +17612,8 @@ function registerResourcesCommands(program) {
17505
17612
  config,
17506
17613
  (manager, serverId) => manager.listResourceTemplates(
17507
17614
  serverId,
17508
- options.cursor ? { cursor: options.cursor } : void 0
17615
+ // Presence, not truthiness: `""` is a valid continuation cursor.
17616
+ options.cursor !== void 0 ? { cursor: options.cursor } : void 0
17509
17617
  ),
17510
17618
  {
17511
17619
  timeout: globalOptions.timeout,