@cyanheads/mcp-ts-core 0.12.2 → 0.12.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.
Files changed (39) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/README.md +1 -1
  4. package/changelog/0.12.x/0.12.3.md +26 -0
  5. package/dist/core/app.d.ts.map +1 -1
  6. package/dist/core/app.js +34 -1
  7. package/dist/core/app.js.map +1 -1
  8. package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
  9. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +19 -12
  10. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
  11. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/utils/toolHandlerFactory.js +43 -35
  13. package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
  14. package/dist/mcp-server/transports/http/httpServer.d.ts.map +1 -1
  15. package/dist/mcp-server/transports/http/httpServer.js +97 -14
  16. package/dist/mcp-server/transports/http/httpServer.js.map +1 -1
  17. package/dist/mcp-server/transports/stdio/stdioTransport.d.ts +29 -0
  18. package/dist/mcp-server/transports/stdio/stdioTransport.d.ts.map +1 -1
  19. package/dist/mcp-server/transports/stdio/stdioTransport.js +33 -0
  20. package/dist/mcp-server/transports/stdio/stdioTransport.js.map +1 -1
  21. package/dist/utils/internal/logger.d.ts +12 -0
  22. package/dist/utils/internal/logger.d.ts.map +1 -1
  23. package/dist/utils/internal/logger.js +39 -6
  24. package/dist/utils/internal/logger.js.map +1 -1
  25. package/dist/utils/internal/performance.d.ts +18 -9
  26. package/dist/utils/internal/performance.d.ts.map +1 -1
  27. package/dist/utils/internal/performance.js +66 -14
  28. package/dist/utils/internal/performance.js.map +1 -1
  29. package/package.json +3 -3
  30. package/skills/api-config/SKILL.md +10 -2
  31. package/skills/api-telemetry/SKILL.md +35 -3
  32. package/skills/git-wrapup/SKILL.md +4 -2
  33. package/skills/polish-docs-meta/references/package-meta.md +1 -1
  34. package/skills/release-and-publish/SKILL.md +9 -2
  35. package/templates/Dockerfile +2 -2
  36. package/templates/package.json +1 -1
  37. package/dist/logs/combined.log +0 -10
  38. package/dist/logs/error.log +0 -6
  39. package/dist/logs/interactions.log +0 -0
@@ -169,6 +169,34 @@ const toBytes = (payload) => {
169
169
  }
170
170
  }
171
171
  };
172
+ // ==========================================================================
173
+ // Tool execution measurement
174
+ // ==========================================================================
175
+ /*
176
+ * Measured-region semantics, settled in #346 and shared by
177
+ * {@link measureToolExecution} and {@link measureResourceExecution}.
178
+ *
179
+ * The measured region spans everything that decides the client-visible
180
+ * outcome: the handler **and** the response pipeline that follows it
181
+ * (output-schema validation, `format()`, the enrichment merge and its trailer
182
+ * render). Telemetry that closed when the handler returned reported a
183
+ * successful call while the client was handed `isError: true`.
184
+ *
185
+ * Two consequences of that width:
186
+ *
187
+ * 1. `mcp.*.duration` covers validation, formatting, and the merge, not the
188
+ * handler alone. It is time-to-produce-the-result, which is what the
189
+ * caller waited for.
190
+ * 2. The callback's return value is the assembled client result, so it is no
191
+ * longer what `mcp.*.output_bytes` should measure — `content[]` re-renders
192
+ * the same data the structured payload carries, and counting both would
193
+ * silently redefine an existing series. Callers therefore designate the
194
+ * payload explicitly via the `recordOutput` argument, which also feeds
195
+ * partial-success detection. `output_bytes` keeps measuring the handler's
196
+ * returned domain value, unchanged from 0.12.2. When nothing is
197
+ * designated, the callback's return value is measured — the single-value
198
+ * form for callers with no assembly step.
199
+ */
172
200
  /**
173
201
  * Wraps a tool's logic function with observability: an OpenTelemetry span,
174
202
  * OTel metric counters/histogram, payload size capture, and structured log.
@@ -179,12 +207,17 @@ const toBytes = (payload) => {
179
207
  * On success the resolved value is passed through transparently.
180
208
  * On failure the error is re-thrown after being recorded on the span and metrics;
181
209
  * `McpError` instances surface their numeric `code` as the error code attribute.
210
+ * A failure anywhere in the callback — handler or response pipeline — is
211
+ * recorded, and no output-size histogram is emitted for it.
182
212
  *
183
213
  * @template T - The resolved type of the tool's return value.
184
- * @param toolLogicFn - Async function containing the tool's business logic. Receives
185
- * `context` re-bound to the execution span this function opens, so a handler
186
- * context built from it correlates to the span the handler actually runs in
187
- * rather than to the enclosing request span.
214
+ * @param toolLogicFn - Async function containing the tool's business logic and
215
+ * the response assembly that follows it. Receives `context` re-bound to the
216
+ * execution span this function opens, so a handler context built from it
217
+ * correlates to the span the handler actually runs in rather than to the
218
+ * enclosing request span, plus `recordOutput` — call it with the handler's
219
+ * domain value to designate what `mcp.tool.output_bytes` and partial-success
220
+ * detection measure. Without a call, the callback's return value is measured.
188
221
  * @param context - Request context extended with `toolName`; used for span/log correlation.
189
222
  * @param inputPayload - The raw input object passed to the tool, serialized to compute byte size.
190
223
  * @param successAttributes - Optional thunk evaluated after a successful run; its
@@ -219,14 +252,23 @@ export async function measureToolExecution(toolLogicFn, context, inputPayload, s
219
252
  let partialSuccess = false;
220
253
  let batchSucceeded;
221
254
  let batchFailed;
255
+ let designatedOutput;
256
+ let outputDesignated = false;
257
+ const recordOutput = (payload) => {
258
+ designatedOutput = payload;
259
+ outputDesignated = true;
260
+ };
222
261
  try {
223
- const result = await toolLogicFn(spanContext);
262
+ const result = await toolLogicFn(spanContext, recordOutput);
224
263
  ok = true;
225
- outputBytes = toBytes(result);
226
- // Detect partial success: handler returned but result contains a non-empty `failed` array.
264
+ const measuredOutput = outputDesignated ? designatedOutput : result;
265
+ outputBytes = toBytes(measuredOutput);
266
+ // Detect partial success: the measured payload contains a non-empty `failed` array.
227
267
  // Convention-based — matches the batch response pattern recommended by the design skill.
228
- if (result != null && typeof result === 'object' && !Array.isArray(result)) {
229
- const obj = result;
268
+ if (measuredOutput != null &&
269
+ typeof measuredOutput === 'object' &&
270
+ !Array.isArray(measuredOutput)) {
271
+ const obj = measuredOutput;
230
272
  if (Array.isArray(obj.failed) && obj.failed.length > 0) {
231
273
  partialSuccess = true;
232
274
  batchFailed = obj.failed.length;
@@ -342,11 +384,15 @@ function getResourceMetrics() {
342
384
  }
343
385
  /**
344
386
  * Wraps a resource handler with observability: OTel span, metric counters/histogram,
345
- * and a structured log. Mirrors {@link measureToolExecution} but tuned for resource reads.
387
+ * and a structured log. Mirrors {@link measureToolExecution} but tuned for resource reads,
388
+ * including the measured-region semantics documented there.
346
389
  *
347
390
  * @template T - The resolved type of the resource handler's return value.
348
- * @param resourceLogicFn - Async function containing the resource handler. Receives
349
- * `context` re-bound to the execution span this function opens.
391
+ * @param resourceLogicFn - Async function containing the resource handler and the
392
+ * response assembly that follows it. Receives `context` re-bound to the execution
393
+ * span this function opens, plus `recordOutput` — call it with the handler's domain
394
+ * value to designate what `mcp.resource.output_bytes` measures. Without a call, the
395
+ * callback's return value is measured.
350
396
  * @param context - Request context extended with `resourceName`; used for span/log correlation.
351
397
  * @param meta - Resource metadata: URI and MIME type for span attributes.
352
398
  * @returns A promise that resolves with the handler's return value or rejects with the original error.
@@ -370,10 +416,16 @@ export async function measureResourceExecution(resourceLogicFn, context, meta) {
370
416
  let inputRequired = false;
371
417
  let errorCode;
372
418
  let outputBytes = 0;
419
+ let designatedOutput;
420
+ let outputDesignated = false;
421
+ const recordOutput = (payload) => {
422
+ designatedOutput = payload;
423
+ outputDesignated = true;
424
+ };
373
425
  try {
374
- const result = await resourceLogicFn(spanContext);
426
+ const result = await resourceLogicFn(spanContext, recordOutput);
375
427
  ok = true;
376
- outputBytes = toBytes(result);
428
+ outputBytes = toBytes(outputDesignated ? designatedOutput : result);
377
429
  span.setStatus({ code: SpanStatusCode.OK });
378
430
  span.setAttribute(ATTR_MCP_RESOURCE_SIZE_BYTES, outputBytes);
379
431
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"performance.js","sourceRoot":"","sources":["../../../src/utils/internal/performance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAA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SAAS,CAAC,WAAW,EAAE;gBACrB,UAAU;gBACV,OAAO,EAAE;oBACP,UAAU;oBACV,SAAS,EAAE,EAAE;oBACb,SAAS;oBACT,UAAU;oBACV,WAAW;oBACX,YAAY;oBACZ,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;iBACxC;aACF,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"performance.js","sourceRoot":"","sources":["../../../src/utils/internal/performance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAsB,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAuB,cAAc,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,EAC3B,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,2BAA2B,EAC3B,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,kBAAkB,EAClB,0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W;oBACX,YAAY;oBACZ,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;iBACxC;aACF,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cyanheads/mcp-ts-core",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "mcpName": "io.github.cyanheads/mcp-ts-core",
5
- "description": "Agent-native TypeScript framework for building MCP servers. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
5
+ "description": "Agent-native TypeScript framework for building MCP servers. Build tools, not infrastructure. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
6
6
  "files": [
7
7
  "changelog/",
8
8
  "dist/",
@@ -273,7 +273,7 @@
273
273
  "url": "https://www.buymeacoffee.com/cyanheads"
274
274
  }
275
275
  ],
276
- "packageManager": "bun@1.3.14",
276
+ "packageManager": "bun@1.4.0",
277
277
  "engines": {
278
278
  "bun": ">=1.3.0",
279
279
  "node": ">=24.0.0"
@@ -4,7 +4,7 @@ description: >
4
4
  Reference for core and server configuration in `@cyanheads/mcp-ts-core`. Covers env var tables with defaults, priority order, server-specific Zod schema pattern, and Workers lazy-parsing requirement.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "1.12"
7
+ version: "1.13"
8
8
  audience: external
9
9
  type: reference
10
10
  ---
@@ -86,7 +86,7 @@ await createApp({
86
86
  | `MCP_HTTP_HOST` | `mcpHttpHost` | `127.0.0.1` | Bind address |
87
87
  | `MCP_HTTP_ENDPOINT_PATH` | `mcpHttpEndpointPath` | `/mcp` | HTTP endpoint path |
88
88
  | `MCP_HTTP_MAX_BODY_BYTES` | `mcpHttpMaxBodyBytes` | `1048576` (1 MiB) | Max **inbound** JSON-RPC request body; oversized requests get `413` before per-request allocation. Does **not** cap upstream data staged into a canvas or response sizes. `0` disables (defer to runtime/proxy). |
89
- | `MCP_HTTP_MAX_PORT_RETRIES` | `mcpHttpMaxPortRetries` | `15` | Retry count if port is busy |
89
+ | `MCP_HTTP_MAX_PORT_RETRIES` | `mcpHttpMaxPortRetries` | `15` | Rungs of the port ladder walked when a bind collides; each rung tries `port + 1`. See [Port binding](#port-binding) |
90
90
  | `MCP_HTTP_PORT_RETRY_DELAY_MS` | `mcpHttpPortRetryDelayMs` | `50` | Delay between port retries (ms) |
91
91
  | `MCP_SESSION_MODE` | `mcpSessionMode` | `auto` | `stateless` \| `stateful` \| `auto` |
92
92
  | `MCP_STATEFUL_SESSION_STALE_TIMEOUT_MS` | `mcpStatefulSessionStaleTimeoutMs` | `1800000` | 30 min; stale session eviction |
@@ -101,6 +101,14 @@ await createApp({
101
101
  | `MCP_HEARTBEAT_MISS_THRESHOLD` | `mcpHeartbeatMissThreshold` | `3` | Missed heartbeats before session is considered stale |
102
102
  | `MCP_GC_PRESSURE_INTERVAL_MS` | `mcpGcPressureIntervalMs` | `0` (disabled) | Bun-only opt-in forced GC loop for HTTP deployments with heap growth |
103
103
 
104
+ #### Port binding
105
+
106
+ `MCP_HTTP_PORT` is where the HTTP transport starts, not necessarily where it ends up. Startup walks a ladder: bind `MCP_HTTP_PORT`, and on a collision wait `MCP_HTTP_PORT_RETRY_DELAY_MS` and try the next port, up to `MCP_HTTP_MAX_PORT_RETRIES` times. Read the bound port off the `HTTP transport listening at …` log line or the startup banner — with the defaults the server may be anywhere in `3010`–`3025`. Pin the port by setting `MCP_HTTP_MAX_PORT_RETRIES=0`, which makes a collision a startup failure instead of a silent move.
107
+
108
+ - **Startup resolves only once the server reports `'listening'`.** A bind failure arriving after the listen call — a collision the pre-bind probe could not see, because another process took the port in between — is routed to the ladder like any other, not reported as a successful start.
109
+ - **A failure the ladder cannot clear rejects immediately.** Each rung only changes the port, so `EACCES` (privileged port, typically `<1024` as a non-root user) and `EADDRNOTAVAIL` (the `MCP_HTTP_HOST` address is not local to this machine) fail startup on the first attempt with the OS error as the rejection's `cause`, rather than burning every rung. Ladder exhaustion carries the last bind error as `cause` too, when a real bind attempt produced one.
110
+ - **Runtime caveat:** Bun reports a permission-denied bind as `EADDRINUSE` where Node reports `EACCES`. On Bun a privileged port therefore reads as an ordinary collision and walks the whole ladder before failing with `Failed to bind to any port after N retries.` — on Node the same port fails on the first attempt, naming `EACCES`.
111
+
104
112
  ---
105
113
 
106
114
  ### Auth
@@ -4,7 +4,7 @@ description: >
4
4
  Catalog of OpenTelemetry instrumentation built into framework `@cyanheads/mcp-ts-core` — spans, metrics, completion logs, env config, runtime caveats, custom instrumentation patterns, and cardinality rules. Use when enabling OTel export, adding custom spans or metrics in services, debugging missing telemetry, looking up attribute names, or deciding what's safe to put on a metric attribute vs. a span.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "1.5"
7
+ version: "1.7"
8
8
  audience: external
9
9
  type: reference
10
10
  ---
@@ -57,6 +57,25 @@ Cloud platform detection auto-populates resource attributes:
57
57
 
58
58
  ---
59
59
 
60
+ ## Flush at exit
61
+
62
+ Spans batch and metrics push on a 15-second cycle, so a process that exits between cycles takes its telemetry with it. `ServerHandle.shutdown()` is the drain: it stops the transport, then force-flushes traces and metrics through the OTLP exporters and closes the logger.
63
+
64
+ | Trigger | Path |
65
+ |:--------|:-----|
66
+ | `SIGTERM` / `SIGINT` | `shutdown(signal)` |
67
+ | `uncaughtException` / `unhandledRejection` | `shutdown(signal)`, then `process.exit(1)` |
68
+ | stdin EOF, stdio transport | `shutdown('STDIN_EOF')`, then `process.exit(0)` |
69
+ | `ServerHandle.shutdown()` called directly | the same drain, no exit |
70
+
71
+ **Stdin EOF is a disconnect.** A stdio host closing the pipe runs the cleanup a signal runs, exactly once — the shutdown detaches the signal handlers and the EOF watcher as it starts, so neither can re-enter it — and the process then exits explicitly instead of waiting to run out of handles. Two things follow: the OTLP export leaves the process, and a `setInterval` a service registered without `unref()` can no longer keep the server resident after its client is gone. The path writes nothing to stdout.
72
+
73
+ **The drain is bounded.** Shutdown-on-exit races a 10-second backstop, so a cleanup step that never settles still terminates the process. The logger bounds its own flush separately, per pino instance: a completing callback is awaited in full, and a runtime whose callback never arrives releases shutdown rather than hanging it.
74
+
75
+ Workers has no `ServerHandle` and no `NodeSDK` — flush whatever exporter you wired there yourself, via `ctx.waitUntil()`.
76
+
77
+ ---
78
+
60
79
  ## Spans
61
80
 
62
81
  Every handler call gets a span. Nested operations (storage, graph, LLM) become child spans on the same trace. All spans carry `code.function.name` and `code.namespace` for code-attribution. Errors are recorded via `span.recordException()` and `SpanStatusCode.ERROR`; `McpError` codes surface as the `*.error_code` attribute.
@@ -74,6 +93,19 @@ Every handler call gets a span. Nested operations (storage, graph, LLM) become c
74
93
 
75
94
  A handler that ends its round with `ctx.requestInput(...)` closes its span `OK` with `mcp.*.input_required` set — no recorded exception, no error-counter increment. Multi-round-trip input is protocol control flow, so it never inflates error rates; split on that attribute to tell an incomplete round from a completed call.
76
95
 
96
+ ### The measured region
97
+
98
+ A tool or resource call is measured from the start of the handler through the response pipeline that follows it: output-schema validation, `format()`, the enrichment merge, and the trailer render for tools; output-schema validation and `format()` for resources. Telemetry therefore records the outcome the client sees — a failure in any of those is an ERROR span, `success=false` counters, an error-counter increment, and `isSuccess: false` in the completion log, matching the `isError: true` the caller receives. Prompt generation has no post-handler pipeline, so its region is the generate function alone.
99
+
100
+ Two consequences worth knowing when reading a dashboard:
101
+
102
+ | Signal | What it covers |
103
+ |:-------|:---------------|
104
+ | `mcp.tool.duration` / `mcp.resource.duration` | The handler **plus** validation, formatting, and the enrichment merge — time to produce the result, not time spent in handler code. An expensive `format()` shows up here. |
105
+ | `mcp.tool.output_bytes` / `mcp.resource.output_bytes` | The handler's returned domain value, not the assembled result. `content[]` re-renders the data the structured payload already carries, so measuring the assembly would double-count it. Nothing is recorded for a call that fails after the handler. |
106
+
107
+ `mcp.tool.partial_success` and the `mcp.tool.batch.*` counts read the same domain value, so a batch envelope (`{ succeeded, failed }`) is still detected once the result has been assembled around it.
108
+
77
109
  Trace context propagates across boundaries via W3C `traceparent` headers. See `api-utils` → `telemetry/trace` for `withSpan`, `buildTraceparent`, `extractTraceparent`, `createContextWithParentTrace`, `injectCurrentContextInto`, `runInContext` signatures.
78
110
 
79
111
  ---
@@ -90,12 +122,12 @@ All custom metrics are namespaced `mcp.*` (or `process.*` / `http.client.*` wher
90
122
  | `mcp.tool.duration` | histogram | `ms` | `mcp.tool.name`, `mcp.tool.success` |
91
123
  | `mcp.tool.errors` | counter | `{errors}` | `mcp.tool.name`, `mcp.tool.error_category` (`upstream`/`server`/`client`) |
92
124
  | `mcp.tool.input_bytes` | histogram | `bytes` | `mcp.tool.name` |
93
- | `mcp.tool.output_bytes` | histogram | `bytes` | `mcp.tool.name` (success only) |
125
+ | `mcp.tool.output_bytes` | histogram | `bytes` | `mcp.tool.name` (success only; the handler's returned value) |
94
126
  | `mcp.tool.param.usage` | counter | `{uses}` | `mcp.tool.name`, `mcp.tool.param` (top-level keys supplied by caller) |
95
127
  | `mcp.resource.reads` | counter | `{reads}` | `mcp.resource.name`, `mcp.resource.success` |
96
128
  | `mcp.resource.duration` | histogram | `ms` | `mcp.resource.name`, `mcp.resource.success` |
97
129
  | `mcp.resource.errors` | counter | `{errors}` | `mcp.resource.name` |
98
- | `mcp.resource.output_bytes` | histogram | `bytes` | `mcp.resource.name` (success only) |
130
+ | `mcp.resource.output_bytes` | histogram | `bytes` | `mcp.resource.name` (success only; the handler's returned value) |
99
131
  | `mcp.prompt.generations` | counter | `{generations}` | `mcp.prompt.name`, `mcp.prompt.success` |
100
132
  | `mcp.prompt.duration` | histogram | `ms` | `mcp.prompt.name`, `mcp.prompt.success` |
101
133
  | `mcp.prompt.errors` | counter | `{errors}` | `mcp.prompt.name`, `mcp.prompt.error_category` |
@@ -4,7 +4,7 @@ description: >
4
4
  Land working-tree changes as logical commits — the work grouped by concern, topped by a release commit (version bump, changelog, regenerated artifacts) and an annotated tag. Verify, commit, tag. Stops at "committed and tagged locally" — no push, no publish. The release-and-publish skill picks up from here. Distilled from the git_wrapup_instructions protocol.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "1.10"
7
+ version: "1.11"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -27,7 +27,7 @@ Every item must be true before starting wrapup. Committing means releasing — a
27
27
  - [ ] **Code simplified** — if the diff spans more than ~50 changed lines or touches 3+ source files, the `code-simplifier` skill has been run across the changes
28
28
  - [ ] **`bun run devcheck` passes** — typecheck + lint clean
29
29
  - [ ] **`bun run rebuild` succeeds** — full clean build from scratch
30
- - [ ] **All tests pass** — `bun run test:all` (or `bun run test`). New tests and regression tests added as needed for the changes being shipped.
30
+ - [ ] **All tests pass** — `bun run test:all` (or `bun run test`), plus `bun run test:package` where the project defines one: it guards the public-export manifest and is not part of `test:all`. New tests and regression tests added as needed for the changes being shipped.
31
31
  - [ ] **Fixes verified** — bug fixes validated, generally via `bun run rebuild` and field-testing. Not just written — confirmed to resolve the described behavior.
32
32
  - [ ] **No known regressions** — the changes don't break existing functionality
33
33
  - [ ] **GH issues updated** — issues addressed by this work commented with what landed and any follow-ups needed. Concise. Backlinked as needed.
@@ -119,6 +119,7 @@ The tree being committed must pass verification. Both must succeed:
119
119
  ```bash
120
120
  bun run devcheck
121
121
  bun run test:all # or `bun run test` if no test:all script exists
122
+ bun run test:package # only if the script exists — NOT part of test:all
122
123
  ```
123
124
 
124
125
  **If either fails, halt.** Do not bypass verification to land the commit. Fix the issue first, then re-run from step 6.
@@ -237,6 +238,7 @@ If the working tree isn't clean or the tag doesn't point at HEAD, something went
237
238
  - [ ] `docs/tree.md` regenerated if structure changed (`bun run tree`)
238
239
  - [ ] `bun run devcheck` passes
239
240
  - [ ] `bun run test:all` (or `test`) passes
241
+ - [ ] `bun run test:package` passes, when the project defines it — it guards the public-export manifest and `test:all` does not run it
240
242
  - [ ] Work grouped into logical commits (large features split by layer); release artifacts (version + changelog + tree) committed separately on top, subject leading with the version
241
243
  - [ ] Every commit carries a body, and every body is one or two lines — none subject-only, none a paragraph
242
244
  - [ ] Annotated tag `v<version>` with structured markdown message, final line linking this version's changelog file
@@ -28,7 +28,7 @@ These are set by `init` and generally don't need changes. Verify they're present
28
28
  | `types` | `"dist/index.d.ts"` | TypeScript declarations |
29
29
  | `files` | `["dist/"]` | What npm publishes |
30
30
  | `engines` | `{ "node": ">=24.0.0", "bun": ">=1.3.0" }` | Node runs the built `dist/`; Bun is the dev floor |
31
- | `packageManager` | `"bun@1.3.14"` | Pins the dev package manager; keep current with the framework's Bun version |
31
+ | `packageManager` | `"bun@1.4.0"` | Pins the dev package manager; keep current with the framework's Bun version |
32
32
  | `scripts` | _(various)_ | Build, dev, test scripts |
33
33
  | `dependencies` | `@cyanheads/mcp-ts-core` | Core framework |
34
34
 
@@ -4,7 +4,7 @@ description: >
4
4
  Ship a release end-to-end across every registry the project targets (npm, MCP Registry, GitHub Releases for `.mcpb` bundles, GHCR). Runs the final verification gate, pushes commits and tags, then publishes to each applicable destination. Assumes git wrapup (version bumps, changelog, commit, annotated tag) is already complete — this skill is the post-wrapup publish workflow. Retries transient network failures on publish steps; halts with a partial-state report when retries are exhausted or the failure is terminal.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "2.12"
7
+ version: "1.11"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -73,14 +73,20 @@ If working tree is dirty or HEAD isn't on `v<version>`, halt.
73
73
 
74
74
  ### 2. Run the verification gate
75
75
 
76
- All three must succeed. Check `package.json` `scripts` for `test:all`; if absent, fall back to `test`:
76
+ All must succeed. Check `package.json` `scripts` for `test:all`; if absent, fall back to `test`:
77
77
 
78
78
  ```bash
79
79
  bun run devcheck
80
80
  bun run rebuild
81
81
  bun run test:all # or `bun run test` if no test:all
82
+ bun run test:package # only if the script exists — NOT part of test:all
82
83
  ```
83
84
 
85
+ `test:package` is a separate gate wherever a project defines one: it verifies the public-export
86
+ manifest against what the built subpaths actually export. A release that adds, removes, or renames
87
+ an export passes `test:all` and fails here. Regenerate the manifest with the command the failure
88
+ names rather than editing it by hand.
89
+
84
90
  Any non-zero exit → halt with the failing command's output.
85
91
 
86
92
  ### 3. Push to origin
@@ -214,6 +220,7 @@ If any check fails, halt and report which destination is unreachable. A successf
214
220
  - [ ] `bun run devcheck` passes
215
221
  - [ ] `bun run rebuild` succeeds
216
222
  - [ ] `bun run test:all` (or `test`) passes
223
+ - [ ] `bun run test:package` passes, when the project defines it
217
224
  - [ ] Commits pushed to origin
218
225
  - [ ] Tags pushed to origin
219
226
  - [ ] `bun publish --access public` succeeds
@@ -4,7 +4,7 @@
4
4
  # This stage installs all dependencies (including dev), builds the TypeScript
5
5
  # source code into JavaScript, and prepares the production assets.
6
6
  # ==============================================================================
7
- FROM oven/bun:1.3.14 AS build
7
+ FROM oven/bun:1.4.0 AS build
8
8
 
9
9
  WORKDIR /usr/src/app
10
10
 
@@ -30,7 +30,7 @@ RUN bun run build
30
30
  # application. It uses a slim base image and only includes production
31
31
  # dependencies and build artifacts.
32
32
  # ==============================================================================
33
- FROM oven/bun:1.3.14-slim AS production
33
+ FROM oven/bun:1.4.0-slim AS production
34
34
 
35
35
  WORKDIR /usr/src/app
36
36
 
@@ -51,7 +51,7 @@
51
51
  "url": ""
52
52
  },
53
53
  "license": "Apache-2.0",
54
- "packageManager": "bun@1.3.14",
54
+ "packageManager": "bun@1.4.0",
55
55
  "engines": {
56
56
  "bun": ">=1.3.0",
57
57
  "node": ">=24.0.0"
@@ -1,10 +0,0 @@
1
- {"level":40,"time":1787257451141,"env":"testing","version":"0.12.2","pid":2077,"operation":"TransportManager.start","requestId":"43OM2-VIOAT","timestamp":"2026-08-20T20:24:11.140Z","transport":"http","component":"HttpTransportSetup","msg":"MCP_ALLOWED_ORIGINS is not set — CORS is wildcard for CLI clients; browser Origin headers are restricted to loopback. Set MCP_ALLOWED_ORIGINS for production deployments accepting remote browser origins."}
2
- {"level":40,"time":1787257453310,"env":"testing","version":"0.12.2","pid":2077,"operation":"HttpRpcRequest","requestId":"HQIB2-ZJ6Z9","sessionId":"not-a-real-session-1787257453308","timestamp":"2026-08-20T20:24:13.310Z","component":"HttpTransport","msg":"Session validation failed - invalid or hijacked session"}
3
- {"level":50,"time":1787257456744,"env":"testing","version":"0.0.0-test","pid":2100,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"ZC6PT-US941","sessionId":"150a3b106bcd4ba471ddf23e8ea5fab8e71307c5d51656146dfdfbd513728f14","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.744Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"ZC6PT-US941","sessionId":"150a3b106bcd4ba471ddf23e8ea5fab8e71307c5d51656146dfdfbd513728f14","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.744Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19","msg":"Error in tool:scoped_echo: Insufficient permissions."}
4
- {"level":50,"time":1787257456756,"env":"testing","version":"0.0.0-test","pid":2100,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"SCLK4-INO9D","sessionId":"22becb78f201a05364e2fdd3017a2338924a22ff02bcc77a7a102082f8de990a","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.756Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"SCLK4-INO9D","sessionId":"22becb78f201a05364e2fdd3017a2338924a22ff02bcc77a7a102082f8de990a","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.756Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19","msg":"Error in tool:scoped_echo: Insufficient permissions."}
5
- {"level":50,"time":1787257457780,"env":"testing","version":"0.0.0-test","pid":2112,"operation":"HandleToolRequest","requestId":"0VL0G-EUGXV","sessionId":"73208d8b75f52313dc79c52a60167eea89c365751827c90b84dad53015dbe340","timestamp":"2026-08-20T20:24:17.774Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"0VL0G-EUGXV","sessionId":"73208d8b75f52313dc79c52a60167eea89c365751827c90b84dad53015dbe340","timestamp":"2026-08-20T20:24:17.774Z","toolName":"session_cancellable_tool","originalErrorName":"stringEncountered","originalMessage":"AbortError: cancel tool request"},"stack":"McpError: AbortError: cancel tool request\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:186:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:20\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
6
- {"level":40,"time":1787257469530,"env":"testing","version":"0.12.2","pid":2213,"operation":"TransportManager.start","requestId":"1UYP2-LCSAT","timestamp":"2026-08-20T20:24:29.529Z","transport":"http","component":"HttpTransportSetup","msg":"MCP_ALLOWED_ORIGINS is not set — CORS is wildcard for CLI clients; browser Origin headers are restricted to loopback. Set MCP_ALLOWED_ORIGINS for production deployments accepting remote browser origins."}
7
- {"level":40,"time":1787257471475,"env":"testing","version":"0.12.2","pid":2213,"operation":"HttpRpcRequest","requestId":"9J8HH-QGBPX","sessionId":"not-a-real-session-1787257471474","timestamp":"2026-08-20T20:24:31.475Z","component":"HttpTransport","msg":"Session validation failed - invalid or hijacked session"}
8
- {"level":50,"time":1787257474800,"env":"testing","version":"0.0.0-test","pid":2235,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"6R39F-UVSOT","sessionId":"65a11974803af77e5115ccaad32660eb2ab875016ed0d4332490522fae79e98c","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.799Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"6R39F-UVSOT","sessionId":"65a11974803af77e5115ccaad32660eb2ab875016ed0d4332490522fae79e98c","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.799Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
9
- {"level":50,"time":1787257474807,"env":"testing","version":"0.0.0-test","pid":2235,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"WYG05-52QRJ","sessionId":"50b46576df7ff245b4ad221cb01746a81b8ffb5ce7395ceef3aeb0b8dc15476d","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.807Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"WYG05-52QRJ","sessionId":"50b46576df7ff245b4ad221cb01746a81b8ffb5ce7395ceef3aeb0b8dc15476d","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.807Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
10
- {"level":50,"time":1787257475576,"env":"testing","version":"0.0.0-test","pid":2246,"operation":"HandleToolRequest","requestId":"7QR9T-RGZ5H","sessionId":"b7b50d5e87c58a4da184f5a37d899fab22a88979870de391bb25021ed2a60f2c","timestamp":"2026-08-20T20:24:35.572Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"7QR9T-RGZ5H","sessionId":"b7b50d5e87c58a4da184f5a37d899fab22a88979870de391bb25021ed2a60f2c","timestamp":"2026-08-20T20:24:35.572Z","toolName":"session_cancellable_tool","originalErrorName":"stringEncountered","originalMessage":"AbortError: cancel tool request"},"stack":"McpError: AbortError: cancel tool request\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:186:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
@@ -1,6 +0,0 @@
1
- {"level":50,"time":1787257456744,"env":"testing","version":"0.0.0-test","pid":2100,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"ZC6PT-US941","sessionId":"150a3b106bcd4ba471ddf23e8ea5fab8e71307c5d51656146dfdfbd513728f14","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.744Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"ZC6PT-US941","sessionId":"150a3b106bcd4ba471ddf23e8ea5fab8e71307c5d51656146dfdfbd513728f14","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.744Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1787257456756,"env":"testing","version":"0.0.0-test","pid":2100,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"SCLK4-INO9D","sessionId":"22becb78f201a05364e2fdd3017a2338924a22ff02bcc77a7a102082f8de990a","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.756Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"SCLK4-INO9D","sessionId":"22becb78f201a05364e2fdd3017a2338924a22ff02bcc77a7a102082f8de990a","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:16.756Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26\n at Object.callback [as executor] (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19","msg":"Error in tool:scoped_echo: Insufficient permissions."}
3
- {"level":50,"time":1787257457780,"env":"testing","version":"0.0.0-test","pid":2112,"operation":"HandleToolRequest","requestId":"0VL0G-EUGXV","sessionId":"73208d8b75f52313dc79c52a60167eea89c365751827c90b84dad53015dbe340","timestamp":"2026-08-20T20:24:17.774Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"0VL0G-EUGXV","sessionId":"73208d8b75f52313dc79c52a60167eea89c365751827c90b84dad53015dbe340","timestamp":"2026-08-20T20:24:17.774Z","toolName":"session_cancellable_tool","originalErrorName":"stringEncountered","originalMessage":"AbortError: cancel tool request"},"stack":"McpError: AbortError: cancel tool request\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:186:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:20\n at async Server._invokeInputRequiredCapableHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:887:13)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:838:19","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
4
- {"level":50,"time":1787257474800,"env":"testing","version":"0.0.0-test","pid":2235,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"6R39F-UVSOT","sessionId":"65a11974803af77e5115ccaad32660eb2ab875016ed0d4332490522fae79e98c","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.799Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"6R39F-UVSOT","sessionId":"65a11974803af77e5115ccaad32660eb2ab875016ed0d4332490522fae79e98c","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.799Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
5
- {"level":50,"time":1787257474807,"env":"testing","version":"0.0.0-test","pid":2235,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"WYG05-52QRJ","sessionId":"50b46576df7ff245b4ad221cb01746a81b8ffb5ce7395ceef3aeb0b8dc15476d","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.807Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"WYG05-52QRJ","sessionId":"50b46576df7ff245b4ad221cb01746a81b8ffb5ce7395ceef3aeb0b8dc15476d","tenantId":"authz-tenant","timestamp":"2026-08-20T20:24:34.807Z","toolName":"scoped_echo","originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:91:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:60:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:383:17)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1861:31)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1450:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs:1400:31)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
6
- {"level":50,"time":1787257475576,"env":"testing","version":"0.0.0-test","pid":2246,"operation":"HandleToolRequest","requestId":"7QR9T-RGZ5H","sessionId":"b7b50d5e87c58a4da184f5a37d899fab22a88979870de391bb25021ed2a60f2c","timestamp":"2026-08-20T20:24:35.572Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"7QR9T-RGZ5H","sessionId":"b7b50d5e87c58a4da184f5a37d899fab22a88979870de391bb25021ed2a60f2c","timestamp":"2026-08-20T20:24:35.572Z","toolName":"session_cancellable_tool","originalErrorName":"stringEncountered","originalMessage":"AbortError: cancel tool request"},"stack":"McpError: AbortError: cancel tool request\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:186:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:450:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
File without changes