@cyanheads/mcp-ts-core 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -10
- package/CLAUDE.md +14 -10
- package/README.md +3 -3
- package/biome.json +1 -1
- package/changelog/0.11.x/0.11.2.md +98 -0
- package/changelog/0.11.x/0.11.3.md +49 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -13
- package/dist/config/index.js.map +1 -1
- package/dist/config/logLevelAlias.d.ts +15 -0
- package/dist/config/logLevelAlias.d.ts.map +1 -0
- package/dist/config/logLevelAlias.js +30 -0
- package/dist/config/logLevelAlias.js.map +1 -0
- package/dist/core/app.d.ts +37 -14
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/app.js +56 -23
- package/dist/core/app.js.map +1 -1
- package/dist/core/context.d.ts +10 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +10 -1
- package/dist/core/context.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/worker.d.ts.map +1 -1
- package/dist/core/worker.js +35 -18
- package/dist/core/worker.js.map +1 -1
- package/dist/logs/combined.log +16 -8
- package/dist/logs/error.log +12 -4
- package/dist/mcp-server/elicitation.d.ts +64 -0
- package/dist/mcp-server/elicitation.d.ts.map +1 -0
- package/dist/mcp-server/elicitation.js +81 -0
- package/dist/mcp-server/elicitation.js.map +1 -0
- package/dist/mcp-server/protocolSession.d.ts +34 -0
- package/dist/mcp-server/protocolSession.d.ts.map +1 -0
- package/dist/mcp-server/protocolSession.js +13 -0
- package/dist/mcp-server/protocolSession.js.map +1 -0
- package/dist/mcp-server/resources/resource-registration.d.ts +2 -1
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.js +6 -2
- package/dist/mcp-server/resources/resource-registration.js.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +7 -12
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +24 -31
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
- package/dist/mcp-server/server.d.ts +3 -0
- package/dist/mcp-server/server.d.ts.map +1 -1
- package/dist/mcp-server/server.js +12 -2
- package/dist/mcp-server/server.js.map +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts +2 -1
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-registration.js +6 -2
- package/dist/mcp-server/tools/tool-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +7 -13
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +11 -44
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -1
- package/dist/mcp-server/transports/http/httpServer.d.ts +2 -2
- package/dist/mcp-server/transports/http/httpServer.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpServer.js.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.d.ts +2 -2
- package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.js +113 -55
- package/dist/mcp-server/transports/http/httpTransport.js.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.d.ts +17 -0
- package/dist/mcp-server/transports/http/sessionStore.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.js +71 -0
- package/dist/mcp-server/transports/http/sessionStore.js.map +1 -1
- package/dist/mcp-server/transports/manager.d.ts +2 -6
- package/dist/mcp-server/transports/manager.d.ts.map +1 -1
- package/dist/mcp-server/transports/manager.js +4 -0
- package/dist/mcp-server/transports/manager.js.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.d.ts +2 -2
- package/dist/services/canvas/core/CanvasRegistry.d.ts.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.js +14 -3
- package/dist/services/canvas/core/CanvasRegistry.js.map +1 -1
- package/dist/services/canvas/core/DataCanvas.d.ts +1 -1
- package/dist/services/canvas/core/DataCanvas.d.ts.map +1 -1
- package/dist/services/canvas/core/DataCanvas.js +2 -2
- package/dist/services/canvas/core/DataCanvas.js.map +1 -1
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.d.ts.map +1 -1
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.js +11 -3
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.js.map +1 -1
- package/dist/services/canvas/providers/duckdb/exportWriter.d.ts.map +1 -1
- package/dist/services/canvas/providers/duckdb/exportWriter.js +23 -2
- package/dist/services/canvas/providers/duckdb/exportWriter.js.map +1 -1
- package/dist/services/mirror/core/defineMirror.d.ts.map +1 -1
- package/dist/services/mirror/core/defineMirror.js +18 -7
- package/dist/services/mirror/core/defineMirror.js.map +1 -1
- package/dist/services/mirror/core/runner.d.ts.map +1 -1
- package/dist/services/mirror/core/runner.js +3 -0
- package/dist/services/mirror/core/runner.js.map +1 -1
- package/dist/services/mirror/index.d.ts +1 -1
- package/dist/services/mirror/index.d.ts.map +1 -1
- package/dist/services/mirror/index.js.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts +20 -0
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js +92 -8
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -1
- package/dist/storage/core/StorageService.d.ts.map +1 -1
- package/dist/storage/core/StorageService.js +4 -1
- package/dist/storage/core/StorageService.js.map +1 -1
- package/dist/storage/core/storageValidation.d.ts +8 -0
- package/dist/storage/core/storageValidation.d.ts.map +1 -1
- package/dist/storage/core/storageValidation.js +22 -0
- package/dist/storage/core/storageValidation.js.map +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts.map +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.js +67 -25
- package/dist/storage/providers/inMemory/inMemoryProvider.js.map +1 -1
- package/dist/testing/fuzz.d.ts.map +1 -1
- package/dist/testing/fuzz.js +33 -14
- package/dist/testing/fuzz.js.map +1 -1
- package/dist/testing/index.d.ts +45 -13
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +29 -76
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/vitest.d.ts +12 -3
- package/dist/testing/vitest.d.ts.map +1 -1
- package/dist/testing/vitest.js +3 -0
- package/dist/testing/vitest.js.map +1 -1
- package/dist/utils/formatting/diffFormatter.d.ts +5 -5
- package/dist/utils/formatting/diffFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/diffFormatter.js +1 -1
- package/dist/utils/formatting/diffFormatter.js.map +1 -1
- package/dist/utils/formatting/tableFormatter.d.ts +3 -3
- package/dist/utils/formatting/tableFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/tableFormatter.js +1 -1
- package/dist/utils/formatting/tableFormatter.js.map +1 -1
- package/dist/utils/formatting/treeFormatter.d.ts +3 -3
- package/dist/utils/formatting/treeFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/treeFormatter.js +1 -1
- package/dist/utils/formatting/treeFormatter.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/metrics/tokenCounter.d.ts +3 -3
- package/dist/utils/metrics/tokenCounter.d.ts.map +1 -1
- package/dist/utils/metrics/tokenCounter.js.map +1 -1
- package/dist/utils/network/fetchWithTimeout.d.ts +50 -21
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -1
- package/dist/utils/network/fetchWithTimeout.js +299 -90
- package/dist/utils/network/fetchWithTimeout.js.map +1 -1
- package/dist/utils/network/httpError.d.ts.map +1 -1
- package/dist/utils/network/httpError.js +2 -2
- package/dist/utils/network/httpError.js.map +1 -1
- package/dist/utils/network/responseBody.d.ts +35 -0
- package/dist/utils/network/responseBody.d.ts.map +1 -0
- package/dist/utils/network/responseBody.js +104 -0
- package/dist/utils/network/responseBody.js.map +1 -0
- package/dist/utils/network/retry.d.ts +2 -2
- package/dist/utils/network/retry.d.ts.map +1 -1
- package/dist/utils/pagination/pagination.d.ts +3 -3
- package/dist/utils/pagination/pagination.d.ts.map +1 -1
- package/dist/utils/pagination/pagination.js.map +1 -1
- package/dist/utils/parsing/csvParser.d.ts +2 -2
- package/dist/utils/parsing/csvParser.d.ts.map +1 -1
- package/dist/utils/parsing/csvParser.js +1 -1
- package/dist/utils/parsing/csvParser.js.map +1 -1
- package/dist/utils/parsing/dateParser.d.ts +11 -7
- package/dist/utils/parsing/dateParser.d.ts.map +1 -1
- package/dist/utils/parsing/dateParser.js +8 -4
- package/dist/utils/parsing/dateParser.js.map +1 -1
- package/dist/utils/parsing/frontmatterParser.d.ts +6 -3
- package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -1
- package/dist/utils/parsing/frontmatterParser.js +9 -9
- package/dist/utils/parsing/frontmatterParser.js.map +1 -1
- package/dist/utils/parsing/htmlExtractor.d.ts +8 -3
- package/dist/utils/parsing/htmlExtractor.d.ts.map +1 -1
- package/dist/utils/parsing/htmlExtractor.js +7 -7
- package/dist/utils/parsing/htmlExtractor.js.map +1 -1
- package/dist/utils/parsing/index.d.ts +1 -0
- package/dist/utils/parsing/index.d.ts.map +1 -1
- package/dist/utils/parsing/index.js +1 -0
- package/dist/utils/parsing/index.js.map +1 -1
- package/dist/utils/parsing/inputBudget.d.ts +35 -0
- package/dist/utils/parsing/inputBudget.d.ts.map +1 -0
- package/dist/utils/parsing/inputBudget.js +79 -0
- package/dist/utils/parsing/inputBudget.js.map +1 -0
- package/dist/utils/parsing/jsonParser.d.ts +6 -3
- package/dist/utils/parsing/jsonParser.d.ts.map +1 -1
- package/dist/utils/parsing/jsonParser.js +8 -8
- package/dist/utils/parsing/jsonParser.js.map +1 -1
- package/dist/utils/parsing/pdfParser.d.ts +41 -19
- package/dist/utils/parsing/pdfParser.d.ts.map +1 -1
- package/dist/utils/parsing/pdfParser.js +86 -60
- package/dist/utils/parsing/pdfParser.js.map +1 -1
- package/dist/utils/parsing/xmlParser.d.ts +4 -2
- package/dist/utils/parsing/xmlParser.d.ts.map +1 -1
- package/dist/utils/parsing/xmlParser.js +6 -7
- package/dist/utils/parsing/xmlParser.js.map +1 -1
- package/dist/utils/parsing/yamlParser.d.ts +4 -2
- package/dist/utils/parsing/yamlParser.d.ts.map +1 -1
- package/dist/utils/parsing/yamlParser.js +6 -7
- package/dist/utils/parsing/yamlParser.js.map +1 -1
- package/dist/utils/security/rateLimiter.d.ts +2 -2
- package/dist/utils/security/rateLimiter.d.ts.map +1 -1
- package/dist/utils/security/rateLimiter.js +1 -1
- package/dist/utils/security/rateLimiter.js.map +1 -1
- package/dist/utils/telemetry/trace.d.ts +3 -3
- package/dist/utils/telemetry/trace.d.ts.map +1 -1
- package/dist/utils/telemetry/trace.js.map +1 -1
- package/package.json +17 -15
- package/skills/add-test/SKILL.md +2 -2
- package/skills/api-auth/SKILL.md +5 -5
- package/skills/api-context/SKILL.md +13 -12
- package/skills/api-testing/SKILL.md +29 -10
- package/skills/api-utils/SKILL.md +4 -2
- package/skills/api-utils/references/parsing.md +3 -2
- package/skills/git-wrapup/SKILL.md +22 -1
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +1 -1
package/dist/logs/combined.log
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
{"level":
|
|
2
|
-
{"level":
|
|
3
|
-
{"level":50,"time":
|
|
4
|
-
{"level":50,"time":
|
|
5
|
-
{"level":40,"time":
|
|
6
|
-
{"level":40,"time":
|
|
7
|
-
{"level":50,"time":
|
|
8
|
-
{"level":50,"time":
|
|
1
|
+
{"level":50,"time":1786355643970,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"0796ac6f-2b10-450f-a3aa-afc9e5afd9e9","timestamp":"2026-08-10T09:54:03.969Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","errorData":{"taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: stdio-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
2
|
+
{"level":50,"time":1786355651067,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"85a7c8d1-5db8-40dc-9582-27d611c2610c","timestamp":"2026-08-10T09:54:11.067Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","errorData":{"taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
3
|
+
{"level":50,"time":1786355652529,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"21944399-9c90-4496-aad0-4d5550fc1f23","timestamp":"2026-08-10T09:54:12.529Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","errorData":{"taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: http-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
4
|
+
{"level":50,"time":1786355659662,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"9d83cfe0-a1a3-4c19-a328-bb6647b73e6a","timestamp":"2026-08-10T09:54:19.662Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","errorData":{"taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
5
|
+
{"level":40,"time":1786355660098,"env":"testing","version":"0.11.3","pid":20858,"transport":"http","requestId":"Q706M-MJD1O","timestamp":"2026-08-10T09:54:20.097Z","operation":"TransportManager.start","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."}
|
|
6
|
+
{"level":40,"time":1786355662006,"env":"testing","version":"0.11.3","pid":20858,"component":"HttpTransport","requestId":"7FM6Z-PHMPW","timestamp":"2026-08-10T09:54:22.006Z","operation":"HttpRpcRequest","sessionId":"not-a-real-session-1786355662005","msg":"Session validation failed - invalid or hijacked session"}
|
|
7
|
+
{"level":50,"time":1786355665294,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
8
|
+
{"level":50,"time":1786355665304,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
9
|
+
{"level":50,"time":1786355677942,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"a7b18215-0a17-4115-8166-7c2ac279ed28","timestamp":"2026-08-10T09:54:37.941Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","errorData":{"taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: stdio-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
10
|
+
{"level":50,"time":1786355685002,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"bff21d5d-7abe-4f04-9fd6-f562f82807fa","timestamp":"2026-08-10T09:54:45.002Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","errorData":{"taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
11
|
+
{"level":50,"time":1786355686315,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"f73e3fe3-ca14-40cf-abfa-e60923ec955b","timestamp":"2026-08-10T09:54:46.315Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","errorData":{"taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: http-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
12
|
+
{"level":50,"time":1786355693444,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"69c06f06-7927-4ed8-a558-bff91280b178","timestamp":"2026-08-10T09:54:53.444Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","errorData":{"taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
13
|
+
{"level":40,"time":1786355693769,"env":"testing","version":"0.11.3","pid":21047,"transport":"http","requestId":"GZDRM-Q35FL","timestamp":"2026-08-10T09:54:53.769Z","operation":"TransportManager.start","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."}
|
|
14
|
+
{"level":40,"time":1786355695537,"env":"testing","version":"0.11.3","pid":21047,"component":"HttpTransport","requestId":"11T81-2IUQG","timestamp":"2026-08-10T09:54:55.537Z","operation":"HttpRpcRequest","sessionId":"not-a-real-session-1786355695537","msg":"Session validation failed - invalid or hijacked session"}
|
|
15
|
+
{"level":50,"time":1786355697700,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251: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:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\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."}
|
|
16
|
+
{"level":50,"time":1786355697708,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251: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:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\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."}
|
package/dist/logs/error.log
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
{"level":50,"time":
|
|
2
|
-
{"level":50,"time":
|
|
3
|
-
{"level":50,"time":
|
|
4
|
-
{"level":50,"time":
|
|
1
|
+
{"level":50,"time":1786355643970,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"0796ac6f-2b10-450f-a3aa-afc9e5afd9e9","timestamp":"2026-08-10T09:54:03.969Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","errorData":{"taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: stdio-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
2
|
+
{"level":50,"time":1786355651067,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"85a7c8d1-5db8-40dc-9582-27d611c2610c","timestamp":"2026-08-10T09:54:11.067Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","errorData":{"taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
3
|
+
{"level":50,"time":1786355652529,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"21944399-9c90-4496-aad0-4d5550fc1f23","timestamp":"2026-08-10T09:54:12.529Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","errorData":{"taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: http-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
4
|
+
{"level":50,"time":1786355659662,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"9d83cfe0-a1a3-4c19-a328-bb6647b73e6a","timestamp":"2026-08-10T09:54:19.662Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","errorData":{"taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
5
|
+
{"level":50,"time":1786355665294,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
6
|
+
{"level":50,"time":1786355665304,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
7
|
+
{"level":50,"time":1786355677942,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"a7b18215-0a17-4115-8166-7c2ac279ed28","timestamp":"2026-08-10T09:54:37.941Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","errorData":{"taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: stdio-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
8
|
+
{"level":50,"time":1786355685002,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"bff21d5d-7abe-4f04-9fd6-f562f82807fa","timestamp":"2026-08-10T09:54:45.002Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","errorData":{"taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
9
|
+
{"level":50,"time":1786355686315,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"f73e3fe3-ca14-40cf-abfa-e60923ec955b","timestamp":"2026-08-10T09:54:46.315Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","errorData":{"taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: http-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
10
|
+
{"level":50,"time":1786355693444,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"69c06f06-7927-4ed8-a558-bff91280b178","timestamp":"2026-08-10T09:54:53.444Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","errorData":{"taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
11
|
+
{"level":50,"time":1786355697700,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251: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:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\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."}
|
|
12
|
+
{"level":50,"time":1786355697708,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"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:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251: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:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\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."}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared elicitation plumbing for the tool and resource handler
|
|
3
|
+
* factories.
|
|
4
|
+
* @module src/mcp-server/elicitation
|
|
5
|
+
*/
|
|
6
|
+
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
7
|
+
import { type ElicitRequestFormParams, type ElicitRequestURLParams, type ElicitResult, type ServerNotification, type ServerRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
import { type ZodObject, type ZodRawShape } from 'zod';
|
|
9
|
+
import type { ElicitFn } from '../core/context.js';
|
|
10
|
+
type SdkExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
|
|
11
|
+
/**
|
|
12
|
+
* The elicitation slice of the tool and resource notifier bundles.
|
|
13
|
+
*
|
|
14
|
+
* `elicitInput` and `getClientCapabilities` are bound at registration time to
|
|
15
|
+
* the per-server `Server` instance so `wrapElicit` can gate `ctx.elicit` on the
|
|
16
|
+
* client's advertised capability and forward elicitation requests on the wire.
|
|
17
|
+
* Both are undefined where no connected client is available (the auto-task
|
|
18
|
+
* background path).
|
|
19
|
+
*/
|
|
20
|
+
export interface ElicitationNotifiers {
|
|
21
|
+
/** Bound to `server.server.elicitInput.bind(server.server)`. */
|
|
22
|
+
elicitInput?: (params: ElicitRequestFormParams | ElicitRequestURLParams) => Promise<ElicitResult>;
|
|
23
|
+
/** Bound to `server.server.getClientCapabilities.bind(server.server)`. */
|
|
24
|
+
getClientCapabilities?: () => {
|
|
25
|
+
elicitation?: unknown;
|
|
26
|
+
} | undefined;
|
|
27
|
+
/** Route elicitation through RequestHandlerExtra.sendRequest on per-request servers. */
|
|
28
|
+
requestScopedElicitation?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Validate an accepted elicitation payload against the schema its request
|
|
32
|
+
* advertised.
|
|
33
|
+
*
|
|
34
|
+
* `Server.elicitInput` runs this check itself, but a per-request HTTP server
|
|
35
|
+
* reaches the client through `RequestHandlerExtra.sendRequest` instead and so
|
|
36
|
+
* bypasses it. Raising the SDK's own `InvalidParams` shape here keeps
|
|
37
|
+
* `ctx.elicit`'s failure contract identical on both transports.
|
|
38
|
+
*
|
|
39
|
+
* @param schema - The Zod object the elicitation request was built from.
|
|
40
|
+
* @param content - The `content` of an `accept` response.
|
|
41
|
+
* @throws {McpError} `InvalidParams` when the payload does not satisfy `schema`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function assertElicitedContent(schema: ZodObject<ZodRawShape>, content: unknown): void;
|
|
44
|
+
/**
|
|
45
|
+
* Builds `ctx.elicit` from the notifiers bound at registration time.
|
|
46
|
+
*
|
|
47
|
+
* Returns `undefined` when:
|
|
48
|
+
* - `elicitInput` was not bound (auto-task background path, or no server),
|
|
49
|
+
* - the client did not advertise the elicitation capability (checked at
|
|
50
|
+
* request time, after the initialize handshake populates capabilities).
|
|
51
|
+
*
|
|
52
|
+
* When defined, the returned function is an `ElicitFn`: directly callable for
|
|
53
|
+
* form-mode elicitation (schema converted from ZodObject to the restricted
|
|
54
|
+
* flat JSON Schema the MCP spec requires), plus a `.url(message, url)` helper
|
|
55
|
+
* for URL-mode elicitation (elicitationId generated internally).
|
|
56
|
+
*
|
|
57
|
+
* CRITICAL: `requestedSchema` must be a plain JSON Schema object in the spec's
|
|
58
|
+
* restricted flat form — passing a raw ZodObject causes AJV validation to
|
|
59
|
+
* reject the request on the SDK side. `z.toJSONSchema(schema)` produces the
|
|
60
|
+
* correct shape.
|
|
61
|
+
*/
|
|
62
|
+
export declare function wrapElicit(notifiers: ElicitationNotifiers, sdkContext: SdkExtra): ElicitFn | undefined;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=elicitation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../../src/mcp-server/elicitation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAgB,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAErE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,KAAK,QAAQ,GAAG,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,GAAG,sBAAsB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAClG,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,MAAM;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;IACpE,wFAAwF;IACxF,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAU5F;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,oBAAoB,EAC/B,UAAU,EAAE,QAAQ,GACnB,QAAQ,GAAG,SAAS,CAgCtB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared elicitation plumbing for the tool and resource handler
|
|
3
|
+
* factories.
|
|
4
|
+
* @module src/mcp-server/elicitation
|
|
5
|
+
*/
|
|
6
|
+
import { ElicitResultSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { toJSONSchema } from 'zod';
|
|
8
|
+
import { invalidParams } from '../types-global/errors.js';
|
|
9
|
+
/**
|
|
10
|
+
* Validate an accepted elicitation payload against the schema its request
|
|
11
|
+
* advertised.
|
|
12
|
+
*
|
|
13
|
+
* `Server.elicitInput` runs this check itself, but a per-request HTTP server
|
|
14
|
+
* reaches the client through `RequestHandlerExtra.sendRequest` instead and so
|
|
15
|
+
* bypasses it. Raising the SDK's own `InvalidParams` shape here keeps
|
|
16
|
+
* `ctx.elicit`'s failure contract identical on both transports.
|
|
17
|
+
*
|
|
18
|
+
* @param schema - The Zod object the elicitation request was built from.
|
|
19
|
+
* @param content - The `content` of an `accept` response.
|
|
20
|
+
* @throws {McpError} `InvalidParams` when the payload does not satisfy `schema`.
|
|
21
|
+
*/
|
|
22
|
+
export function assertElicitedContent(schema, content) {
|
|
23
|
+
const parsed = schema.safeParse(content);
|
|
24
|
+
if (parsed.success)
|
|
25
|
+
return;
|
|
26
|
+
throw invalidParams('Elicitation response content does not match the requested schema.', {
|
|
27
|
+
reason: 'elicitation_response_invalid',
|
|
28
|
+
issues: parsed.error.issues.map((issue) => ({
|
|
29
|
+
path: issue.path.join('.'),
|
|
30
|
+
code: issue.code,
|
|
31
|
+
})),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Builds `ctx.elicit` from the notifiers bound at registration time.
|
|
36
|
+
*
|
|
37
|
+
* Returns `undefined` when:
|
|
38
|
+
* - `elicitInput` was not bound (auto-task background path, or no server),
|
|
39
|
+
* - the client did not advertise the elicitation capability (checked at
|
|
40
|
+
* request time, after the initialize handshake populates capabilities).
|
|
41
|
+
*
|
|
42
|
+
* When defined, the returned function is an `ElicitFn`: directly callable for
|
|
43
|
+
* form-mode elicitation (schema converted from ZodObject to the restricted
|
|
44
|
+
* flat JSON Schema the MCP spec requires), plus a `.url(message, url)` helper
|
|
45
|
+
* for URL-mode elicitation (elicitationId generated internally).
|
|
46
|
+
*
|
|
47
|
+
* CRITICAL: `requestedSchema` must be a plain JSON Schema object in the spec's
|
|
48
|
+
* restricted flat form — passing a raw ZodObject causes AJV validation to
|
|
49
|
+
* reject the request on the SDK side. `z.toJSONSchema(schema)` produces the
|
|
50
|
+
* correct shape.
|
|
51
|
+
*/
|
|
52
|
+
export function wrapElicit(notifiers, sdkContext) {
|
|
53
|
+
const { elicitInput, getClientCapabilities } = notifiers;
|
|
54
|
+
if (typeof elicitInput !== 'function')
|
|
55
|
+
return;
|
|
56
|
+
// Capability check runs at request time (not registration time) so that
|
|
57
|
+
// capabilities populated during the initialize handshake are visible.
|
|
58
|
+
if (!getClientCapabilities?.()?.elicitation)
|
|
59
|
+
return;
|
|
60
|
+
const send = (params) => {
|
|
61
|
+
if (!notifiers.requestScopedElicitation)
|
|
62
|
+
return elicitInput(params);
|
|
63
|
+
return sdkContext.sendRequest({ method: 'elicitation/create', params }, ElicitResultSchema);
|
|
64
|
+
};
|
|
65
|
+
const formFn = async (msg, schema) => {
|
|
66
|
+
const requestedSchema = toJSONSchema(schema);
|
|
67
|
+
const result = await send({ mode: 'form', message: msg, requestedSchema });
|
|
68
|
+
if (notifiers.requestScopedElicitation && result.action === 'accept' && result.content) {
|
|
69
|
+
assertElicitedContent(schema, result.content);
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
};
|
|
73
|
+
const urlFn = (msg, url) => {
|
|
74
|
+
const elicitationId = crypto.randomUUID();
|
|
75
|
+
return send({ mode: 'url', message: msg, elicitationId, url });
|
|
76
|
+
};
|
|
77
|
+
const elicitFn = formFn;
|
|
78
|
+
elicitFn.url = urlFn;
|
|
79
|
+
return elicitFn;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=elicitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elicitation.js","sourceRoot":"","sources":["../../src/mcp-server/elicitation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAIL,kBAAkB,GAGnB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAoC,MAAM,KAAK,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAsBzD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA8B,EAAE,OAAgB;IACpF,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO;IAC3B,MAAM,aAAa,CAAC,mEAAmE,EAAE;QACvF,MAAM,EAAE,8BAA8B;QACtC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC1C,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CAAC;KACJ,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,UAAU,CACxB,SAA+B,EAC/B,UAAoB;IAEpB,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,GAAG,SAAS,CAAC;IACzD,IAAI,OAAO,WAAW,KAAK,UAAU;QAAE,OAAO;IAE9C,wEAAwE;IACxE,sEAAsE;IACtE,IAAI,CAAC,qBAAqB,EAAE,EAAE,EAAE,WAAW;QAAE,OAAO;IAEpD,MAAM,IAAI,GAAG,CACX,MAAwD,EACjC,EAAE;QACzB,IAAI,CAAC,SAAS,CAAC,wBAAwB;YAAE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;QACpE,OAAO,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAC9F,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,KAAK,EAAE,GAAW,EAAE,MAA8B,EAAyB,EAAE;QAC1F,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,CAA+C,CAAC;QAC3F,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC,CAAC;QAC3E,IAAI,SAAS,CAAC,wBAAwB,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACvF,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAyB,EAAE;QAChE,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAkB,CAAC;IACpC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC;IACrB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Request-spanning protocol state hooks for transports that
|
|
3
|
+
* create a fresh MCP SDK server for every request.
|
|
4
|
+
*
|
|
5
|
+
* The SDK stores negotiated capabilities and cancellation controllers on a
|
|
6
|
+
* `Server` instance. Streamable HTTP deliberately cannot reuse that instance
|
|
7
|
+
* across requests (GHSA-345p-7cg4-v4c7), so the framework carries only the
|
|
8
|
+
* minimal session state needed by handler contexts through these hooks.
|
|
9
|
+
*
|
|
10
|
+
* @module src/mcp-server/protocolSession
|
|
11
|
+
*/
|
|
12
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
|
+
import type { ClientCapabilities, RequestId } from '@modelcontextprotocol/sdk/types.js';
|
|
14
|
+
/** A cancellation signal registered for one in-flight JSON-RPC request. */
|
|
15
|
+
export interface ProtocolRequestRegistration {
|
|
16
|
+
/** Aborted when a matching `notifications/cancelled` reaches the session. */
|
|
17
|
+
signal: AbortSignal;
|
|
18
|
+
/** Removes only this registration; safe to call more than once. */
|
|
19
|
+
unregister: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* State restored onto a per-request server from its durable HTTP session.
|
|
23
|
+
* Undefined for stdio and stateless HTTP, where no cross-request restoration
|
|
24
|
+
* is necessary or possible.
|
|
25
|
+
*/
|
|
26
|
+
export interface ProtocolSessionHooks {
|
|
27
|
+
/** Capabilities captured from the successful initialize request. */
|
|
28
|
+
clientCapabilities?: ClientCapabilities;
|
|
29
|
+
/** Registers a tool/resource request for cross-request cancellation. */
|
|
30
|
+
registerRequest?: (requestId: RequestId) => ProtocolRequestRegistration;
|
|
31
|
+
}
|
|
32
|
+
/** Factory shared by stdio (no hooks) and per-request HTTP servers. */
|
|
33
|
+
export type McpServerFactory = (session?: ProtocolSessionHooks) => Promise<McpServer>;
|
|
34
|
+
//# sourceMappingURL=protocolSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolSession.d.ts","sourceRoot":"","sources":["../../src/mcp-server/protocolSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAExF,2EAA2E;AAC3E,MAAM,WAAW,2BAA2B;IAC1C,6EAA6E;IAC7E,MAAM,EAAE,WAAW,CAAC;IACpB,mEAAmE;IACnE,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,wEAAwE;IACxE,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,2BAA2B,CAAC;CACzE;AAED,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Request-spanning protocol state hooks for transports that
|
|
3
|
+
* create a fresh MCP SDK server for every request.
|
|
4
|
+
*
|
|
5
|
+
* The SDK stores negotiated capabilities and cancellation controllers on a
|
|
6
|
+
* `Server` instance. Streamable HTTP deliberately cannot reuse that instance
|
|
7
|
+
* across requests (GHSA-345p-7cg4-v4c7), so the framework carries only the
|
|
8
|
+
* minimal session state needed by handler contexts through these hooks.
|
|
9
|
+
*
|
|
10
|
+
* @module src/mcp-server/protocolSession
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=protocolSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolSession.js","sourceRoot":"","sources":["../../src/mcp-server/protocolSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module src/mcp-server/resources/resource-registration
|
|
4
4
|
*/
|
|
5
5
|
import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
+
import type { ProtocolSessionHooks } from '../../mcp-server/protocolSession.js';
|
|
6
7
|
import type { AnyResourceDefinition } from '../../mcp-server/resources/utils/resourceDefinition.js';
|
|
7
8
|
import { type ResourceHandlerFactoryServices } from '../../mcp-server/resources/utils/resourceHandlerFactory.js';
|
|
8
9
|
export declare class ResourceRegistry {
|
|
@@ -14,7 +15,7 @@ export declare class ResourceRegistry {
|
|
|
14
15
|
/**
|
|
15
16
|
* Registers all resolved resource definitions with the provided McpServer instance.
|
|
16
17
|
*/
|
|
17
|
-
registerAll(server: McpServer): Promise<void>;
|
|
18
|
+
registerAll(server: McpServer, protocolSession?: ProtocolSessionHooks): Promise<void>;
|
|
18
19
|
/** Throws at startup if a resource with the same name was already registered. */
|
|
19
20
|
private assertUniqueName;
|
|
20
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,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;IAErD,YACU,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B,EAC9C;IAEJ;;OAEG;IACU,WAAW,
|
|
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,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,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;IAErD,YACU,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B,EAC9C;IAEJ;;OAEG;IACU,WAAW,CACtB,MAAM,EAAE,SAAS,EACjB,eAAe,CAAC,EAAE,oBAAoB,GACrC,OAAO,CAAC,IAAI,CAAC,CAoCf;IAED,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAqD/B"}
|
|
@@ -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) {
|
|
26
|
+
async registerAll(server, protocolSession) {
|
|
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
|
|
@@ -32,11 +32,15 @@ export class ResourceRegistry {
|
|
|
32
32
|
// only when a request has no notification sender.
|
|
33
33
|
const notifiers = {
|
|
34
34
|
elicitInput: (params) => server.server.elicitInput(params),
|
|
35
|
-
getClientCapabilities: () => server.server.getClientCapabilities(),
|
|
35
|
+
getClientCapabilities: () => protocolSession?.clientCapabilities ?? server.server.getClientCapabilities(),
|
|
36
36
|
notifyPromptListChanged: () => server.sendPromptListChanged(),
|
|
37
37
|
notifyResourceListChanged: () => server.sendResourceListChanged(),
|
|
38
38
|
notifyResourceUpdated: (uri) => server.server.sendResourceUpdated({ uri }),
|
|
39
39
|
notifyToolListChanged: () => server.sendToolListChanged(),
|
|
40
|
+
requestScopedElicitation: protocolSession !== undefined,
|
|
41
|
+
...(protocolSession?.registerRequest && {
|
|
42
|
+
registerRequest: protocolSession.registerRequest,
|
|
43
|
+
}),
|
|
40
44
|
};
|
|
41
45
|
const context = requestContextService.createRequestContext({
|
|
42
46
|
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,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"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"}
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
7
7
|
import type { Variables } from '@modelcontextprotocol/sdk/shared/uriTemplate.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type { ReadResourceResult, ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
+
import { type ElicitationNotifiers } from '../../../mcp-server/elicitation.js';
|
|
10
|
+
import type { ProtocolRequestRegistration } from '../../../mcp-server/protocolSession.js';
|
|
9
11
|
import type { AnyResourceDefinition } from '../../../mcp-server/resources/utils/resourceDefinition.js';
|
|
10
12
|
import type { StorageService } from '../../../storage/core/StorageService.js';
|
|
11
13
|
import type { Logger } from '../../../utils/internal/logger.js';
|
|
@@ -34,22 +36,15 @@ export interface ResourceHandlerFactoryServices {
|
|
|
34
36
|
* ({@link buildRequestScopedNotifiers}, #135) and uses these only as a fallback
|
|
35
37
|
* when the SDK extra exposes no sender (e.g. a non-request test scope).
|
|
36
38
|
*
|
|
37
|
-
*
|
|
38
|
-
* the per-server `Server` instance so `wrapElicit` can gate `ctx.elicit` on
|
|
39
|
-
* the client's advertised capability and forward elicitation requests on the
|
|
40
|
-
* wire.
|
|
39
|
+
* The elicitation fields come from {@link ElicitationNotifiers}.
|
|
41
40
|
*/
|
|
42
|
-
export interface ResourceHandlerNotifiers {
|
|
43
|
-
/** Bound to `server.server.elicitInput.bind(server.server)`. */
|
|
44
|
-
elicitInput?: (params: ElicitRequestFormParams | ElicitRequestURLParams) => Promise<ElicitResult>;
|
|
45
|
-
/** Bound to `server.server.getClientCapabilities.bind(server.server)`. */
|
|
46
|
-
getClientCapabilities?: () => {
|
|
47
|
-
elicitation?: unknown;
|
|
48
|
-
} | undefined;
|
|
41
|
+
export interface ResourceHandlerNotifiers extends ElicitationNotifiers {
|
|
49
42
|
notifyPromptListChanged?: () => void;
|
|
50
43
|
notifyResourceListChanged?: () => void;
|
|
51
44
|
notifyResourceUpdated?: (uri: string) => void;
|
|
52
45
|
notifyToolListChanged?: () => void;
|
|
46
|
+
/** Registers this handler invocation for session-scoped HTTP cancellation. */
|
|
47
|
+
registerRequest?: (requestId: SdkExtra['requestId']) => ProtocolRequestRegistration;
|
|
53
48
|
}
|
|
54
49
|
/**
|
|
55
50
|
* Creates an MCP resource read handler from a resource definition.
|