@mcpjam/cli 6.4.2 → 6.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,7 +43,7 @@ Local MCP testing:
43
43
  prompts List and fetch MCP prompts
44
44
  apps Validate MCP Apps metadata and resource wiring
45
45
  tasks Create, inspect and drive MCP Tasks
46
- events List, poll, watch, subscribe to and conformance-check MCP Events (triggers, draft@28ec35e)
46
+ events List, poll, watch, subscribe to and conformance-check MCP Events
47
47
  oauth Run MCP OAuth login, proxy, and conformance flows
48
48
  xaa Run the Cross-App Access (ID-JAG) debugger against an MCP server
49
49
  protocol MCP protocol inspection and conformance checks
@@ -86,6 +86,8 @@ mcpjam tools list --url https://your-server.com/mcp --access-token $TOKEN --form
86
86
  mcpjam events list --url https://your-server.com/mcp
87
87
  mcpjam events watch comment.created --url https://your-server.com/mcp \
88
88
  --event-args '{"document_id":"doc_1"}' --duration 60
89
+ mcpjam events conformance --profile beta --url https://your-server.com/mcp \
90
+ --checks events-capability-declared,events-list-shape
89
91
 
90
92
  # Run MCPJam itself as a stdio MCP server (for Claude Desktop, Claude Code, Cursor, ...)
91
93
  mcpjam mcp
@@ -96,6 +98,8 @@ mcpjam cloud projects list
96
98
  mcpjam cloud eval run --suite smoke
97
99
  ```
98
100
 
101
+ The CLI selects Events Beta when the server declares `io.modelcontextprotocol/events` on MCP `2026-07-28`. Use `--profile draft` or `--profile chatgpt` to exercise the corresponding top-level `capabilities.events` contract. Webhook conformance requires a receiver the MCP server can reach. Run `mcpjam events conformance --help` for receiver options.
102
+
99
103
  ## Why
100
104
 
101
105
  MCP servers don't have built-in health checks, OAuth conformance tests, or deploy-time regression detection. `mcpjam` adds those.
package/dist/index.js CHANGED
@@ -30,12 +30,12 @@ import { applyVisibilityPolicyAndCountSignals, isAppOnlyTool, extractHostExecuti
30
30
  import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
31
31
  import { McpServer } from '@modelcontextprotocol/server';
32
32
  import { z } from 'zod';
33
- import { generateWebhookSecret, isValidWebhookSecret, BETA_PROFILE_ID, DRAFT_PROFILE_ID, CHATGPT_PROFILE_ID, getEventsProfile, CHATGPT_2026_09_30_PROFILE_ID, selectDeliveryMode, MemoryEventInbox, computeBindingKey, EventsCoordinator, EventsPushRuntime, hasEventsProfileCapability, createManagerPushPort, applySubscriptionPatch, IDLE_NEXT_ACTION_AT, MAX_DELIVERY_BODY_BYTES } from '@mcpjam/sdk/events';
33
+ import { BETA_PROFILE_ID, checkCallbackUrl, generateWebhookSecret, isValidWebhookSecret, DRAFT_PROFILE_ID, CHATGPT_PROFILE_ID, getEventsProfile, CHATGPT_2026_09_30_PROFILE_ID, selectDeliveryMode, MemoryEventInbox, DEFAULT_LOCAL_WEBHOOK_TTL_MS, computeBindingKey, EventsCoordinator, EventsPushRuntime, hasEventsProfileCapability, createManagerPushPort, applySubscriptionPatch, IDLE_NEXT_ACTION_AT, MAX_DELIVERY_BODY_BYTES } from '@mcpjam/sdk/events';
34
34
  import { selectPluginMcpServerMap, detectPluginMcpTransport } from '@mcpjam/sdk/plugin-bundle';
35
35
 
36
36
  // package.json
37
37
  var package_default = {
38
- version: "6.4.2"};
38
+ version: "6.4.3"};
39
39
 
40
40
  // src/lib/command-outcome.ts
41
41
  var UNKNOWN_COMMAND = "(unknown)";
@@ -25087,26 +25087,18 @@ async function withEventsErrors(method, fn) {
25087
25087
  throw toEventsCliError(method, error);
25088
25088
  }
25089
25089
  }
25090
- function checkCallbackUrl(value, args) {
25091
- let url;
25092
- try {
25093
- url = new URL(value);
25094
- } catch {
25095
- throw usageError(`${args.flag} is not a valid URL: ${value}`);
25096
- }
25097
- if (url.protocol === "https:") return { url, insecure: false };
25098
- if (url.protocol !== "http:") {
25099
- throw usageError(`${args.flag} must be an https:// URL (got ${url.protocol}).`);
25100
- }
25101
- if (!args.allowInsecure) {
25090
+ function requireCallbackUrl(value, args) {
25091
+ const checked2 = checkCallbackUrl(value);
25092
+ if (!checked2.ok) throw usageError(`${args.flag}: ${checked2.reason}`);
25093
+ if (checked2.insecure && !args.allowInsecure) {
25102
25094
  throw usageError(
25103
- `${args.flag} must be https:// \u2014 the MCP Events draft requires https callback URLs. Pass ${args.insecureFlag} to use plain http for local development (NON-CONFORMANT; never a conformance pass).`
25095
+ `${args.flag} must be https://. Pass ${args.insecureFlag} to use plain http for local development (NON-CONFORMANT).`
25104
25096
  );
25105
25097
  }
25106
- return { url, insecure: true };
25098
+ return checked2;
25107
25099
  }
25108
25100
  function insecureModeWarning(flag, url) {
25109
- return `WARNING: ${flag} is a NON-CONFORMANT development mode. The callback URL ${url} is plain http; the MCP Events draft requires https, so a conformant server must refuse it. Results from this mode never count as a conformance pass.`;
25101
+ return `WARNING: ${flag} is a NON-CONFORMANT development mode. The callback URL ${url} is plain http; MCP Events requires HTTPS, so a conformant server must refuse it. Results from this mode never count as a conformance pass.`;
25110
25102
  }
25111
25103
  function describeDeliveryMismatch(args) {
25112
25104
  return `Event "${args.descriptor.name}" advertises delivery [${args.descriptor.delivery.join(", ")}], and profile ${args.profile.id} uses [${args.profile.deliveryModes.value.join(", ")}]; "${args.mode}" is not usable under both.`;
@@ -25196,12 +25188,12 @@ function planConformanceReceiver(options) {
25196
25188
  let publicOrigin;
25197
25189
  let insecure = !tls && insecureFlag;
25198
25190
  if (options.publicUrl !== void 0) {
25199
- const checked2 = checkCallbackUrl(options.publicUrl, {
25191
+ const checked2 = requireCallbackUrl(options.publicUrl, {
25200
25192
  flag: "--public-url",
25201
25193
  insecureFlag: "--insecure-local-receiver",
25202
25194
  allowInsecure: insecureFlag
25203
25195
  });
25204
- if (checked2.url.pathname !== "/" || checked2.url.search || checked2.url.hash) {
25196
+ if (checked2.url.pathname !== "/") {
25205
25197
  throw usageError(
25206
25198
  "--public-url must be a bare origin (the conformance receiver serves /i/<inbox>/s/<slot> at the root)."
25207
25199
  );
@@ -25274,8 +25266,6 @@ function renderEventsConformanceTable(result) {
25274
25266
  );
25275
25267
  return redactSecrets(lines.join("\n"));
25276
25268
  }
25277
-
25278
- // src/commands/events-context.ts
25279
25269
  function buildContext(options, command) {
25280
25270
  const globalOptions = getGlobalOptions(command);
25281
25271
  const target = describeTarget(options);
@@ -25302,7 +25292,7 @@ async function withEventsConnection(options, ctx, fn) {
25302
25292
  options
25303
25293
  );
25304
25294
  return withEphemeralManager(
25305
- config,
25295
+ options.profile ? { ...config, eventsWireProfile: ctx.profile.id === BETA_PROFILE_ID ? "beta" : "legacy" } : config,
25306
25296
  async (manager, serverId) => {
25307
25297
  if (!options.profile && manager.getEventsSupport(serverId).beta) ctx.profile = parseEventsProfile("beta");
25308
25298
  notePeerProtocol(manager, serverId, ctx);
@@ -25317,7 +25307,7 @@ async function withEventsConnection(options, ctx, fn) {
25317
25307
  );
25318
25308
  }
25319
25309
  function notePeerProtocol(manager, serverId, ctx) {
25320
- const negotiated = manager.getCapturedEventsCapability(serverId)?.protocolVersion;
25310
+ const negotiated = manager.getNegotiatedProtocolVersion(serverId);
25321
25311
  const documented = ctx.profile.protocolVersions.value;
25322
25312
  if (negotiated && !documented.includes(negotiated)) {
25323
25313
  ctx.status(
@@ -25338,13 +25328,13 @@ function addEventsTargetOptions(command) {
25338
25328
  addSharedServerOptions(
25339
25329
  command.option(
25340
25330
  "--profile <profile>",
25341
- 'Events profile the run is judged by: "beta", "draft" or "chatgpt" (default: negotiated Events version)'
25331
+ 'Events wire profile: "beta", "draft" or "chatgpt" (default: negotiated Events profile)'
25342
25332
  ).option(
25343
25333
  "--protocol-version <version>",
25344
25334
  "Pin the MCP protocol version (e.g. 2026-07-28). HTTP targets only."
25345
25335
  ).option(
25346
25336
  "--force",
25347
- "Send events/* even when the server did not declare capabilities.events (conformance probing)"
25337
+ "Send events/* without the selected capability declaration to probe conformance"
25348
25338
  )
25349
25339
  )
25350
25340
  )
@@ -25353,7 +25343,7 @@ function addEventsTargetOptions(command) {
25353
25343
  function addEventArgsOption(command) {
25354
25344
  return command.option(
25355
25345
  "--event-args <json>",
25356
- "Event arguments as a JSON object, @path, or - for stdin (default {})"
25346
+ "Subscription arguments as a JSON object, @path, or - for stdin (default {})"
25357
25347
  );
25358
25348
  }
25359
25349
  function positiveInteger(label) {
@@ -25772,6 +25762,9 @@ function planWatchReceiver(options) {
25772
25762
  throw usageError(`--mode must be one of ${WATCH_MODES.join(", ")} (got "${mode}").`);
25773
25763
  }
25774
25764
  const receiverFlags = options.publicUrl !== void 0 || options.insecureLocalReceiver === true || options.listen !== void 0;
25765
+ if (options.ttl !== void 0 && options.expiry === false) {
25766
+ throw usageError("Pass --ttl or --no-expiry, not both.");
25767
+ }
25775
25768
  if (mode !== void 0 && mode !== "webhook" && receiverFlags) {
25776
25769
  throw usageError(
25777
25770
  "--public-url, --listen and --insecure-local-receiver apply only to --mode webhook."
@@ -25779,6 +25772,9 @@ function planWatchReceiver(options) {
25779
25772
  }
25780
25773
  const wantsWebhook = mode === "webhook" || receiverFlags;
25781
25774
  if (!wantsWebhook) {
25775
+ if (options.ttl !== void 0 || options.expiry === false) {
25776
+ throw usageError("--ttl and --no-expiry apply only to --mode webhook.");
25777
+ }
25782
25778
  return mode ? { forcedMode: mode } : {};
25783
25779
  }
25784
25780
  if (options.publicUrl === void 0 && options.insecureLocalReceiver !== true) {
@@ -25789,14 +25785,11 @@ function planWatchReceiver(options) {
25789
25785
  let publicUrl;
25790
25786
  let insecure = options.insecureLocalReceiver === true && options.publicUrl === void 0;
25791
25787
  if (options.publicUrl !== void 0) {
25792
- const checked2 = checkCallbackUrl(options.publicUrl, {
25788
+ const checked2 = requireCallbackUrl(options.publicUrl, {
25793
25789
  flag: "--public-url",
25794
25790
  insecureFlag: "--insecure-local-receiver",
25795
25791
  allowInsecure: options.insecureLocalReceiver === true
25796
25792
  });
25797
- if (checked2.url.search || checked2.url.hash) {
25798
- throw usageError("--public-url must not carry a query string or fragment.");
25799
- }
25800
25793
  publicUrl = checked2.url;
25801
25794
  insecure = checked2.insecure;
25802
25795
  }
@@ -25829,8 +25822,8 @@ function registerWatch(events) {
25829
25822
  addEventsTargetOptions(
25830
25823
  addEventArgsOption(
25831
25824
  events.command("watch").description(
25832
- "Stream an event as NDJSON on stdout until Ctrl-C, --duration or --max-events, then unsubscribe. Modes: push (events/stream), poll (events/poll loop) or webhook (a local receiver behind --public-url). Default: webhook when a receiver flag (--public-url, --listen, --insecure-local-receiver) is given, else push when the event offers it, else poll."
25833
- ).argument("<name>", "Event name, from `events list`").option("--mode <mode>", "Delivery mode: poll, push or webhook").option(
25825
+ "Watch occurrences and control messages for an event type as MCPJam NDJSON until Ctrl-C, --duration or --max-events. On exit, stop polling, close the push stream, or unsubscribe the webhook. Modes: push (events/stream), poll (events/poll loop) or webhook (a local receiver behind --public-url). Default: webhook when a receiver flag (--public-url, --listen, --insecure-local-receiver) is given, else push when the event offers it, else poll."
25826
+ ).argument("<name>", "Event type name, from `events list`").option("--mode <mode>", "Delivery mode: poll, push or webhook").option(
25834
25827
  "--duration <seconds>",
25835
25828
  "Stop after this many seconds",
25836
25829
  parseDurationSeconds
@@ -25838,7 +25831,7 @@ function registerWatch(events) {
25838
25831
  "--max-events <n>",
25839
25832
  "Stop after this many delivered events",
25840
25833
  positiveInteger("Max events")
25841
- ).option("--cursor <cursor>", "Start from this cursor (default: null, start from now)").option(
25834
+ ).option("--ttl <seconds>", "Webhook subscription lifetime (default 600 seconds)", parseDurationSeconds).option("--no-expiry", "Webhook subscription with no expiry").option("--cursor <cursor>", "Start from this cursor (default: null, start from now)").option(
25842
25835
  "--max-age-ms <ms>",
25843
25836
  "maxAgeMs sent with poll/stream/subscribe",
25844
25837
  (value) => parseNonNegativeInteger(value, "Max age")
@@ -25936,7 +25929,8 @@ function registerWatch(events) {
25936
25929
  nextActionAt: 0,
25937
25930
  lastCursor: options.cursor ?? null,
25938
25931
  consecutiveFailures: 0,
25939
- ...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {}
25932
+ ...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {},
25933
+ ...mode === "webhook" ? { ttlMs: options.expiry === false ? null : options.ttl ?? DEFAULT_LOCAL_WEBHOOK_TTL_MS } : {}
25940
25934
  };
25941
25935
  const coordinator = new EventsCoordinator({
25942
25936
  rpc: async () => buildRpcPort(manager, serverId, options.force),
@@ -26031,7 +26025,7 @@ function reportWatchResult(result, ctx) {
26031
26025
  function registerList(events) {
26032
26026
  addEventsTargetOptions(
26033
26027
  events.command("list").description(
26034
- "Report the server's events capability and every event type it offers (events/list, all pages). Exits 2 when the server did not declare capabilities.events, unless --force."
26028
+ "Report the selected Events capability and all event types. Exits 2 when the capability is absent, unless --force."
26035
26029
  )
26036
26030
  ).action(async (options, command) => {
26037
26031
  const ctx = buildContext(options, command);
@@ -26172,7 +26166,7 @@ function registerSubscribe(events) {
26172
26166
  const ctx = buildContext(options, command);
26173
26167
  const eventArguments = parseEventArguments(options.eventArgs);
26174
26168
  if (!options.callbackUrl) throw usageError("--callback-url is required.");
26175
- const callback = checkCallbackUrl(options.callbackUrl, {
26169
+ const callback = requireCallbackUrl(options.callbackUrl, {
26176
26170
  flag: "--callback-url",
26177
26171
  insecureFlag: "--insecure-callback",
26178
26172
  allowInsecure: options.insecureCallback === true