@cyanheads/mcp-ts-core 0.12.0 → 0.12.1

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 (108) 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.1.md +26 -0
  5. package/dist/config/index.d.ts +9 -0
  6. package/dist/config/index.d.ts.map +1 -1
  7. package/dist/config/index.js +21 -3
  8. package/dist/config/index.js.map +1 -1
  9. package/dist/core/app.d.ts +23 -1
  10. package/dist/core/app.d.ts.map +1 -1
  11. package/dist/core/app.js +12 -3
  12. package/dist/core/app.js.map +1 -1
  13. package/dist/core/serverManifest.d.ts +5 -1
  14. package/dist/core/serverManifest.d.ts.map +1 -1
  15. package/dist/core/serverManifest.js +28 -10
  16. package/dist/core/serverManifest.js.map +1 -1
  17. package/dist/core/worker.d.ts.map +1 -1
  18. package/dist/core/worker.js +2 -2
  19. package/dist/core/worker.js.map +1 -1
  20. package/dist/linter/rules/enrichment-rules.d.ts.map +1 -1
  21. package/dist/linter/rules/enrichment-rules.js +5 -2
  22. package/dist/linter/rules/enrichment-rules.js.map +1 -1
  23. package/dist/linter/rules/portability-rules.d.ts +4 -2
  24. package/dist/linter/rules/portability-rules.d.ts.map +1 -1
  25. package/dist/linter/rules/portability-rules.js +33 -4
  26. package/dist/linter/rules/portability-rules.js.map +1 -1
  27. package/dist/linter/rules/schema-rules.d.ts +10 -3
  28. package/dist/linter/rules/schema-rules.d.ts.map +1 -1
  29. package/dist/linter/rules/schema-rules.js +52 -25
  30. package/dist/linter/rules/schema-rules.js.map +1 -1
  31. package/dist/linter/rules/tool-rules.d.ts.map +1 -1
  32. package/dist/linter/rules/tool-rules.js +5 -2
  33. package/dist/linter/rules/tool-rules.js.map +1 -1
  34. package/dist/linter/types.d.ts +2 -1
  35. package/dist/linter/types.d.ts.map +1 -1
  36. package/dist/logs/combined.log +10 -10
  37. package/dist/logs/error.log +6 -6
  38. package/dist/mcp-server/notifications.d.ts +68 -1
  39. package/dist/mcp-server/notifications.d.ts.map +1 -1
  40. package/dist/mcp-server/notifications.js +67 -0
  41. package/dist/mcp-server/notifications.js.map +1 -1
  42. package/dist/mcp-server/resources/resource-registration.d.ts +2 -2
  43. package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
  44. package/dist/mcp-server/resources/resource-registration.js +3 -2
  45. package/dist/mcp-server/resources/resource-registration.js.map +1 -1
  46. package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +13 -5
  47. package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
  48. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +26 -25
  49. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
  50. package/dist/mcp-server/server.d.ts +9 -1
  51. package/dist/mcp-server/server.d.ts.map +1 -1
  52. package/dist/mcp-server/server.js +6 -2
  53. package/dist/mcp-server/server.js.map +1 -1
  54. package/dist/mcp-server/tools/tool-registration.d.ts +2 -2
  55. package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
  56. package/dist/mcp-server/tools/tool-registration.js +2 -1
  57. package/dist/mcp-server/tools/tool-registration.js.map +1 -1
  58. package/dist/mcp-server/tools/utils/schemaShape.d.ts +27 -0
  59. package/dist/mcp-server/tools/utils/schemaShape.d.ts.map +1 -0
  60. package/dist/mcp-server/tools/utils/schemaShape.js +43 -0
  61. package/dist/mcp-server/tools/utils/schemaShape.js.map +1 -0
  62. package/dist/mcp-server/tools/utils/toolDefinition.d.ts +27 -5
  63. package/dist/mcp-server/tools/utils/toolDefinition.d.ts.map +1 -1
  64. package/dist/mcp-server/tools/utils/toolDefinition.js +17 -2
  65. package/dist/mcp-server/tools/utils/toolDefinition.js.map +1 -1
  66. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +13 -5
  67. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
  68. package/dist/mcp-server/tools/utils/toolHandlerFactory.js +33 -27
  69. package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
  70. package/dist/mcp-server/transports/http/eventStore.d.ts +57 -0
  71. package/dist/mcp-server/transports/http/eventStore.d.ts.map +1 -0
  72. package/dist/mcp-server/transports/http/eventStore.js +114 -0
  73. package/dist/mcp-server/transports/http/eventStore.js.map +1 -0
  74. package/dist/mcp-server/transports/http/httpServer.d.ts +2 -1
  75. package/dist/mcp-server/transports/http/httpServer.d.ts.map +1 -1
  76. package/dist/mcp-server/transports/http/httpServer.js +2 -2
  77. package/dist/mcp-server/transports/http/httpServer.js.map +1 -1
  78. package/dist/mcp-server/transports/http/httpTransport.d.ts +7 -2
  79. package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -1
  80. package/dist/mcp-server/transports/http/httpTransport.js +25 -2
  81. package/dist/mcp-server/transports/http/httpTransport.js.map +1 -1
  82. package/dist/mcp-server/transports/http/landing-page/sections/tools.js +22 -2
  83. package/dist/mcp-server/transports/http/landing-page/sections/tools.js.map +1 -1
  84. package/dist/mcp-server/transports/manager.d.ts +10 -1
  85. package/dist/mcp-server/transports/manager.d.ts.map +1 -1
  86. package/dist/mcp-server/transports/manager.js +6 -2
  87. package/dist/mcp-server/transports/manager.js.map +1 -1
  88. package/dist/testing/fuzz.d.ts +7 -4
  89. package/dist/testing/fuzz.d.ts.map +1 -1
  90. package/dist/testing/fuzz.js +13 -5
  91. package/dist/testing/fuzz.js.map +1 -1
  92. package/dist/utils/internal/performance.d.ts +12 -4
  93. package/dist/utils/internal/performance.d.ts.map +1 -1
  94. package/dist/utils/internal/performance.js +23 -8
  95. package/dist/utils/internal/performance.js.map +1 -1
  96. package/dist/utils/internal/requestContext.d.ts +13 -0
  97. package/dist/utils/internal/requestContext.d.ts.map +1 -1
  98. package/dist/utils/internal/requestContext.js +43 -8
  99. package/dist/utils/internal/requestContext.js.map +1 -1
  100. package/package.json +1 -1
  101. package/skills/add-tool/SKILL.md +36 -1
  102. package/skills/api-config/SKILL.md +4 -1
  103. package/skills/api-context/SKILL.md +47 -15
  104. package/skills/api-linter/SKILL.md +15 -2
  105. package/skills/api-telemetry/SKILL.md +3 -1
  106. package/skills/api-workers/SKILL.md +9 -1
  107. package/skills/tool-defs-analysis/SKILL.md +15 -5
  108. package/templates/.env.example +4 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/linter/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qCAAqC;AACrC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/C,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC;AAE5F;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,qFAAqF;IACrF,cAAc,EAAE,MAAM,CAAC;IACvB,sDAAsD;IACtD,cAAc,EAAE,kBAAkB,CAAC;IACnC,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,uDAAuD;IACvD,MAAM,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAChD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9D,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;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AAM,CAAC,GAAG,KAAK,CAAC;IAChD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9D,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,WAAW,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,iGAAiG;IACjG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;CACrD"}
@@ -1,10 +1,10 @@
1
- {"level":40,"time":1787221432103,"env":"testing","version":"0.12.0","pid":73936,"operation":"TransportManager.start","requestId":"56MMP-1TCWR","timestamp":"2026-08-20T10:23:52.103Z","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":1787221434168,"env":"testing","version":"0.12.0","pid":73936,"operation":"HttpRpcRequest","requestId":"MB6E5-JGGAY","sessionId":"not-a-real-session-1787221434167","timestamp":"2026-08-20T10:23:54.168Z","component":"HttpTransport","msg":"Session validation failed - invalid or hijacked session"}
3
- {"level":50,"time":1787221437537,"env":"testing","version":"0.0.0-test","pid":73968,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"7RW7B-7EGM3","sessionId":"f9564eb784143062636876b287d217e2524604d650a08b119646be93a20a625c","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.536Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"7RW7B-7EGM3","sessionId":"f9564eb784143062636876b287d217e2524604d650a08b119646be93a20a625c","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.536Z","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:386: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:443: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":1787221437546,"env":"testing","version":"0.0.0-test","pid":73968,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"S1Z90-1JKDD","sessionId":"11245013dcc3218a2a16fd5dde31f4b627880b4dd5d25ebc765c15abef8ae040","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.546Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"S1Z90-1JKDD","sessionId":"11245013dcc3218a2a16fd5dde31f4b627880b4dd5d25ebc765c15abef8ae040","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.546Z","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:386: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:443: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":1787221438517,"env":"testing","version":"0.0.0-test","pid":73971,"operation":"HandleToolRequest","requestId":"DJGQ2-A13DW","sessionId":"436fbf355cad1bb116a6e73f056f8f222db22cff3ab6da459f70297f21229e95","timestamp":"2026-08-20T10:23:58.512Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"DJGQ2-A13DW","sessionId":"436fbf355cad1bb116a6e73f056f8f222db22cff3ab6da459f70297f21229e95","timestamp":"2026-08-20T10:23:58.512Z","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:443: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":1787221448912,"env":"testing","version":"0.12.0","pid":74055,"operation":"TransportManager.start","requestId":"ZE0M6-RM3L0","timestamp":"2026-08-20T10:24:08.911Z","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":1787221450758,"env":"testing","version":"0.12.0","pid":74055,"operation":"HttpRpcRequest","requestId":"QNWJ9-3EJOI","sessionId":"not-a-real-session-1787221450758","timestamp":"2026-08-20T10:24:10.758Z","component":"HttpTransport","msg":"Session validation failed - invalid or hijacked session"}
8
- {"level":50,"time":1787221453869,"env":"testing","version":"0.0.0-test","pid":74078,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"11D79-NVTAA","sessionId":"99426c0565bb9046a6d05eabe97d3f2590c81e07f7896ecc75f70c357ad497c4","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.868Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"11D79-NVTAA","sessionId":"99426c0565bb9046a6d05eabe97d3f2590c81e07f7896ecc75f70c357ad497c4","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.868Z","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:386: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:443: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":1787221453876,"env":"testing","version":"0.0.0-test","pid":74078,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"B2SV3-N26NA","sessionId":"40bc694f688bae6d94e4acf651bbea88de4e5860ff92036f913a4496f958a408","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.876Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"B2SV3-N26NA","sessionId":"40bc694f688bae6d94e4acf651bbea88de4e5860ff92036f913a4496f958a408","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.876Z","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:386: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:443: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":1787221454651,"env":"testing","version":"0.0.0-test","pid":74083,"operation":"HandleToolRequest","requestId":"DX3A3-53H96","sessionId":"38fb68d98a2cd7a4d2fd70b83f225766ebbe5dd8c03789d6c92a4fb7d896bb4f","timestamp":"2026-08-20T10:24:14.648Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"DX3A3-53H96","sessionId":"38fb68d98a2cd7a4d2fd70b83f225766ebbe5dd8c03789d6c92a4fb7d896bb4f","timestamp":"2026-08-20T10:24:14.648Z","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:443:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
1
+ {"level":40,"time":1787249221180,"env":"testing","version":"0.12.1","pid":43171,"operation":"TransportManager.start","requestId":"PUL22-AMHD7","timestamp":"2026-08-20T18:07:01.180Z","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":1787249223452,"env":"testing","version":"0.12.1","pid":43171,"operation":"HttpRpcRequest","requestId":"199WT-2MJID","sessionId":"not-a-real-session-1787249223449","timestamp":"2026-08-20T18:07:03.452Z","component":"HttpTransport","msg":"Session validation failed - invalid or hijacked session"}
3
+ {"level":50,"time":1787249227153,"env":"testing","version":"0.0.0-test","pid":43212,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"LEPEF-Q8LQQ","sessionId":"785ee4109a184c257b58b7ffcdf73e21589e44c418eee4ccdfcc5a71dbfe6847","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.152Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"LEPEF-Q8LQQ","sessionId":"785ee4109a184c257b58b7ffcdf73e21589e44c418eee4ccdfcc5a71dbfe6847","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.152Z","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:382: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:449: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":1787249227166,"env":"testing","version":"0.0.0-test","pid":43212,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"1F3Z0-Z77NT","sessionId":"d1e234e49509af45bb2dd4575bcb09cc467dfc8f6f1a5e5e038227f608f6b5b2","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.166Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"1F3Z0-Z77NT","sessionId":"d1e234e49509af45bb2dd4575bcb09cc467dfc8f6f1a5e5e038227f608f6b5b2","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.166Z","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:382: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:449: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":1787249228307,"env":"testing","version":"0.0.0-test","pid":43220,"operation":"HandleToolRequest","requestId":"XMI4S-0CN4L","sessionId":"10b75ba7267aa0f3ac4acfa447e0232f7e9080095e6305d7a7fcc652016e56f2","timestamp":"2026-08-20T18:07:08.301Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"XMI4S-0CN4L","sessionId":"10b75ba7267aa0f3ac4acfa447e0232f7e9080095e6305d7a7fcc652016e56f2","timestamp":"2026-08-20T18:07:08.301Z","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:449: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":1787249240624,"env":"testing","version":"0.12.1","pid":43318,"operation":"TransportManager.start","requestId":"7B2CS-MCVTS","timestamp":"2026-08-20T18:07:20.623Z","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":1787249242441,"env":"testing","version":"0.12.1","pid":43318,"operation":"HttpRpcRequest","requestId":"5IM4G-6QY7E","sessionId":"not-a-real-session-1787249242441","timestamp":"2026-08-20T18:07:22.441Z","component":"HttpTransport","msg":"Session validation failed - invalid or hijacked session"}
8
+ {"level":50,"time":1787249244842,"env":"testing","version":"0.0.0-test","pid":43342,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"K0YRI-7BS1I","sessionId":"2ee7048f7affa20c25adfd980a023387cea2ce2a61eaee63048249d4dc0aab57","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.841Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"K0YRI-7BS1I","sessionId":"2ee7048f7affa20c25adfd980a023387cea2ce2a61eaee63048249d4dc0aab57","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.841Z","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:382: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:449: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":1787249244854,"env":"testing","version":"0.0.0-test","pid":43342,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"NFZQV-P2NPI","sessionId":"f0811459e7d29d052c034cdaa5f6f4da3f9f150c0d5af8ebf65ae1aaac2d9c0c","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.854Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"NFZQV-P2NPI","sessionId":"f0811459e7d29d052c034cdaa5f6f4da3f9f150c0d5af8ebf65ae1aaac2d9c0c","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.854Z","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:382: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:449: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":1787249246537,"env":"testing","version":"0.0.0-test","pid":43354,"operation":"HandleToolRequest","requestId":"57E0T-P1UGN","sessionId":"757eccb5bfa31c7a69caa0876786df1a43a8d46e255273e5c42c20c68ebc062f","timestamp":"2026-08-20T18:07:26.534Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"57E0T-P1UGN","sessionId":"757eccb5bfa31c7a69caa0876786df1a43a8d46e255273e5c42c20c68ebc062f","timestamp":"2026-08-20T18:07:26.534Z","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:449:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
@@ -1,6 +1,6 @@
1
- {"level":50,"time":1787221437537,"env":"testing","version":"0.0.0-test","pid":73968,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"7RW7B-7EGM3","sessionId":"f9564eb784143062636876b287d217e2524604d650a08b119646be93a20a625c","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.536Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"7RW7B-7EGM3","sessionId":"f9564eb784143062636876b287d217e2524604d650a08b119646be93a20a625c","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.536Z","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:386: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:443: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":1787221437546,"env":"testing","version":"0.0.0-test","pid":73968,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"S1Z90-1JKDD","sessionId":"11245013dcc3218a2a16fd5dde31f4b627880b4dd5d25ebc765c15abef8ae040","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.546Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"S1Z90-1JKDD","sessionId":"11245013dcc3218a2a16fd5dde31f4b627880b4dd5d25ebc765c15abef8ae040","tenantId":"authz-tenant","timestamp":"2026-08-20T10:23:57.546Z","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:386: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:443: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":1787221438517,"env":"testing","version":"0.0.0-test","pid":73971,"operation":"HandleToolRequest","requestId":"DJGQ2-A13DW","sessionId":"436fbf355cad1bb116a6e73f056f8f222db22cff3ab6da459f70297f21229e95","timestamp":"2026-08-20T10:23:58.512Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"DJGQ2-A13DW","sessionId":"436fbf355cad1bb116a6e73f056f8f222db22cff3ab6da459f70297f21229e95","timestamp":"2026-08-20T10:23:58.512Z","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:443: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":1787221453869,"env":"testing","version":"0.0.0-test","pid":74078,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"11D79-NVTAA","sessionId":"99426c0565bb9046a6d05eabe97d3f2590c81e07f7896ecc75f70c357ad497c4","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.868Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"11D79-NVTAA","sessionId":"99426c0565bb9046a6d05eabe97d3f2590c81e07f7896ecc75f70c357ad497c4","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.868Z","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:386: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:443: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":1787221453876,"env":"testing","version":"0.0.0-test","pid":74078,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"B2SV3-N26NA","sessionId":"40bc694f688bae6d94e4acf651bbea88de4e5860ff92036f913a4496f958a408","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.876Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"B2SV3-N26NA","sessionId":"40bc694f688bae6d94e4acf651bbea88de4e5860ff92036f913a4496f958a408","tenantId":"authz-tenant","timestamp":"2026-08-20T10:24:13.876Z","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:386: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:443: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":1787221454651,"env":"testing","version":"0.0.0-test","pid":74083,"operation":"HandleToolRequest","requestId":"DX3A3-53H96","sessionId":"38fb68d98a2cd7a4d2fd70b83f225766ebbe5dd8c03789d6c92a4fb7d896bb4f","timestamp":"2026-08-20T10:24:14.648Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"DX3A3-53H96","sessionId":"38fb68d98a2cd7a4d2fd70b83f225766ebbe5dd8c03789d6c92a4fb7d896bb4f","timestamp":"2026-08-20T10:24:14.648Z","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:443:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
1
+ {"level":50,"time":1787249227153,"env":"testing","version":"0.0.0-test","pid":43212,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"LEPEF-Q8LQQ","sessionId":"785ee4109a184c257b58b7ffcdf73e21589e44c418eee4ccdfcc5a71dbfe6847","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.152Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"LEPEF-Q8LQQ","sessionId":"785ee4109a184c257b58b7ffcdf73e21589e44c418eee4ccdfcc5a71dbfe6847","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.152Z","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:382: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:449: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":1787249227166,"env":"testing","version":"0.0.0-test","pid":43212,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"1F3Z0-Z77NT","sessionId":"d1e234e49509af45bb2dd4575bcb09cc467dfc8f6f1a5e5e038227f608f6b5b2","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.166Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"1F3Z0-Z77NT","sessionId":"d1e234e49509af45bb2dd4575bcb09cc467dfc8f6f1a5e5e038227f608f6b5b2","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:07.166Z","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:382: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:449: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":1787249228307,"env":"testing","version":"0.0.0-test","pid":43220,"operation":"HandleToolRequest","requestId":"XMI4S-0CN4L","sessionId":"10b75ba7267aa0f3ac4acfa447e0232f7e9080095e6305d7a7fcc652016e56f2","timestamp":"2026-08-20T18:07:08.301Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"XMI4S-0CN4L","sessionId":"10b75ba7267aa0f3ac4acfa447e0232f7e9080095e6305d7a7fcc652016e56f2","timestamp":"2026-08-20T18:07:08.301Z","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:449: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":1787249244842,"env":"testing","version":"0.0.0-test","pid":43342,"auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"K0YRI-7BS1I","sessionId":"2ee7048f7affa20c25adfd980a023387cea2ce2a61eaee63048249d4dc0aab57","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.841Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"K0YRI-7BS1I","sessionId":"2ee7048f7affa20c25adfd980a023387cea2ce2a61eaee63048249d4dc0aab57","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.841Z","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:382: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:449: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":1787249244854,"env":"testing","version":"0.0.0-test","pid":43342,"auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"operation":"HandleToolRequest","requestId":"NFZQV-P2NPI","sessionId":"f0811459e7d29d052c034cdaa5f6f4da3f9f150c0d5af8ebf65ae1aaac2d9c0c","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.854Z","toolName":"scoped_echo","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"NFZQV-P2NPI","sessionId":"f0811459e7d29d052c034cdaa5f6f4da3f9f150c0d5af8ebf65ae1aaac2d9c0c","tenantId":"authz-tenant","timestamp":"2026-08-20T18:07:24.854Z","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:382: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:449: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":1787249246537,"env":"testing","version":"0.0.0-test","pid":43354,"operation":"HandleToolRequest","requestId":"57E0T-P1UGN","sessionId":"757eccb5bfa31c7a69caa0876786df1a43a8d46e255273e5c42c20c68ebc062f","timestamp":"2026-08-20T18:07:26.534Z","toolName":"session_cancellable_tool","critical":false,"errorCode":-32004,"originalErrorType":"stringEncountered","finalErrorType":"McpError","errorData":{"operation":"HandleToolRequest","requestId":"57E0T-P1UGN","sessionId":"757eccb5bfa31c7a69caa0876786df1a43a8d46e255273e5c42c20c68ebc062f","timestamp":"2026-08-20T18:07:26.534Z","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:449:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
@@ -12,9 +12,14 @@
12
12
  * `notifications/resources/updated` is subscription-scoped: it is emitted only
13
13
  * for URIs the client actually subscribed to via `resources/subscribe` (#354).
14
14
  *
15
+ * That request-scoped path is the **2025-era** one. On 2026-07-28 delivery
16
+ * belongs to the client's `subscriptions/listen` stream, so a modern instance
17
+ * publishes to the handler's event bus instead — see {@link buildBusNotifiers}
18
+ * (#193).
19
+ *
15
20
  * @module src/mcp-server/notifications
16
21
  */
17
- import type { ServerNotification } from '@modelcontextprotocol/server';
22
+ import type { ServerEventBus, ServerNotification, ServerNotifier } from '@modelcontextprotocol/server';
18
23
  /**
19
24
  * The slice of `ctx.mcpReq` these notifiers need. Typed with an optional
20
25
  * `notify` so the runtime presence check is type-meaningful — a background or
@@ -36,6 +41,68 @@ export interface ResourceSubscriptions {
36
41
  /** True when the connected client subscribed to this exact URI. */
37
42
  has: (uri: string) => boolean;
38
43
  }
44
+ /**
45
+ * The same four closures, each optional — what a server-level notifier set
46
+ * offers and what {@link selectNotifiers} returns, since a fallback set may not
47
+ * carry all four.
48
+ */
49
+ export interface OptionalNotifiers {
50
+ notifyPromptListChanged?: () => void;
51
+ notifyResourceListChanged?: () => void;
52
+ notifyResourceUpdated?: (uri: string) => void;
53
+ notifyToolListChanged?: () => void;
54
+ }
55
+ /** Every delivery path a handler factory can offer, in one bag. */
56
+ export interface NotifierSources extends OptionalNotifiers {
57
+ /** Modern-era publish facade. Present only on `modern` instances. */
58
+ bus?: ServerNotifier;
59
+ /** Legacy-era `resources/subscribe` registry. */
60
+ subscriptions?: ResourceSubscriptions;
61
+ }
62
+ /**
63
+ * Picks the delivery path a handler's `ctx.notify*` should take, era-ordered.
64
+ *
65
+ * A modern instance publishes to the listen bus, where the SDK applies the
66
+ * client's subscription filter and an out-of-request emit still reaches open
67
+ * streams (#193). A legacy instance sends through the request's own scope so
68
+ * the message carries `relatedRequestId` (#135). The server-level closures are
69
+ * the fallback for scopes with no sender at all — stdio and test harnesses.
70
+ *
71
+ * Both handler factories route through here so the ordering is one decision
72
+ * rather than two copies that can drift apart.
73
+ */
74
+ export declare function selectNotifiers(sources: NotifierSources, mcpReq: NotificationSender | undefined): OptionalNotifiers;
75
+ /**
76
+ * A {@link ServerNotifier} over an arbitrary {@link ServerEventBus}.
77
+ *
78
+ * `createMcpHandler` returns one bound to its own bus, but the framework builds
79
+ * the bus first — before any transport exists — so `setup()` can capture a
80
+ * publish handle that stays valid once serving starts. The names mirror the
81
+ * wire methods.
82
+ */
83
+ export declare function notifierFor(bus: ServerEventBus): ServerNotifier;
84
+ /**
85
+ * Builds notifier closures that publish onto the modern era's
86
+ * `subscriptions/listen` bus.
87
+ *
88
+ * On protocol revision 2026-07-28 a client opts into notification types by
89
+ * opening a `subscriptions/listen` stream, and the spec is explicit that a
90
+ * server MUST NOT send types the client has not requested. That filter lives in
91
+ * the SDK's listen router, which only sees what reaches the bus — so a modern
92
+ * handler firing through its own request scope bypasses it and delivers to
93
+ * clients that opened no stream at all.
94
+ *
95
+ * Publishing is also what makes *out-of-request* emission work: the bus is not
96
+ * request-scoped, so a background emitter reaches every open stream rather than
97
+ * dropping into a closed exchange.
98
+ *
99
+ * No subscription registry is consulted here — including for
100
+ * `resources/updated`. Per-URI routing is the listen filter's
101
+ * `resourceSubscriptions` field, which the SDK applies on publish; the
102
+ * `resources/subscribe` registry is the 2025-era mechanism and does not exist
103
+ * on this era.
104
+ */
105
+ export declare function buildBusNotifiers(notify: ServerNotifier): RequestScopedNotifiers;
39
106
  /**
40
107
  * Builds notifier closures bound to a single request's `ctx.mcpReq.notify`.
41
108
  *
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/mcp-server/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAIvE;;;;;GAKG;AACH,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED,qFAAqF;AACrF,MAAM,WAAW,sBAAsB;IACrC,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,qBAAqB,EAAE,MAAM,IAAI,CAAC;CACnC;AAED,kFAAkF;AAClF,MAAM,WAAW,qBAAqB;IACpC,mEAAmE;IACnE,GAAG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B,iDAAiD;IACjD,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,iBAAiB,CAMnB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAO/D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,sBAAsB,CAOhF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,kBAAkB,EAC1B,aAAa,CAAC,EAAE,qBAAqB,GACpC,sBAAsB,GAAG,SAAS,CA2BpC"}
@@ -12,9 +12,76 @@
12
12
  * `notifications/resources/updated` is subscription-scoped: it is emitted only
13
13
  * for URIs the client actually subscribed to via `resources/subscribe` (#354).
14
14
  *
15
+ * That request-scoped path is the **2025-era** one. On 2026-07-28 delivery
16
+ * belongs to the client's `subscriptions/listen` stream, so a modern instance
17
+ * publishes to the handler's event bus instead — see {@link buildBusNotifiers}
18
+ * (#193).
19
+ *
15
20
  * @module src/mcp-server/notifications
16
21
  */
17
22
  import { logger } from '../utils/internal/logger.js';
23
+ /**
24
+ * Picks the delivery path a handler's `ctx.notify*` should take, era-ordered.
25
+ *
26
+ * A modern instance publishes to the listen bus, where the SDK applies the
27
+ * client's subscription filter and an out-of-request emit still reaches open
28
+ * streams (#193). A legacy instance sends through the request's own scope so
29
+ * the message carries `relatedRequestId` (#135). The server-level closures are
30
+ * the fallback for scopes with no sender at all — stdio and test harnesses.
31
+ *
32
+ * Both handler factories route through here so the ordering is one decision
33
+ * rather than two copies that can drift apart.
34
+ */
35
+ export function selectNotifiers(sources, mcpReq) {
36
+ return ((sources.bus ? buildBusNotifiers(sources.bus) : undefined) ??
37
+ buildRequestScopedNotifiers(mcpReq ?? {}, sources.subscriptions) ??
38
+ sources);
39
+ }
40
+ /**
41
+ * A {@link ServerNotifier} over an arbitrary {@link ServerEventBus}.
42
+ *
43
+ * `createMcpHandler` returns one bound to its own bus, but the framework builds
44
+ * the bus first — before any transport exists — so `setup()` can capture a
45
+ * publish handle that stays valid once serving starts. The names mirror the
46
+ * wire methods.
47
+ */
48
+ export function notifierFor(bus) {
49
+ return {
50
+ toolsChanged: () => bus.publish({ kind: 'tools_list_changed' }),
51
+ promptsChanged: () => bus.publish({ kind: 'prompts_list_changed' }),
52
+ resourcesChanged: () => bus.publish({ kind: 'resources_list_changed' }),
53
+ resourceUpdated: (uri) => bus.publish({ kind: 'resource_updated', uri }),
54
+ };
55
+ }
56
+ /**
57
+ * Builds notifier closures that publish onto the modern era's
58
+ * `subscriptions/listen` bus.
59
+ *
60
+ * On protocol revision 2026-07-28 a client opts into notification types by
61
+ * opening a `subscriptions/listen` stream, and the spec is explicit that a
62
+ * server MUST NOT send types the client has not requested. That filter lives in
63
+ * the SDK's listen router, which only sees what reaches the bus — so a modern
64
+ * handler firing through its own request scope bypasses it and delivers to
65
+ * clients that opened no stream at all.
66
+ *
67
+ * Publishing is also what makes *out-of-request* emission work: the bus is not
68
+ * request-scoped, so a background emitter reaches every open stream rather than
69
+ * dropping into a closed exchange.
70
+ *
71
+ * No subscription registry is consulted here — including for
72
+ * `resources/updated`. Per-URI routing is the listen filter's
73
+ * `resourceSubscriptions` field, which the SDK applies on publish; the
74
+ * `resources/subscribe` registry is the 2025-era mechanism and does not exist
75
+ * on this era.
76
+ */
77
+ export function buildBusNotifiers(notify) {
78
+ return {
79
+ notifyToolListChanged: () => notify.toolsChanged(),
80
+ notifyResourceListChanged: () => notify.resourcesChanged(),
81
+ notifyPromptListChanged: () => notify.promptsChanged(),
82
+ notifyResourceUpdated: (uri) => notify.resourceUpdated(uri),
83
+ };
84
+ }
18
85
  /**
19
86
  * Builds notifier closures bound to a single request's `ctx.mcpReq.notify`.
20
87
  *
@@ -1 +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AA+B;YAC/B,IAAI,aAAa,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC7C,MAAM,CAAC,KAAK,CAAC,uBAAuB,GAAG,oCAAoC,CAAC,CAAC;gBAC7E,OAAO;YACT,CAAC;YACD,IAAI,CAAC,EAAE,MAAM,EAAE,iCAAiC,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACvE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Encapsulates the registration of all resource definitions with an McpServer.
3
3
  * @module src/mcp-server/resources/resource-registration
4
4
  */
5
- import { type McpServer } from '@modelcontextprotocol/server';
5
+ import { type McpServer, type ServerNotifier } from '@modelcontextprotocol/server';
6
6
  import type { ResourceSubscriptions } from '../../mcp-server/notifications.js';
7
7
  import type { AnyResourceDefinition } from '../../mcp-server/resources/utils/resourceDefinition.js';
8
8
  import { type ResourceHandlerFactoryServices } from '../../mcp-server/resources/utils/resourceHandlerFactory.js';
@@ -15,7 +15,7 @@ export declare class ResourceRegistry {
15
15
  /**
16
16
  * Registers all resolved resource definitions with the provided McpServer instance.
17
17
  */
18
- registerAll(server: McpServer, subscriptions?: ResourceSubscriptions): Promise<void>;
18
+ registerAll(server: McpServer, subscriptions?: ResourceSubscriptions, bus?: ServerNotifier): Promise<void>;
19
19
  /** Throws at startup if a resource with the same name was already registered. */
20
20
  private assertUniqueName;
21
21
  private registerResource;
@@ -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,8BAA8B,CAAC;AAEhF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,wDAAwD,CAAC;AAUhE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,YACU,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B,EAC9C;IAEJ;;OAEG;IACU,WAAW,CACtB,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,IAAI,CAAC,CA2Bf;IAED,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAqD/B"}
1
+ {"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,wDAAwD,CAAC;AAUhE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,YACU,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B,EAC9C;IAEJ;;OAEG;IACU,WAAW,CACtB,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,qBAAqB,EACrC,GAAG,CAAC,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CA4Bf;IAED,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAqD/B"}
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Encapsulates the registration of all resource definitions with an McpServer.
3
3
  * @module src/mcp-server/resources/resource-registration
4
4
  */
5
- import { ResourceTemplate } from '@modelcontextprotocol/server';
5
+ import { ResourceTemplate, } from '@modelcontextprotocol/server';
6
6
  import { createResourceHandler, } from '../../mcp-server/resources/utils/resourceHandlerFactory.js';
7
7
  import { JsonRpcErrorCode } from '../../types-global/errors.js';
8
8
  import { ErrorHandler } from '../../utils/internal/error-handler/errorHandler.js';
@@ -23,7 +23,7 @@ export class ResourceRegistry {
23
23
  /**
24
24
  * Registers all resolved resource definitions with the provided McpServer instance.
25
25
  */
26
- async registerAll(server, subscriptions) {
26
+ async registerAll(server, subscriptions, bus) {
27
27
  this.registeredNames.clear();
28
28
  // Per-server notifier closures targeting `server.send*ListChanged()`. Bound
29
29
  // once per registerAll() call — never mutated on a shared services object
@@ -35,6 +35,7 @@ export class ResourceRegistry {
35
35
  notifyResourceListChanged: () => server.sendResourceListChanged(),
36
36
  notifyToolListChanged: () => server.sendToolListChanged(),
37
37
  ...(subscriptions && { subscriptions }),
38
+ ...(bus && { bus }),
38
39
  };
39
40
  const context = requestContextService.createRequestContext({
40
41
  operation: 'ResourceRegistry.registerAll',
@@ -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,8BAA8B,CAAC;AAIhF,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,CAAC;AAE3E,SAAS,uBAAuB,CAAC,WAAmB;IAClD,OAAO,WAAW,CAA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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;oBACd,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;iBAChD,CAAC,CAAC;gBAEH,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YACrE,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAC5E,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,CACtB,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"}
1
+ {"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAEL,gBAAgB,GAEjB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,qBAAqB,GAGtB,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,M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), checks inline auth, validates params, formats response.
4
4
  * @module src/mcp-server/resources/utils/resourceHandlerFactory
5
5
  */
6
- import type { InputRequiredResult, ReadResourceResult, ServerContext, Variables } from '@modelcontextprotocol/server';
6
+ import type { InputRequiredResult, ReadResourceResult, ServerContext, ServerNotifier, Variables } from '@modelcontextprotocol/server';
7
7
  import { type ResourceSubscriptions } from '../../../mcp-server/notifications.js';
8
8
  import type { AnyResourceDefinition } from '../../../mcp-server/resources/utils/resourceDefinition.js';
9
9
  import type { StorageService } from '../../../storage/core/StorageService.js';
@@ -28,16 +28,24 @@ export interface ResourceHandlerFactoryServices {
28
28
  * McpServer gets its own notifier closures — preventing a concurrent
29
29
  * registerAll() from overwriting an in-flight handler's notifier target.
30
30
  *
31
- * The resource handler factory prefers request-scoped notifiers
32
- * ({@link buildRequestScopedNotifiers}, #135) and uses these only as a fallback
33
- * when the request scope exposes no sender (e.g. a non-request test scope).
31
+ * The resource handler factory picks a delivery path per era via
32
+ * {@link selectNotifiers}, and uses these closures only as a fallback for
33
+ * scopes with neither a bus nor a request sender (stdio, test harnesses).
34
34
  */
35
35
  export interface ResourceHandlerNotifiers {
36
+ /**
37
+ * Publish facade for the modern era's `subscriptions/listen` bus, supplied
38
+ * only for `modern` instances. Takes precedence over the request-scoped path:
39
+ * on 2026-07-28 the client opts into notification types through its listen
40
+ * stream, and only what reaches the bus is filtered against that opt-in
41
+ * (#193).
42
+ */
43
+ bus?: ServerNotifier;
36
44
  notifyPromptListChanged?: () => void;
37
45
  notifyResourceListChanged?: () => void;
38
46
  notifyResourceUpdated?: (uri: string) => void;
39
47
  notifyToolListChanged?: () => void;
40
- /** Per-connection `resources/subscribe` registry (#354). */
48
+ /** Per-connection `resources/subscribe` registry (#354). Legacy era only. */
41
49
  subscriptions?: ResourceSubscriptions;
42
50
  }
43
51
  /**
@@ -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,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACV,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AACvC,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,qEAAqE;AACrE,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAwB;IACvC,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,4DAA4D;IAC5D,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC;AA+CD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,8BAA8B,EACxC,SAAS,EAAE,wBAAwB,GAClC,CACD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,CA+GrD"}
1
+ {"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,SAAS,EACV,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAAE,KAAK,qBAAqB,EAAmB,MAAM,+BAA+B,CAAC;AAC5F,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,qEAAqE;AACrE,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC;AA+CD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,8BAA8B,EACxC,SAAS,EAAE,wBAAwB,GAClC,CACD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,CA8GrD"}