@cyanheads/mcp-ts-core 0.6.16 → 0.7.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/CLAUDE.md +1 -1
- package/README.md +1 -1
- package/changelog/0.6.x/0.6.17.md +26 -0
- package/changelog/0.7.x/0.7.0.md +30 -0
- package/dist/linter/rules/format-parity-rules.d.ts.map +1 -1
- package/dist/linter/rules/format-parity-rules.js +24 -1
- package/dist/linter/rules/format-parity-rules.js.map +1 -1
- package/dist/logs/combined.log +4 -4
- package/dist/logs/error.log +4 -4
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.js +10 -7
- package/dist/mcp-server/resources/resource-registration.js.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +10 -2
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +5 -5
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-registration.js +18 -20
- package/dist/mcp-server/tools/tool-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +11 -2
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +10 -5
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.js +101 -21
- package/dist/mcp-server/transports/http/httpTransport.js.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts +4 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.js +15 -2
- package/dist/utils/internal/error-handler/errorHandler.js.map +1 -1
- package/dist/utils/internal/error-handler/helpers.d.ts +17 -0
- package/dist/utils/internal/error-handler/helpers.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/helpers.js +29 -0
- package/dist/utils/internal/error-handler/helpers.js.map +1 -1
- package/dist/utils/internal/error-handler/mappings.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/mappings.js +1 -0
- package/dist/utils/internal/error-handler/mappings.js.map +1 -1
- package/package.json +2 -2
- package/scripts/build-changelog.ts +7 -1
- package/scripts/devcheck.ts +3 -4
- package/skills/api-linter/SKILL.md +13 -2
- package/skills/maintenance/SKILL.md +20 -9
- package/skills/release-and-publish/SKILL.md +29 -5
- package/skills/report-issue-framework/SKILL.md +20 -6
- package/skills/report-issue-local/SKILL.md +26 -3
- package/templates/.github/ISSUE_TEMPLATE/bug_report.yml +9 -0
- package/templates/.github/ISSUE_TEMPLATE/feature_request.yml +11 -0
package/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
|
-
**Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.
|
|
3
|
+
**Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.7.0
|
|
4
4
|
**npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) · **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
|
|
5
5
|
|
|
6
6
|
> **Developer note:** Never assume. Read related files and docs before making changes. Read full file content for context. Never edit a file before reading it.
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<div align="center">
|
|
7
7
|
|
|
8
|
-
[](./CHANGELOG.md) [](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [](https://modelcontextprotocol.io/) [](./LICENSE)
|
|
9
9
|
|
|
10
10
|
[](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: HTTP transport hardening for issue #50 — per-server notifier race fix, bounded-timeout close with close_failures metric, and FinalizationRegistry diagnostic for per-request McpServer/transport retention
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.6.17 — 2026-04-24
|
|
7
|
+
|
|
8
|
+
Groundwork for investigating the HTTP heap leak tracked in [#50](https://github.com/cyanheads/mcp-ts-core/issues/50). Fixes a real cross-request correctness bug surfaced during the read-through, tightens the per-request close path so silent hangs can no longer accumulate retained closures, and adds observability to attribute whether instances are actually being reclaimed.
|
|
9
|
+
|
|
10
|
+
## Fixed
|
|
11
|
+
|
|
12
|
+
- **`src/mcp-server/tools/tool-registration.ts`** + **`src/mcp-server/resources/resource-registration.ts`** — `registerAll(server)` no longer mutates `this.services.notifyResourceListChanged` / `this.services.notifyResourceUpdated` on a shared registry-wide services object. Under concurrent HTTP requests, request A's `registerAll(serverA)` followed by request B's `registerAll(serverB)` would overwrite the notifier closure, so A's in-flight tool handler could notify `serverB` (or a closed server). Notifiers are now bound per-`registerAll()` call and threaded through to each handler factory.
|
|
13
|
+
|
|
14
|
+
## Changed
|
|
15
|
+
|
|
16
|
+
- **`src/mcp-server/tools/utils/toolHandlerFactory.ts`** + **`src/mcp-server/resources/utils/resourceHandlerFactory.ts`** — extracted `HandlerNotifiers` / `ResourceHandlerNotifiers` types for per-server notifier closures. `HandlerFactoryServices` and `ResourceHandlerFactoryServices` no longer carry `notifyResourceListChanged` / `notifyResourceUpdated` fields. `createToolHandler` / `createResourceHandler` take a new third argument (`notifiers`). Internal API change — consumer servers that call `createApp()` are unaffected.
|
|
17
|
+
- **`src/mcp-server/transports/http/httpTransport.ts`** — non-SSE per-request cleanup converted from fire-and-forget `transport.close()` / `server.close()` (errors swallowed as `debug` logs) to parallel awaited close under a 5 s bounded timeout via `Promise.all` over a tagged tuple. Failures increment `mcp.http.close_failures{surface,trigger}` and log at `warning`. Error-path transport close uses the same contract.
|
|
18
|
+
|
|
19
|
+
## Added
|
|
20
|
+
|
|
21
|
+
- **`mcp.http.close_failures`** counter (tags: `surface` = `transport`|`server`, `trigger` = `success`|`error`). Counts per-request close operations that threw or timed out. Previously invisible; these can now be alerted on.
|
|
22
|
+
- **`mcp.http.per_request.created`** and **`mcp.http.per_request.finalized`** counters (tag: `kind` = `server`|`transport`). Every per-request `McpServer` and `McpSessionTransport` is registered with a module-level `FinalizationRegistry`; the `created` counter increments on construction and the `finalized` counter increments when GC actually reclaims the instance. A persistent, traffic-proportional gap between the two is the signature of the retention observed in [#50](https://github.com/cyanheads/mcp-ts-core/issues/50); a gap that closes within minutes is just GC timing. Purely additive observability — no behavior change.
|
|
23
|
+
|
|
24
|
+
## Dependencies
|
|
25
|
+
|
|
26
|
+
- **`hono`** — `4.12.14` → `4.12.15` (patch; upstream JWT single-line PEM fix — no impact on this package's auth middleware).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: Issue-cleanup release — flat ZodError messages with structured issues, locale-aware format-parity, devcheck changelog guard, skill protocol refinements, and GitHub label + template scaffolding
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.7.0 — 2026-04-24
|
|
7
|
+
|
|
8
|
+
Batch of issue-cleanup work across error handling, linter resilience, devcheck tooling, release workflow guidance, and GitHub issue-management scaffolding. No runtime breaking changes — the ZodError message reshape is observable but nobody should have been parsing the raw JSON string.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- **Locale-aware digit-group separators in `format-parity` (#54)** — `sentinelAppears` in `src/linter/rules/format-parity-rules.ts` now retries numeric sentinel matching against text with common separators stripped (comma, period, underscore, apostrophe, right single quote, space variants including narrow no-break U+202F, Arabic thousands U+066C). Covers en-US, de-DE, fr-FR, de-CH. Compact, scientific, and other lossy transforms still fail by construction.
|
|
13
|
+
- **Structured `issues` on ZodError-derived `McpError.data` (#55)** — resource param validation, tool output validation, and user-thrown `ZodError` all populate `error.data.issues` with the full `ZodIssue[]`. For tools, the issues surface via `_meta.error.data.issues` alongside explicit `McpError.data`.
|
|
14
|
+
- **Secondary issue labels** — `regression`, `performance`, `security`, `breaking-change` created on the repo. `.github/ISSUE_TEMPLATE/` forms now auto-assign to `cyanheads` and list secondary labels inline; `templates/.github/ISSUE_TEMPLATE/` scaffolds the same guidance into new consumer servers with a commented-out assignees line.
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- **Flattened ZodError message shape (#55)** — `getErrorMessage(err)` in `src/utils/internal/error-handler/helpers.ts` detects `ZodError` and returns `<first-issue.message> at <path> (+N more)` instead of the raw serialized issue array. New exported helper `formatZodErrorMessage(err)` is the building block. Affects logs, `McpError.message`, and anything downstream that reads the message string — net cleaner across the board.
|
|
19
|
+
- **`classifyOnly` return signature extended (#55)** — added optional `data?: Record<string, unknown>` field. Backward-compatible addition (existing destructures without `data` continue to work). For `ZodError`, returns `{ code: ValidationError, message: <flat>, data: { issues } }`.
|
|
20
|
+
- **`ERROR_TYPE_MAPPINGS` now covers `ZodError`** — maps to `JsonRpcErrorCode.ValidationError` directly instead of falling through to message-pattern matching.
|
|
21
|
+
- **Auto-task tool error path cleaner on ZodError (#55)** — `runAutoTaskHandler` in `src/mcp-server/tools/tool-registration.ts` uses `getErrorMessage(error)` when storing the failed task result, so stored `content[].text` reads as prose for ZodError failures too.
|
|
22
|
+
- **`skills/maintenance/SKILL.md` default behavior (#56)** — bumped to v1.5. Step 4 (template review) replaces "cherry-pick / never auto-merge" with direct application of framework-authored updates; Step 6 splits into two tiers (framework changes default adopt; third-party changes default cost/benefit); Step 8 renames "Needs attention" → "Open decisions" with narrower scope.
|
|
23
|
+
- **`skills/api-linter/SKILL.md` `describe-on-fields` (#53)** — bumped to v1.1. Added recursion-rules table explicitly stating primitive array elements are skipped; flagged the `z.union([z.string(), z.array(z.string())])` asymmetry as the specific trap; softened "mechanical fix" framing.
|
|
24
|
+
- **`skills/release-and-publish/SKILL.md` failure protocol (#52)** — bumped to v2.1. Steps 3–6 now retry transient network failures (integrity check, ECONNRESET/EAI_AGAIN/ETIMEDOUT/ENOTFOUND, connection reset/refused, timeouts, HTTP 502/503/504) up to 2× with short backoff before halting. `docker builder prune -f` runs before retrying `buildx --push`. Idempotent-success signals (`version already exists`, `cannot publish duplicate version`) are treated as success and skipped.
|
|
25
|
+
- **`skills/report-issue-framework/SKILL.md` and `skills/report-issue-local/SKILL.md`** — both v1.3. Labels section restructured into primary (required, pick one) + secondary (optional, stackable); `docs` references fixed to `documentation`; CLI examples include `--assignee "@me"`; local skill includes a `gh label create` block for consumers whose repos lack the secondaries.
|
|
26
|
+
|
|
27
|
+
## Fixed
|
|
28
|
+
|
|
29
|
+
- **Changelog Sync devcheck step crashed on single-file `CHANGELOG.md` consumers (#51)** — `scripts/devcheck.ts` previously ran `build-changelog.ts` whenever either `changelog/` or `CHANGELOG.md` existed, but the script unconditionally `readdirSync`'d the directory and crashed with `ENOENT`. Guard now checks only for `changelog/` directory existence (the rollup is a derived artifact, not the driver). `scripts/build-changelog.ts main()` also early-exits when `CHANGELOG_DIR` is missing so direct invocation is robust.
|
|
30
|
+
- **Resource param validation no longer surfaces raw Zod JSON in `error.message` (#55)** — `resourceHandlerFactory.ts` catch block now destructures `data` from `ErrorHandler.classifyOnly` and passes it to the constructed `McpError`. Resource `error.message` reads as prose matching the tool path's shape; structured issues live in `error.data`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-parity-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/format-parity-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"format-parity-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/format-parity-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8RlD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CAwEpF"}
|
|
@@ -216,11 +216,34 @@ function collectPrimitives(value, out) {
|
|
|
216
216
|
collectPrimitives(v, out);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* Common digit-group separators across locales, plus underscore (template-literal
|
|
221
|
+
* style). Stripped from text before numeric sentinel matching so locale-aware
|
|
222
|
+
* formatting (`toLocaleString`, `Intl.NumberFormat`) passes parity:
|
|
223
|
+
* - `,` — en-US, hi-IN, others
|
|
224
|
+
* - `.` — de-DE, tr-TR, pt-BR, nl-NL, id-ID, es-ES
|
|
225
|
+
* - `'` `’` — de-CH (apostrophe or right single quote)
|
|
226
|
+
* - ` ` variants — fr-FR, sv-SE (space, no-break, narrow no-break, thin)
|
|
227
|
+
* - `٬` — Arabic thousands separator (U+066C)
|
|
228
|
+
* - `_` — not a locale separator, but some template literals use it
|
|
229
|
+
* Compact (`1.5K`), scientific (`9e8`), and other lossy transforms still fail —
|
|
230
|
+
* their digit sequences don't contain the sentinel's digits in order.
|
|
231
|
+
*/
|
|
232
|
+
const DIGIT_SEPARATOR_PATTERN = /[,._' ’٬]/g;
|
|
219
233
|
function sentinelAppears(sentinel, text) {
|
|
220
234
|
if (sentinel === null || sentinel === undefined)
|
|
221
235
|
return false;
|
|
222
236
|
const asString = typeof sentinel === 'string' ? sentinel : String(sentinel);
|
|
223
|
-
|
|
237
|
+
if (asString.length === 0)
|
|
238
|
+
return false;
|
|
239
|
+
if (text.includes(asString))
|
|
240
|
+
return true;
|
|
241
|
+
// Numeric sentinels may be rendered with locale-aware digit-group separators —
|
|
242
|
+
// strip separators and retry. Non-numeric sentinels skip this normalization.
|
|
243
|
+
if (typeof sentinel === 'number' || typeof sentinel === 'bigint') {
|
|
244
|
+
return text.replace(DIGIT_SEPARATOR_PATTERN, '').includes(asString);
|
|
245
|
+
}
|
|
246
|
+
return false;
|
|
224
247
|
}
|
|
225
248
|
function escapeRegex(str) {
|
|
226
249
|
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-parity-rules.js","sourceRoot":"","sources":["../../../src/linter/rules/format-parity-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA2BH,yFAAyF;AACzF,SAAS,SAAS,CAAC,MAAe;IAChC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACrD,MAAM,CAAC,GAAG,MAA0E,CAAC;IACrF,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,MAAe;IACnC,IAAI,OAAO,GAAG,MAAM,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC;QACrF,MAAM,CAAC,GAAG,OAGT,CAAC;QACF,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC;QAC1D,IAAI,CAAC,KAAK;YAAE,OAAO,OAAO,CAAC;QAC3B,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;IACD,OAAO,O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F;oBACnF,sFAAsF;oBACtF,wJAAwJ;oBACxJ,4IAA4I;oBAC5I,6PAA6P;gBAC/P,cAAc,EAAE,MAAM;gBACtB,cAAc,EAAE,WAAW;aAC5B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/dist/logs/combined.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{"level":50,"time":
|
|
2
|
-
{"level":50,"time":
|
|
3
|
-
{"level":50,"time":
|
|
4
|
-
{"level":50,"time":
|
|
1
|
+
{"level":50,"time":1777043311103,"env":"testing","version":"0.0.0-test","pid":58287,"requestId":"82T85-AYSCN","timestamp":"2026-04-24T15:08:31.102Z","operation":"HandleToolRequest","input":{"message":"blocked"},"critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"ad3108973de97ab8beaad46853043e1ff94b1a92d3ac973c5057465c69c08749","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"ad3108973de97ab8beaad46853043e1ff94b1a92d3ac973c5057465c69c08749","toolName":"scoped_echo","input":{"message":"blocked"},"requestId":"82T85-AYSCN","timestamp":"2026-04-24T15:08:31.102Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:69:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\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:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:102:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
2
|
+
{"level":50,"time":1777043312113,"env":"testing","version":"0.7.0","pid":58325,"requestId":"QLYIT-YD8BL","timestamp":"2026-04-24T15:08:32.113Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"QLYIT-YD8BL","timestamp":"2026-04-24T15:08:32.113Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:203:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
|
3
|
+
{"level":50,"time":1777043312131,"env":"testing","version":"0.7.0","pid":58325,"requestId":"YY8Z7-LABHM","timestamp":"2026-04-24T15:08:32.131Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"YY8Z7-LABHM","timestamp":"2026-04-24T15:08:32.131Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
|
|
4
|
+
{"level":50,"time":1777043312135,"env":"testing","version":"0.7.0","pid":58325,"requestId":"WR8JJ-WNFPM","timestamp":"2026-04-24T15:08:32.135Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"WR8JJ-WNFPM","timestamp":"2026-04-24T15:08:32.135Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:203:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
package/dist/logs/error.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{"level":50,"time":
|
|
2
|
-
{"level":50,"time":
|
|
3
|
-
{"level":50,"time":
|
|
4
|
-
{"level":50,"time":
|
|
1
|
+
{"level":50,"time":1777043311103,"env":"testing","version":"0.0.0-test","pid":58287,"requestId":"82T85-AYSCN","timestamp":"2026-04-24T15:08:31.102Z","operation":"HandleToolRequest","input":{"message":"blocked"},"critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"ad3108973de97ab8beaad46853043e1ff94b1a92d3ac973c5057465c69c08749","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"ad3108973de97ab8beaad46853043e1ff94b1a92d3ac973c5057465c69c08749","toolName":"scoped_echo","input":{"message":"blocked"},"requestId":"82T85-AYSCN","timestamp":"2026-04-24T15:08:31.102Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:69:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\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:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:102:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
2
|
+
{"level":50,"time":1777043312113,"env":"testing","version":"0.7.0","pid":58325,"requestId":"QLYIT-YD8BL","timestamp":"2026-04-24T15:08:32.113Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"QLYIT-YD8BL","timestamp":"2026-04-24T15:08:32.113Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:203:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
|
3
|
+
{"level":50,"time":1777043312131,"env":"testing","version":"0.7.0","pid":58325,"requestId":"YY8Z7-LABHM","timestamp":"2026-04-24T15:08:32.131Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"YY8Z7-LABHM","timestamp":"2026-04-24T15:08:32.131Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
|
|
4
|
+
{"level":50,"time":1777043312135,"env":"testing","version":"0.7.0","pid":58325,"requestId":"WR8JJ-WNFPM","timestamp":"2026-04-24T15:08:32.135Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"WR8JJ-WNFPM","timestamp":"2026-04-24T15:08:32.135Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:203:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,
|
|
1
|
+
{"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,wDAAwD,CAAC;AAchE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAG3C,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B;IAGlD;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1D,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAoD/B"}
|
|
@@ -25,10 +25,13 @@ export class ResourceRegistry {
|
|
|
25
25
|
*/
|
|
26
26
|
async registerAll(server) {
|
|
27
27
|
this.registeredNames.clear();
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
// Per-server notifier closures. Bound once per registerAll() call and
|
|
29
|
+
// passed through to each handler factory — never mutated on a shared
|
|
30
|
+
// services object (which would race under concurrent HTTP requests).
|
|
31
|
+
const notifiers = {
|
|
32
|
+
notifyResourceListChanged: () => server.sendResourceListChanged(),
|
|
33
|
+
notifyResourceUpdated: (uri) => server.server.sendResourceUpdated({ uri }),
|
|
34
|
+
};
|
|
32
35
|
const context = requestContextService.createRequestContext({
|
|
33
36
|
operation: 'ResourceRegistry.registerAll',
|
|
34
37
|
});
|
|
@@ -38,7 +41,7 @@ export class ResourceRegistry {
|
|
|
38
41
|
// still expose truthful MCP resource behavior.
|
|
39
42
|
server.setResourceRequestHandlers();
|
|
40
43
|
for (const resourceDef of this.resourceDefs) {
|
|
41
|
-
await this.registerResource(server, resourceDef);
|
|
44
|
+
await this.registerResource(server, resourceDef, notifiers);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
/** Throws at startup if a resource with the same name was already registered. */
|
|
@@ -49,7 +52,7 @@ export class ResourceRegistry {
|
|
|
49
52
|
}
|
|
50
53
|
this.registeredNames.add(name);
|
|
51
54
|
}
|
|
52
|
-
async registerResource(server, def) {
|
|
55
|
+
async registerResource(server, def, notifiers) {
|
|
53
56
|
const resourceName = def.name ?? def.uriTemplate;
|
|
54
57
|
const registrationContext = requestContextService.createRequestContext({
|
|
55
58
|
operation: 'ResourceRegistry.registerResource',
|
|
@@ -58,7 +61,7 @@ export class ResourceRegistry {
|
|
|
58
61
|
logger.debug(`Registering resource: '${resourceName}'`, registrationContext);
|
|
59
62
|
this.assertUniqueName(resourceName);
|
|
60
63
|
await ErrorHandler.tryCatch(() => {
|
|
61
|
-
const handler = createResourceHandler(def, this.services);
|
|
64
|
+
const handler = createResourceHandler(def, this.services, notifiers);
|
|
62
65
|
const title = def.title ?? resourceName;
|
|
63
66
|
const mimeType = def.mimeType ?? 'application/json';
|
|
64
67
|
const metadata = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAkB,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,EACL,qBAAqB,
|
|
1
|
+
{"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAkB,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,EACL,qBAAqB,GAGtB,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAA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G,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;aACvC,CAAC;YAEF,IAAI,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC7C,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,EAAE;oBACrD,IAAI,EAAE,GAAG,CAAC,IAAI;iBACf,CAAC,CAAC;gBAEH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CACtE,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,CACxB,CAAC;YACJ,CAAC;YAED,MAAM,CAAC,KAAK,CAAC,aAAa,YAAY,4BAA4B,EAAE,mBAAmB,CAAC,CAAC;QAC3F,CAAC,EACD;YACE,SAAS,EAAE,uBAAuB,YAAY,EAAE;YAChD,OAAO,EAAE,mBAAmB;YAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;YAChD,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -13,9 +13,17 @@ type SdkExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
|
|
|
13
13
|
/** Services required by the handler factory to construct Context. */
|
|
14
14
|
export interface ResourceHandlerFactoryServices {
|
|
15
15
|
logger: Logger;
|
|
16
|
+
storage: StorageService;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Per-server notifier closures bound at registration time.
|
|
20
|
+
* Split from {@link ResourceHandlerFactoryServices} so each per-request
|
|
21
|
+
* McpServer gets its own notifier closures — preventing a concurrent
|
|
22
|
+
* registerAll() from overwriting an in-flight handler's notifier target.
|
|
23
|
+
*/
|
|
24
|
+
export interface ResourceHandlerNotifiers {
|
|
16
25
|
notifyResourceListChanged?: () => void;
|
|
17
26
|
notifyResourceUpdated?: (uri: string) => void;
|
|
18
|
-
storage: StorageService;
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* Creates an MCP resource read handler from a resource definition.
|
|
@@ -29,6 +37,6 @@ export interface ResourceHandlerFactoryServices {
|
|
|
29
37
|
* - Formats response via `format` or JSON default
|
|
30
38
|
* - Catches errors and re-throws for the SDK
|
|
31
39
|
*/
|
|
32
|
-
export declare function createResourceHandler(def: AnyResourceDefinition, services: ResourceHandlerFactoryServices): (uri: URL, variables: Variables, extra: SdkExtra) => Promise<ReadResourceResult>;
|
|
40
|
+
export declare function createResourceHandler(def: AnyResourceDefinition, services: ResourceHandlerFactoryServices, notifiers: ResourceHandlerNotifiers): (uri: URL, variables: Variables, extra: SdkExtra) => Promise<ReadResourceResult>;
|
|
33
41
|
export {};
|
|
34
42
|
//# sourceMappingURL=resourceHandlerFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACd,MAAM,oCAAoC,CAAC;AAK5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAEhG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAQzD,KAAK,QAAQ,GAAG,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAOvE,qEAAqE;AACrE,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACd,MAAM,oCAAoC,CAAC;AAK5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAEhG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAQzD,KAAK,QAAQ,GAAG,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAOvE,qEAAqE;AACrE,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,8BAA8B,EACxC,SAAS,EAAE,wBAAwB,GAClC,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAoElF"}
|
|
@@ -61,7 +61,7 @@ function wrapSample(sdkContext) {
|
|
|
61
61
|
* - Formats response via `format` or JSON default
|
|
62
62
|
* - Catches errors and re-throws for the SDK
|
|
63
63
|
*/
|
|
64
|
-
export function createResourceHandler(def, services) {
|
|
64
|
+
export function createResourceHandler(def, services, notifiers) {
|
|
65
65
|
const mimeType = def.mimeType ?? 'application/json';
|
|
66
66
|
const formatter = def.format ?? defaultResponseFormatter;
|
|
67
67
|
return async (uri, variables, callContext) => {
|
|
@@ -96,8 +96,8 @@ export function createResourceHandler(def, services) {
|
|
|
96
96
|
signal: sdkContext.signal,
|
|
97
97
|
elicit: wrapElicit(sdkCaps),
|
|
98
98
|
sample: wrapSample(sdkCaps),
|
|
99
|
-
notifyResourceListChanged:
|
|
100
|
-
notifyResourceUpdated:
|
|
99
|
+
notifyResourceListChanged: notifiers.notifyResourceListChanged,
|
|
100
|
+
notifyResourceUpdated: notifiers.notifyResourceUpdated,
|
|
101
101
|
uri,
|
|
102
102
|
});
|
|
103
103
|
// Execute handler with performance measurement
|
|
@@ -113,8 +113,8 @@ export function createResourceHandler(def, services) {
|
|
|
113
113
|
if (error instanceof McpError) {
|
|
114
114
|
throw error;
|
|
115
115
|
}
|
|
116
|
-
const { code, message } = ErrorHandler.classifyOnly(error);
|
|
117
|
-
throw new McpError(code, message,
|
|
116
|
+
const { code, message, data } = ErrorHandler.classifyOnly(error);
|
|
117
|
+
throw new McpError(code, message, data, { cause: error });
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE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ACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,yCAAyC,CAAC;AAGvF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAIlD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAEL,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,yCAAyC,CAAC;AAGvF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAIlD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAEL,KAAK,sBAAsB,EAE5B,MAAM,gDAAgD,CAAC;AAqBxD,oDAAoD;AACpD,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,kBAAkB,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAMvE,qBAAa,YAAY;IAKrB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ,CAAC;IALnB,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAG3C,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,CAAC,EAAE,sBAAsB,YAAA;IAG3C;;;;OAIG;IACU,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAqD1D,6EAA6E;IAC7E,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,mBAAmB;IAI3B;;;OAGG;YACW,YAAY;IAkD1B;;;;OAIG;YACW,oBAAoB;IA0FlC;;;;OAIG;YACW,kBAAkB;IA+FhC;;;;;OAKG;YACW,gBAAgB;CA6C/B"}
|
|
@@ -6,6 +6,7 @@ import { authContext } from '../../mcp-server/transports/auth/lib/authContext.js
|
|
|
6
6
|
import { withRequiredScopes } from '../../mcp-server/transports/auth/lib/authUtils.js';
|
|
7
7
|
import { JsonRpcErrorCode } from '../../types-global/errors.js';
|
|
8
8
|
import { ErrorHandler } from '../../utils/internal/error-handler/errorHandler.js';
|
|
9
|
+
import { getErrorMessage } from '../../utils/internal/error-handler/helpers.js';
|
|
9
10
|
import { logger } from '../../utils/internal/logger.js';
|
|
10
11
|
import { requestContextService } from '../../utils/internal/requestContext.js';
|
|
11
12
|
/** Default TTL for auto-task tools when config doesn't specify one. */
|
|
@@ -28,12 +29,13 @@ export class ToolRegistry {
|
|
|
28
29
|
// Reset per-server uniqueness tracking — registries are shared across
|
|
29
30
|
// per-request McpServer instances in HTTP mode (GHSA-345p-7cg4-v4c7).
|
|
30
31
|
this.registeredNames.clear();
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
// Per-server notifier closures. Bound once per registerAll() call and
|
|
33
|
+
// passed through to each handler factory — never mutated on a shared
|
|
34
|
+
// services object (which would race under concurrent HTTP requests).
|
|
35
|
+
const notifiers = {
|
|
36
|
+
notifyResourceListChanged: () => server.sendResourceListChanged(),
|
|
37
|
+
notifyResourceUpdated: (uri) => server.server.sendResourceUpdated({ uri }),
|
|
38
|
+
};
|
|
37
39
|
const context = requestContextService.createRequestContext({
|
|
38
40
|
operation: 'ToolRegistry.registerAll',
|
|
39
41
|
});
|
|
@@ -55,10 +57,10 @@ export class ToolRegistry {
|
|
|
55
57
|
// Register standard tools (regular and auto-task)
|
|
56
58
|
for (const toolDef of standardTools) {
|
|
57
59
|
if (toolDef.task) {
|
|
58
|
-
await this.registerAutoTaskTool(server, toolDef);
|
|
60
|
+
await this.registerAutoTaskTool(server, toolDef, notifiers);
|
|
59
61
|
}
|
|
60
62
|
else {
|
|
61
|
-
await this.registerTool(server, toolDef);
|
|
63
|
+
await this.registerTool(server, toolDef, notifiers);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
// Register escape-hatch task tools via experimental API
|
|
@@ -81,7 +83,7 @@ export class ToolRegistry {
|
|
|
81
83
|
* Registers a standard tool definition.
|
|
82
84
|
* Requires `services` to have been passed to the constructor for Context creation.
|
|
83
85
|
*/
|
|
84
|
-
async registerTool(server, tool) {
|
|
86
|
+
async registerTool(server, tool, notifiers) {
|
|
85
87
|
const registrationContext = requestContextService.createRequestContext({
|
|
86
88
|
operation: 'ToolRegistry.registerTool',
|
|
87
89
|
toolName: tool.name,
|
|
@@ -92,7 +94,7 @@ export class ToolRegistry {
|
|
|
92
94
|
if (!this.services) {
|
|
93
95
|
throw new Error(`Cannot register tool '${tool.name}': HandlerFactoryServices not provided to ToolRegistry`);
|
|
94
96
|
}
|
|
95
|
-
const handler = createToolHandler(tool, this.services);
|
|
97
|
+
const handler = createToolHandler(tool, this.services, notifiers);
|
|
96
98
|
const title = tool.title ?? tool.annotations?.title ?? this.deriveTitleFromName(tool.name);
|
|
97
99
|
// Type assertion required: SDK's conditional types don't resolve with erased generics
|
|
98
100
|
server.registerTool(tool.name, {
|
|
@@ -116,7 +118,7 @@ export class ToolRegistry {
|
|
|
116
118
|
* Auto-generates task handlers from the definition's `handler` function.
|
|
117
119
|
* The framework manages the full task lifecycle: create, background run, store result.
|
|
118
120
|
*/
|
|
119
|
-
async registerAutoTaskTool(server, tool) {
|
|
121
|
+
async registerAutoTaskTool(server, tool, notifiers) {
|
|
120
122
|
const registrationContext = requestContextService.createRequestContext({
|
|
121
123
|
operation: 'ToolRegistry.registerAutoTaskTool',
|
|
122
124
|
toolName: tool.name,
|
|
@@ -157,7 +159,7 @@ export class ToolRegistry {
|
|
|
157
159
|
pollInterval: 1000,
|
|
158
160
|
});
|
|
159
161
|
// Fire-and-forget: run handler in background
|
|
160
|
-
void this.runAutoTaskHandler(tool, validatedInput, services, formatter, {
|
|
162
|
+
void this.runAutoTaskHandler(tool, validatedInput, services, notifiers, formatter, {
|
|
161
163
|
taskId: task.taskId,
|
|
162
164
|
taskStore: extra.taskStore,
|
|
163
165
|
ttlMs: taskTtlMs,
|
|
@@ -181,7 +183,7 @@ export class ToolRegistry {
|
|
|
181
183
|
* Creates Context with `progress` and `signal`, stores result/error on completion.
|
|
182
184
|
* Enforces a deadline matching the task entry TTL to prevent leaked resources.
|
|
183
185
|
*/
|
|
184
|
-
async runAutoTaskHandler(tool, input, services, formatter, opts) {
|
|
186
|
+
async runAutoTaskHandler(tool, input, services, notifiers, formatter, opts) {
|
|
185
187
|
const { taskId, taskStore, ttlMs, callerAuth } = opts;
|
|
186
188
|
const abortController = new AbortController();
|
|
187
189
|
// Enforce handler execution deadline matching the task entry TTL.
|
|
@@ -222,8 +224,8 @@ export class ToolRegistry {
|
|
|
222
224
|
storage: services.storage,
|
|
223
225
|
signal: abortController.signal,
|
|
224
226
|
taskCtx: { store: taskStore, taskId },
|
|
225
|
-
notifyResourceListChanged:
|
|
226
|
-
notifyResourceUpdated:
|
|
227
|
+
notifyResourceListChanged: notifiers.notifyResourceListChanged,
|
|
228
|
+
notifyResourceUpdated: notifiers.notifyResourceUpdated,
|
|
227
229
|
});
|
|
228
230
|
const result = await Promise.resolve(tool.handler(input, ctx));
|
|
229
231
|
const validatedResult = tool.output.parse(result);
|
|
@@ -245,11 +247,7 @@ export class ToolRegistry {
|
|
|
245
247
|
});
|
|
246
248
|
try {
|
|
247
249
|
const isTimeout = abortController.signal.reason === TIMEOUT_SENTINEL;
|
|
248
|
-
const errorMessage = isTimeout
|
|
249
|
-
? `Task timed out after ${ttlMs}ms`
|
|
250
|
-
: error instanceof Error
|
|
251
|
-
? error.message
|
|
252
|
-
: String(error);
|
|
250
|
+
const errorMessage = isTimeout ? `Task timed out after ${ttlMs}ms` : getErrorMessage(error);
|
|
253
251
|
await taskStore.storeTaskResult(taskId, 'failed', {
|
|
254
252
|
content: [{ type: 'text', text: `Error: ${errorMessage}` }],
|
|
255
253
|
isError: true,
|