@mcpjam/cli 6.4.2 → 6.4.4
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 +5 -1
- package/dist/index.js +31 -36
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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
|
|
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,
|
|
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.
|
|
38
|
+
version: "6.4.4"};
|
|
39
39
|
|
|
40
40
|
// src/lib/command-outcome.ts
|
|
41
41
|
var UNKNOWN_COMMAND = "(unknown)";
|
|
@@ -13218,6 +13218,7 @@ var SETTABLE_FIELDS = {
|
|
|
13218
13218
|
// Optional-clearable: --unset clears to absent.
|
|
13219
13219
|
respectToolVisibility: { kind: "boolean", unsettable: true },
|
|
13220
13220
|
progressiveToolDiscovery: { kind: "boolean", unsettable: true },
|
|
13221
|
+
runUnloadedToolCalls: { kind: "boolean", unsettable: true },
|
|
13221
13222
|
harness: { kind: "string", unsettable: true },
|
|
13222
13223
|
computer: { kind: "json", unsettable: true },
|
|
13223
13224
|
builtInToolIds: { kind: "json", unsettable: true },
|
|
@@ -25087,26 +25088,18 @@ async function withEventsErrors(method, fn) {
|
|
|
25087
25088
|
throw toEventsCliError(method, error);
|
|
25088
25089
|
}
|
|
25089
25090
|
}
|
|
25090
|
-
function
|
|
25091
|
-
|
|
25092
|
-
|
|
25093
|
-
|
|
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) {
|
|
25091
|
+
function requireCallbackUrl(value, args) {
|
|
25092
|
+
const checked2 = checkCallbackUrl(value);
|
|
25093
|
+
if (!checked2.ok) throw usageError(`${args.flag}: ${checked2.reason}`);
|
|
25094
|
+
if (checked2.insecure && !args.allowInsecure) {
|
|
25102
25095
|
throw usageError(
|
|
25103
|
-
`${args.flag} must be https
|
|
25096
|
+
`${args.flag} must be https://. Pass ${args.insecureFlag} to use plain http for local development (NON-CONFORMANT).`
|
|
25104
25097
|
);
|
|
25105
25098
|
}
|
|
25106
|
-
return
|
|
25099
|
+
return checked2;
|
|
25107
25100
|
}
|
|
25108
25101
|
function insecureModeWarning(flag, url) {
|
|
25109
|
-
return `WARNING: ${flag} is a NON-CONFORMANT development mode. The callback URL ${url} is plain http;
|
|
25102
|
+
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
25103
|
}
|
|
25111
25104
|
function describeDeliveryMismatch(args) {
|
|
25112
25105
|
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 +25189,12 @@ function planConformanceReceiver(options) {
|
|
|
25196
25189
|
let publicOrigin;
|
|
25197
25190
|
let insecure = !tls && insecureFlag;
|
|
25198
25191
|
if (options.publicUrl !== void 0) {
|
|
25199
|
-
const checked2 =
|
|
25192
|
+
const checked2 = requireCallbackUrl(options.publicUrl, {
|
|
25200
25193
|
flag: "--public-url",
|
|
25201
25194
|
insecureFlag: "--insecure-local-receiver",
|
|
25202
25195
|
allowInsecure: insecureFlag
|
|
25203
25196
|
});
|
|
25204
|
-
if (checked2.url.pathname !== "/"
|
|
25197
|
+
if (checked2.url.pathname !== "/") {
|
|
25205
25198
|
throw usageError(
|
|
25206
25199
|
"--public-url must be a bare origin (the conformance receiver serves /i/<inbox>/s/<slot> at the root)."
|
|
25207
25200
|
);
|
|
@@ -25274,8 +25267,6 @@ function renderEventsConformanceTable(result) {
|
|
|
25274
25267
|
);
|
|
25275
25268
|
return redactSecrets(lines.join("\n"));
|
|
25276
25269
|
}
|
|
25277
|
-
|
|
25278
|
-
// src/commands/events-context.ts
|
|
25279
25270
|
function buildContext(options, command) {
|
|
25280
25271
|
const globalOptions = getGlobalOptions(command);
|
|
25281
25272
|
const target = describeTarget(options);
|
|
@@ -25302,7 +25293,7 @@ async function withEventsConnection(options, ctx, fn) {
|
|
|
25302
25293
|
options
|
|
25303
25294
|
);
|
|
25304
25295
|
return withEphemeralManager(
|
|
25305
|
-
config,
|
|
25296
|
+
options.profile ? { ...config, eventsWireProfile: ctx.profile.id === BETA_PROFILE_ID ? "beta" : "legacy" } : config,
|
|
25306
25297
|
async (manager, serverId) => {
|
|
25307
25298
|
if (!options.profile && manager.getEventsSupport(serverId).beta) ctx.profile = parseEventsProfile("beta");
|
|
25308
25299
|
notePeerProtocol(manager, serverId, ctx);
|
|
@@ -25317,7 +25308,7 @@ async function withEventsConnection(options, ctx, fn) {
|
|
|
25317
25308
|
);
|
|
25318
25309
|
}
|
|
25319
25310
|
function notePeerProtocol(manager, serverId, ctx) {
|
|
25320
|
-
const negotiated = manager.
|
|
25311
|
+
const negotiated = manager.getNegotiatedProtocolVersion(serverId);
|
|
25321
25312
|
const documented = ctx.profile.protocolVersions.value;
|
|
25322
25313
|
if (negotiated && !documented.includes(negotiated)) {
|
|
25323
25314
|
ctx.status(
|
|
@@ -25338,13 +25329,13 @@ function addEventsTargetOptions(command) {
|
|
|
25338
25329
|
addSharedServerOptions(
|
|
25339
25330
|
command.option(
|
|
25340
25331
|
"--profile <profile>",
|
|
25341
|
-
'Events profile
|
|
25332
|
+
'Events wire profile: "beta", "draft" or "chatgpt" (default: negotiated Events profile)'
|
|
25342
25333
|
).option(
|
|
25343
25334
|
"--protocol-version <version>",
|
|
25344
25335
|
"Pin the MCP protocol version (e.g. 2026-07-28). HTTP targets only."
|
|
25345
25336
|
).option(
|
|
25346
25337
|
"--force",
|
|
25347
|
-
"Send events/*
|
|
25338
|
+
"Send events/* without the selected capability declaration to probe conformance"
|
|
25348
25339
|
)
|
|
25349
25340
|
)
|
|
25350
25341
|
)
|
|
@@ -25353,7 +25344,7 @@ function addEventsTargetOptions(command) {
|
|
|
25353
25344
|
function addEventArgsOption(command) {
|
|
25354
25345
|
return command.option(
|
|
25355
25346
|
"--event-args <json>",
|
|
25356
|
-
"
|
|
25347
|
+
"Subscription arguments as a JSON object, @path, or - for stdin (default {})"
|
|
25357
25348
|
);
|
|
25358
25349
|
}
|
|
25359
25350
|
function positiveInteger(label) {
|
|
@@ -25772,6 +25763,9 @@ function planWatchReceiver(options) {
|
|
|
25772
25763
|
throw usageError(`--mode must be one of ${WATCH_MODES.join(", ")} (got "${mode}").`);
|
|
25773
25764
|
}
|
|
25774
25765
|
const receiverFlags = options.publicUrl !== void 0 || options.insecureLocalReceiver === true || options.listen !== void 0;
|
|
25766
|
+
if (options.ttl !== void 0 && options.expiry === false) {
|
|
25767
|
+
throw usageError("Pass --ttl or --no-expiry, not both.");
|
|
25768
|
+
}
|
|
25775
25769
|
if (mode !== void 0 && mode !== "webhook" && receiverFlags) {
|
|
25776
25770
|
throw usageError(
|
|
25777
25771
|
"--public-url, --listen and --insecure-local-receiver apply only to --mode webhook."
|
|
@@ -25779,6 +25773,9 @@ function planWatchReceiver(options) {
|
|
|
25779
25773
|
}
|
|
25780
25774
|
const wantsWebhook = mode === "webhook" || receiverFlags;
|
|
25781
25775
|
if (!wantsWebhook) {
|
|
25776
|
+
if (options.ttl !== void 0 || options.expiry === false) {
|
|
25777
|
+
throw usageError("--ttl and --no-expiry apply only to --mode webhook.");
|
|
25778
|
+
}
|
|
25782
25779
|
return mode ? { forcedMode: mode } : {};
|
|
25783
25780
|
}
|
|
25784
25781
|
if (options.publicUrl === void 0 && options.insecureLocalReceiver !== true) {
|
|
@@ -25789,14 +25786,11 @@ function planWatchReceiver(options) {
|
|
|
25789
25786
|
let publicUrl;
|
|
25790
25787
|
let insecure = options.insecureLocalReceiver === true && options.publicUrl === void 0;
|
|
25791
25788
|
if (options.publicUrl !== void 0) {
|
|
25792
|
-
const checked2 =
|
|
25789
|
+
const checked2 = requireCallbackUrl(options.publicUrl, {
|
|
25793
25790
|
flag: "--public-url",
|
|
25794
25791
|
insecureFlag: "--insecure-local-receiver",
|
|
25795
25792
|
allowInsecure: options.insecureLocalReceiver === true
|
|
25796
25793
|
});
|
|
25797
|
-
if (checked2.url.search || checked2.url.hash) {
|
|
25798
|
-
throw usageError("--public-url must not carry a query string or fragment.");
|
|
25799
|
-
}
|
|
25800
25794
|
publicUrl = checked2.url;
|
|
25801
25795
|
insecure = checked2.insecure;
|
|
25802
25796
|
}
|
|
@@ -25829,8 +25823,8 @@ function registerWatch(events) {
|
|
|
25829
25823
|
addEventsTargetOptions(
|
|
25830
25824
|
addEventArgsOption(
|
|
25831
25825
|
events.command("watch").description(
|
|
25832
|
-
"
|
|
25833
|
-
).argument("<name>", "Event name, from `events list`").option("--mode <mode>", "Delivery mode: poll, push or webhook").option(
|
|
25826
|
+
"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."
|
|
25827
|
+
).argument("<name>", "Event type name, from `events list`").option("--mode <mode>", "Delivery mode: poll, push or webhook").option(
|
|
25834
25828
|
"--duration <seconds>",
|
|
25835
25829
|
"Stop after this many seconds",
|
|
25836
25830
|
parseDurationSeconds
|
|
@@ -25838,7 +25832,7 @@ function registerWatch(events) {
|
|
|
25838
25832
|
"--max-events <n>",
|
|
25839
25833
|
"Stop after this many delivered events",
|
|
25840
25834
|
positiveInteger("Max events")
|
|
25841
|
-
).option("--cursor <cursor>", "Start from this cursor (default: null, start from now)").option(
|
|
25835
|
+
).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
25836
|
"--max-age-ms <ms>",
|
|
25843
25837
|
"maxAgeMs sent with poll/stream/subscribe",
|
|
25844
25838
|
(value) => parseNonNegativeInteger(value, "Max age")
|
|
@@ -25936,7 +25930,8 @@ function registerWatch(events) {
|
|
|
25936
25930
|
nextActionAt: 0,
|
|
25937
25931
|
lastCursor: options.cursor ?? null,
|
|
25938
25932
|
consecutiveFailures: 0,
|
|
25939
|
-
...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {}
|
|
25933
|
+
...options.maxAgeMs !== void 0 ? { maxAgeMs: options.maxAgeMs } : {},
|
|
25934
|
+
...mode === "webhook" ? { ttlMs: options.expiry === false ? null : options.ttl ?? DEFAULT_LOCAL_WEBHOOK_TTL_MS } : {}
|
|
25940
25935
|
};
|
|
25941
25936
|
const coordinator = new EventsCoordinator({
|
|
25942
25937
|
rpc: async () => buildRpcPort(manager, serverId, options.force),
|
|
@@ -26031,7 +26026,7 @@ function reportWatchResult(result, ctx) {
|
|
|
26031
26026
|
function registerList(events) {
|
|
26032
26027
|
addEventsTargetOptions(
|
|
26033
26028
|
events.command("list").description(
|
|
26034
|
-
"Report the
|
|
26029
|
+
"Report the selected Events capability and all event types. Exits 2 when the capability is absent, unless --force."
|
|
26035
26030
|
)
|
|
26036
26031
|
).action(async (options, command) => {
|
|
26037
26032
|
const ctx = buildContext(options, command);
|
|
@@ -26172,7 +26167,7 @@ function registerSubscribe(events) {
|
|
|
26172
26167
|
const ctx = buildContext(options, command);
|
|
26173
26168
|
const eventArguments = parseEventArguments(options.eventArgs);
|
|
26174
26169
|
if (!options.callbackUrl) throw usageError("--callback-url is required.");
|
|
26175
|
-
const callback =
|
|
26170
|
+
const callback = requireCallbackUrl(options.callbackUrl, {
|
|
26176
26171
|
flag: "--callback-url",
|
|
26177
26172
|
insecureFlag: "--insecure-callback",
|
|
26178
26173
|
allowInsecure: options.insecureCallback === true
|