@cyanheads/mcp-ts-core 0.11.5 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +27 -23
- package/CLAUDE.md +27 -23
- package/README.md +10 -10
- package/biome.json +1 -1
- package/changelog/0.12.x/0.12.0.md +96 -0
- package/dist/cli/init.js +1 -1
- package/dist/cli/init.js.map +1 -1
- package/dist/config/index.d.ts +0 -18
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +0 -25
- package/dist/config/index.js.map +1 -1
- package/dist/core/app.d.ts +5 -7
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/app.js +18 -27
- package/dist/core/app.js.map +1 -1
- package/dist/core/context.d.ts +90 -57
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +32 -33
- package/dist/core/context.js.map +1 -1
- package/dist/core/gcPressure.d.ts.map +1 -1
- package/dist/core/gcPressure.js +3 -4
- package/dist/core/gcPressure.js.map +1 -1
- package/dist/core/index.d.ts +6 -7
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +10 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/serverManifest.d.ts +1 -3
- package/dist/core/serverManifest.d.ts.map +1 -1
- package/dist/core/serverManifest.js +9 -4
- package/dist/core/serverManifest.js.map +1 -1
- package/dist/core/worker.d.ts.map +1 -1
- package/dist/core/worker.js +32 -35
- package/dist/core/worker.js.map +1 -1
- package/dist/logs/combined.log +10 -22
- package/dist/logs/error.log +6 -18
- package/dist/mcp-server/inputRequired.d.ts +52 -0
- package/dist/mcp-server/inputRequired.d.ts.map +1 -0
- package/dist/mcp-server/inputRequired.js +76 -0
- package/dist/mcp-server/inputRequired.js.map +1 -0
- package/dist/mcp-server/notifications.d.ts +33 -31
- package/dist/mcp-server/notifications.d.ts.map +1 -1
- package/dist/mcp-server/notifications.js +34 -26
- package/dist/mcp-server/notifications.js.map +1 -1
- package/dist/mcp-server/prompts/prompt-registration.d.ts +2 -2
- package/dist/mcp-server/prompts/prompt-registration.d.ts.map +1 -1
- package/dist/mcp-server/prompts/prompt-registration.js +15 -5
- package/dist/mcp-server/prompts/prompt-registration.js.map +1 -1
- package/dist/mcp-server/prompts/utils/promptDefinition.d.ts +1 -1
- package/dist/mcp-server/prompts/utils/promptDefinition.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.d.ts +3 -3
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.js +8 -15
- package/dist/mcp-server/resources/resource-registration.js.map +1 -1
- package/dist/mcp-server/resources/resourceSubscriptions.d.ts +45 -0
- package/dist/mcp-server/resources/resourceSubscriptions.d.ts.map +1 -0
- package/dist/mcp-server/resources/resourceSubscriptions.js +51 -0
- package/dist/mcp-server/resources/resourceSubscriptions.js.map +1 -0
- package/dist/mcp-server/resources/utils/resourceDefinition.d.ts +3 -5
- package/dist/mcp-server/resources/utils/resourceDefinition.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceDefinition.js +1 -1
- package/dist/mcp-server/resources/utils/resourceDefinition.js.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +8 -15
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +21 -22
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
- package/dist/mcp-server/server.d.ts +12 -21
- package/dist/mcp-server/server.d.ts.map +1 -1
- package/dist/mcp-server/server.js +38 -28
- package/dist/mcp-server/server.js.map +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts +11 -33
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-registration.js +17 -243
- package/dist/mcp-server/tools/tool-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolDefinition.d.ts +1 -3
- package/dist/mcp-server/tools/utils/toolDefinition.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolDefinition.js +48 -1
- package/dist/mcp-server/tools/utils/toolDefinition.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +46 -20
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +131 -25
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/mcp-server/transports/ITransport.d.ts +2 -2
- package/dist/mcp-server/transports/ITransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/auth/authFactory.js +1 -1
- package/dist/mcp-server/transports/auth/authFactory.js.map +1 -1
- package/dist/mcp-server/transports/auth/lib/authTypes.d.ts +1 -1
- package/dist/mcp-server/transports/auth/lib/authTypes.d.ts.map +1 -1
- package/dist/mcp-server/transports/auth/lib/authUtils.d.ts.map +1 -1
- package/dist/mcp-server/transports/auth/lib/authUtils.js +5 -13
- package/dist/mcp-server/transports/auth/lib/authUtils.js.map +1 -1
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.js +5 -11
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.js.map +1 -1
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.d.ts.map +1 -1
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.js +9 -22
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.js.map +1 -1
- package/dist/mcp-server/transports/heartbeat.d.ts.map +1 -1
- package/dist/mcp-server/transports/heartbeat.js +4 -8
- package/dist/mcp-server/transports/heartbeat.js.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js +6 -24
- package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -1
- package/dist/mcp-server/transports/http/httpServer.d.ts +3 -3
- package/dist/mcp-server/transports/http/httpServer.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpServer.js +15 -32
- package/dist/mcp-server/transports/http/httpServer.js.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.d.ts +25 -8
- package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.js +156 -373
- package/dist/mcp-server/transports/http/httpTransport.js.map +1 -1
- package/dist/mcp-server/transports/http/landing-page/assets/styles.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/landing-page/assets/styles.js +0 -1
- package/dist/mcp-server/transports/http/landing-page/assets/styles.js.map +1 -1
- package/dist/mcp-server/transports/http/landing-page/handler.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/landing-page/handler.js +4 -8
- package/dist/mcp-server/transports/http/landing-page/handler.js.map +1 -1
- package/dist/mcp-server/transports/http/landing-page/sections/tools.js +0 -2
- package/dist/mcp-server/transports/http/landing-page/sections/tools.js.map +1 -1
- package/dist/mcp-server/transports/http/protectedResourceMetadata.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/protectedResourceMetadata.js +2 -6
- package/dist/mcp-server/transports/http/protectedResourceMetadata.js.map +1 -1
- package/dist/mcp-server/transports/http/robotsTxt.js +2 -2
- package/dist/mcp-server/transports/http/robotsTxt.js.map +1 -1
- package/dist/mcp-server/transports/http/serverCard.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/serverCard.js +2 -6
- package/dist/mcp-server/transports/http/serverCard.js.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.d.ts +46 -66
- package/dist/mcp-server/transports/http/sessionStore.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.js +140 -238
- package/dist/mcp-server/transports/http/sessionStore.js.map +1 -1
- package/dist/mcp-server/transports/manager.d.ts +12 -4
- package/dist/mcp-server/transports/manager.d.ts.map +1 -1
- package/dist/mcp-server/transports/manager.js +35 -33
- package/dist/mcp-server/transports/manager.js.map +1 -1
- package/dist/mcp-server/transports/stdio/stdioTransport.d.ts +24 -31
- package/dist/mcp-server/transports/stdio/stdioTransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/stdio/stdioTransport.js +23 -38
- package/dist/mcp-server/transports/stdio/stdioTransport.js.map +1 -1
- package/dist/mcp-server/types.d.ts +25 -0
- package/dist/mcp-server/types.d.ts.map +1 -0
- package/dist/mcp-server/types.js +10 -0
- package/dist/mcp-server/types.js.map +1 -0
- package/dist/services/canvas/core/CanvasInstance.d.ts +2 -2
- package/dist/services/canvas/core/CanvasInstance.d.ts.map +1 -1
- package/dist/services/canvas/core/CanvasInstance.js.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.d.ts +4 -4
- package/dist/services/canvas/core/CanvasRegistry.d.ts.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.js +8 -18
- package/dist/services/canvas/core/CanvasRegistry.js.map +1 -1
- package/dist/services/canvas/core/DataCanvas.d.ts +5 -5
- package/dist/services/canvas/core/DataCanvas.d.ts.map +1 -1
- package/dist/services/canvas/core/DataCanvas.js +2 -3
- package/dist/services/canvas/core/DataCanvas.js.map +1 -1
- package/dist/services/canvas/core/IDataCanvasProvider.d.ts +11 -11
- package/dist/services/canvas/core/IDataCanvasProvider.d.ts.map +1 -1
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.d.ts +11 -11
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.d.ts.map +1 -1
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.js +4 -10
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.js.map +1 -1
- package/dist/services/llm/providers/openrouter.provider.d.ts.map +1 -1
- package/dist/services/llm/providers/openrouter.provider.js +2 -5
- package/dist/services/llm/providers/openrouter.provider.js.map +1 -1
- package/dist/services/mirror/core/defineMirror.js +1 -1
- package/dist/services/mirror/core/defineMirror.js.map +1 -1
- package/dist/services/mirror/types.d.ts +5 -5
- package/dist/services/mirror/types.d.ts.map +1 -1
- package/dist/services/speech/providers/elevenlabs.provider.js +1 -1
- package/dist/services/speech/providers/elevenlabs.provider.js.map +1 -1
- package/dist/services/speech/providers/whisper.provider.js +1 -1
- package/dist/services/speech/providers/whisper.provider.js.map +1 -1
- package/dist/storage/core/StorageService.d.ts +1 -1
- package/dist/storage/core/StorageService.d.ts.map +1 -1
- package/dist/storage/core/StorageService.js +12 -20
- package/dist/storage/core/StorageService.js.map +1 -1
- package/dist/storage/core/storageFactory.d.ts.map +1 -1
- package/dist/storage/core/storageFactory.js.map +1 -1
- package/dist/storage/core/storageValidation.d.ts +1 -1
- package/dist/storage/core/storageValidation.d.ts.map +1 -1
- package/dist/storage/core/storageValidation.js +2 -2
- package/dist/storage/core/storageValidation.js.map +1 -1
- package/dist/storage/providers/cloudflare/d1Provider.d.ts +1 -1
- package/dist/storage/providers/cloudflare/d1Provider.d.ts.map +1 -1
- package/dist/storage/providers/cloudflare/d1Provider.js +4 -12
- package/dist/storage/providers/cloudflare/d1Provider.js.map +1 -1
- package/dist/storage/providers/cloudflare/kvProvider.d.ts +1 -1
- package/dist/storage/providers/cloudflare/kvProvider.d.ts.map +1 -1
- package/dist/storage/providers/cloudflare/kvProvider.js +3 -8
- package/dist/storage/providers/cloudflare/kvProvider.js.map +1 -1
- package/dist/storage/providers/cloudflare/r2Provider.d.ts +1 -1
- package/dist/storage/providers/cloudflare/r2Provider.d.ts.map +1 -1
- package/dist/storage/providers/cloudflare/r2Provider.js +3 -8
- package/dist/storage/providers/cloudflare/r2Provider.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 +2 -4
- package/dist/storage/providers/inMemory/inMemoryProvider.js.map +1 -1
- package/dist/testing/index.d.ts +35 -12
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +53 -38
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/vitest.d.ts +1 -1
- package/dist/testing/vitest.d.ts.map +1 -1
- package/dist/types-global/errors.d.ts +28 -15
- package/dist/types-global/errors.d.ts.map +1 -1
- package/dist/types-global/errors.js +8 -1
- package/dist/types-global/errors.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 +7 -20
- 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 +6 -17
- 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 +5 -18
- package/dist/utils/formatting/treeFormatter.js.map +1 -1
- package/dist/utils/index.d.ts +4 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts +1 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.js +23 -11
- package/dist/utils/internal/error-handler/errorHandler.js.map +1 -1
- package/dist/utils/internal/error-handler/types.d.ts +10 -13
- package/dist/utils/internal/error-handler/types.d.ts.map +1 -1
- package/dist/utils/internal/logger.d.ts +3 -3
- package/dist/utils/internal/logger.d.ts.map +1 -1
- package/dist/utils/internal/logger.js +11 -5
- package/dist/utils/internal/logger.js.map +1 -1
- package/dist/utils/internal/performance.d.ts +1 -1
- package/dist/utils/internal/performance.d.ts.map +1 -1
- package/dist/utils/internal/performance.js +57 -13
- package/dist/utils/internal/performance.js.map +1 -1
- package/dist/utils/internal/requestContext.d.ts +79 -55
- package/dist/utils/internal/requestContext.d.ts.map +1 -1
- package/dist/utils/internal/requestContext.js +77 -32
- package/dist/utils/internal/requestContext.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 +2 -2
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -1
- package/dist/utils/network/fetchWithTimeout.js +8 -24
- package/dist/utils/network/fetchWithTimeout.js.map +1 -1
- package/dist/utils/network/retry.d.ts +2 -2
- package/dist/utils/network/retry.d.ts.map +1 -1
- package/dist/utils/overflow/outlineOnOverflow.d.ts +1 -1
- package/dist/utils/overflow/outlineOnOverflow.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 +3 -3
- 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 +4 -8
- package/dist/utils/parsing/csvParser.js.map +1 -1
- package/dist/utils/parsing/dateParser.d.ts +3 -3
- package/dist/utils/parsing/dateParser.d.ts.map +1 -1
- package/dist/utils/parsing/dateParser.js +3 -2
- package/dist/utils/parsing/dateParser.js.map +1 -1
- package/dist/utils/parsing/frontmatterParser.d.ts +2 -2
- package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -1
- package/dist/utils/parsing/frontmatterParser.js +7 -10
- package/dist/utils/parsing/frontmatterParser.js.map +1 -1
- package/dist/utils/parsing/htmlExtractor.d.ts +2 -2
- package/dist/utils/parsing/htmlExtractor.d.ts.map +1 -1
- package/dist/utils/parsing/htmlExtractor.js +6 -11
- package/dist/utils/parsing/htmlExtractor.js.map +1 -1
- package/dist/utils/parsing/jsonParser.d.ts +2 -2
- package/dist/utils/parsing/jsonParser.d.ts.map +1 -1
- package/dist/utils/parsing/jsonParser.js +4 -8
- package/dist/utils/parsing/jsonParser.js.map +1 -1
- package/dist/utils/parsing/pdfParser.d.ts +10 -10
- package/dist/utils/parsing/pdfParser.d.ts.map +1 -1
- package/dist/utils/parsing/pdfParser.js +26 -89
- package/dist/utils/parsing/pdfParser.js.map +1 -1
- package/dist/utils/parsing/xmlParser.d.ts +2 -2
- package/dist/utils/parsing/xmlParser.d.ts.map +1 -1
- package/dist/utils/parsing/xmlParser.js +4 -8
- package/dist/utils/parsing/xmlParser.js.map +1 -1
- package/dist/utils/parsing/yamlParser.d.ts +2 -2
- package/dist/utils/parsing/yamlParser.d.ts.map +1 -1
- package/dist/utils/parsing/yamlParser.js +4 -8
- package/dist/utils/parsing/yamlParser.js.map +1 -1
- package/dist/utils/scheduling/scheduler.d.ts.map +1 -1
- package/dist/utils/scheduling/scheduler.js +5 -6
- package/dist/utils/scheduling/scheduler.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/attributes.d.ts +23 -7
- package/dist/utils/telemetry/attributes.d.ts.map +1 -1
- package/dist/utils/telemetry/attributes.js +23 -10
- package/dist/utils/telemetry/attributes.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 +4 -2
- package/dist/utils/telemetry/trace.js.map +1 -1
- package/package.json +22 -26
- package/scripts/lint-mcp.ts +1 -3
- package/scripts/lint-packaging.ts +1 -1
- package/skills/add-service/SKILL.md +2 -2
- package/skills/add-test/SKILL.md +42 -20
- package/skills/add-tool/SKILL.md +68 -19
- package/skills/api-config/SKILL.md +1 -11
- package/skills/api-context/SKILL.md +175 -111
- package/skills/api-linter/SKILL.md +2 -2
- package/skills/api-telemetry/SKILL.md +8 -12
- package/skills/api-testing/SKILL.md +53 -52
- package/skills/code-simplifier/SKILL.md +2 -2
- package/skills/design-mcp-server/SKILL.md +31 -17
- package/skills/field-test/SKILL.md +4 -2
- package/skills/polish-docs-meta/SKILL.md +1 -1
- package/skills/polish-docs-meta/references/agent-protocol.md +2 -2
- package/skills/polish-docs-meta/references/readme.md +1 -1
- package/skills/release-and-publish/SKILL.md +3 -1
- package/skills/report-issue-framework/SKILL.md +2 -2
- package/skills/report-issue-local/SKILL.md +2 -2
- package/skills/security-pass/SKILL.md +16 -14
- package/templates/AGENTS.md +6 -6
- package/templates/CLAUDE.md +6 -6
- package/templates/tests/resources/echo.resource.test.ts +16 -9
- package/dist/mcp-server/elicitation.d.ts +0 -64
- package/dist/mcp-server/elicitation.d.ts.map +0 -1
- package/dist/mcp-server/elicitation.js +0 -81
- package/dist/mcp-server/elicitation.js.map +0 -1
- package/dist/mcp-server/protocolSession.d.ts +0 -34
- package/dist/mcp-server/protocolSession.d.ts.map +0 -1
- package/dist/mcp-server/protocolSession.js +0 -13
- package/dist/mcp-server/protocolSession.js.map +0 -1
- package/dist/mcp-server/tasks/core/evictingTaskMessageQueue.d.ts +0 -53
- package/dist/mcp-server/tasks/core/evictingTaskMessageQueue.d.ts.map +0 -1
- package/dist/mcp-server/tasks/core/evictingTaskMessageQueue.js +0 -65
- package/dist/mcp-server/tasks/core/evictingTaskMessageQueue.js.map +0 -1
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.d.ts +0 -70
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.d.ts.map +0 -1
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.js +0 -130
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.js.map +0 -1
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.d.ts +0 -109
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.d.ts.map +0 -1
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.js +0 -209
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.js.map +0 -1
- package/dist/mcp-server/tasks/core/taskManager.d.ts +0 -91
- package/dist/mcp-server/tasks/core/taskManager.d.ts.map +0 -1
- package/dist/mcp-server/tasks/core/taskManager.js +0 -210
- package/dist/mcp-server/tasks/core/taskManager.js.map +0 -1
- package/dist/mcp-server/tasks/core/taskTypes.d.ts +0 -18
- package/dist/mcp-server/tasks/core/taskTypes.d.ts.map +0 -1
- package/dist/mcp-server/tasks/core/taskTypes.js +0 -20
- package/dist/mcp-server/tasks/core/taskTypes.js.map +0 -1
- package/dist/mcp-server/tasks/utils/taskToolDefinition.d.ts +0 -101
- package/dist/mcp-server/tasks/utils/taskToolDefinition.d.ts.map +0 -1
- package/dist/mcp-server/tasks/utils/taskToolDefinition.js +0 -14
- package/dist/mcp-server/tasks/utils/taskToolDefinition.js.map +0 -1
package/dist/logs/error.log
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
{"level":50,"time":
|
|
2
|
-
{"level":50,"time":
|
|
3
|
-
{"level":50,"time":
|
|
4
|
-
{"level":50,"time":
|
|
5
|
-
{"level":50,"time":
|
|
6
|
-
{"level":50,"time":
|
|
7
|
-
{"level":50,"time":1786587230922,"env":"testing","version":"0.0.0-test","pid":55943,"requestId":"5X7AN-6XKAS","timestamp":"2026-08-13T02:13:50.918Z","operation":"HandleToolRequest","critical":false,"errorCode":-32602,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"1e6b675822dbe8b61a4020e2582bc88c5937b1e1afd9003e8d2145d6c92ca457","toolName":"session_elicitation_probe","errorData":{"reason":"elicitation_response_invalid","issues":[{"path":"value","code":"invalid_type"}],"sessionId":"1e6b675822dbe8b61a4020e2582bc88c5937b1e1afd9003e8d2145d6c92ca457","toolName":"session_elicitation_probe","requestId":"5X7AN-6XKAS","timestamp":"2026-08-13T02:13:50.918Z","operation":"HandleToolRequest","originalErrorName":"McpError","originalMessage":"Elicitation response content does not match the requested schema.","originalStack":"McpError: Elicitation response content does not match the requested schema.\n at invalidParams (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:78:58)\n at assertElicitedContent (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/elicitation.js:26:11)\n at Object.formFn [as elicit] (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/elicitation.js:69:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/http-protocol-session-server.js:50:20)\n at async file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/performance.js:212:28\n at async measureToolExecution (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/performance.js:194:12)\n at async file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:306:28\n at async McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:20)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:32"},"stack":"McpError: Elicitation response content does not match the requested schema.\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:334:26\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:20)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:32\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:session_elicitation_probe: Elicitation response content does not match the requested schema."}
|
|
8
|
-
{"level":50,"time":1786587230935,"env":"testing","version":"0.0.0-test","pid":55943,"requestId":"0J4GZ-52X01","timestamp":"2026-08-13T02:13:50.931Z","operation":"HandleToolRequest","critical":false,"errorCode":-32603,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"06ba48d957a5497eebd1bcdc46f35f99c8c46e65439e3035231c2717e2f15e3f","toolName":"session_elicitation_probe","errorData":{"sessionId":"06ba48d957a5497eebd1bcdc46f35f99c8c46e65439e3035231c2717e2f15e3f","toolName":"session_elicitation_probe","requestId":"0J4GZ-52X01","timestamp":"2026-08-13T02:13:50.931Z","operation":"HandleToolRequest","originalErrorName":"McpError","originalMessage":"MCP error -32602: Client refused the elicitation request.","originalStack":"McpError: MCP error -32602: Client refused the elicitation request.\n at McpError.fromError (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js:2048:16)\n at Server._onresponse (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:490:36)\n at _transport.onmessage (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:234:22)\n at Object.deliver (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:55:29)\n at SessionStore.routeServerResponse (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/sessionStore.js:208:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:626:38\n at Array.filter (<anonymous>)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:623:39\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async dispatch (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:17)"},"stack":"McpError: MCP error -32602: Client refused the elicitation request.\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:334:26\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:20)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:32\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:session_elicitation_probe: MCP error -32602: Client refused the elicitation request."}
|
|
9
|
-
{"level":50,"time":1786587231021,"env":"testing","version":"0.0.0-test","pid":55943,"requestId":"IKG5Z-ZRC90","timestamp":"2026-08-13T02:13:51.017Z","operation":"HandleToolRequest","critical":false,"errorCode":-32004,"originalErrorType":"AbortError","finalErrorType":"McpError","sessionId":"9cfa68fd06bea3003fbcdae970efafd4b54ea5b49bc2bfe9a888099e37741295","toolName":"session_cancellable_tool","errorData":{"sessionId":"9cfa68fd06bea3003fbcdae970efafd4b54ea5b49bc2bfe9a888099e37741295","toolName":"session_cancellable_tool","requestId":"IKG5Z-ZRC90","timestamp":"2026-08-13T02:13:51.017Z","operation":"HandleToolRequest","originalErrorName":"AbortError","originalMessage":"AbortError: cancel tool request","originalStack":"AbortError: AbortError: cancel tool request\n at new DOMException (node:internal/per_context/domexception:79:18)\n at SessionStore.cancelRequest (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/sessionStore.js:166:29)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:644:30\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async dispatch (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:17)\n at async file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:358:20\n at async dispatch (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:17)\n at async file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:312:16\n at async dispatch (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:17)\n at async cors2 (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:76:5)"},"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:178:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:334:26\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:20)\n at async file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:32\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:session_cancellable_tool: AbortError: cancel tool request"}
|
|
10
|
-
{"level":50,"time":1786587241316,"env":"testing","version":"0.0.0-test","pid":56023,"requestId":"61be143c-7657-453e-9110-30352866c484","timestamp":"2026-08-13T02:14:01.316Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"ee8662227fa5467d4a1a989958fdfc01","toolName":"auto_echo","errorData":{"taskId":"ee8662227fa5467d4a1a989958fdfc01","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"}
|
|
11
|
-
{"level":50,"time":1786587248382,"env":"testing","version":"0.0.0-test","pid":56023,"requestId":"3dfac909-5392-47a9-88e8-60d1aac7998d","timestamp":"2026-08-13T02:14:08.381Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"3ee3f4f482e0a099831113580b27ae78","toolName":"long_control","errorData":{"taskId":"3ee3f4f482e0a099831113580b27ae78","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)"}
|
|
12
|
-
{"level":50,"time":1786587249679,"env":"testing","version":"0.0.0-test","pid":56062,"requestId":"30fc1d93-3755-4a5b-8c10-7950ed90a37e","timestamp":"2026-08-13T02:14:09.678Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"bdbb37189f0f574e0ba253b84fe59eb3","toolName":"auto_echo","errorData":{"taskId":"bdbb37189f0f574e0ba253b84fe59eb3","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"}
|
|
13
|
-
{"level":50,"time":1786587256826,"env":"testing","version":"0.0.0-test","pid":56062,"requestId":"d6aebeb6-8df3-41da-9c88-8245392951f5","timestamp":"2026-08-13T02:14:16.825Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"1dc5de9df5f2813bc528625ebcb26f02","toolName":"long_control","errorData":{"taskId":"1dc5de9df5f2813bc528625ebcb26f02","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)"}
|
|
14
|
-
{"level":50,"time":1786587260986,"env":"testing","version":"0.0.0-test","pid":56135,"requestId":"1O3E3-DP8AC","timestamp":"2026-08-13T02:14:20.986Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"0a72407c6557c4b3a331a8213ac870a88349344596bf8981a51db854f105e588","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"0a72407c6557c4b3a331a8213ac870a88349344596bf8981a51db854f105e588","toolName":"scoped_echo","requestId":"1O3E3-DP8AC","timestamp":"2026-08-13T02:14:20.986Z","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:285: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:334: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."}
|
|
15
|
-
{"level":50,"time":1786587260994,"env":"testing","version":"0.0.0-test","pid":56135,"requestId":"CBMKP-O20TK","timestamp":"2026-08-13T02:14:20.994Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"9b0f4cf27f3fc78bc5d7e088047c8fc5204c88edcb5b4d9f03380a5e2684e9ca","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":"9b0f4cf27f3fc78bc5d7e088047c8fc5204c88edcb5b4d9f03380a5e2684e9ca","toolName":"scoped_echo","requestId":"CBMKP-O20TK","timestamp":"2026-08-13T02:14:20.994Z","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:285: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:334: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":1786587262572,"env":"testing","version":"0.0.0-test","pid":56148,"requestId":"RXKXK-ZNGJF","timestamp":"2026-08-13T02:14:22.569Z","operation":"HandleToolRequest","critical":false,"errorCode":-32602,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"6d95cfc46799cee8ec354ea235bbc0047af16776fd1d30ebd05272161da3b9ff","toolName":"session_elicitation_probe","errorData":{"reason":"elicitation_response_invalid","issues":[{"path":"value","code":"invalid_type"}],"sessionId":"6d95cfc46799cee8ec354ea235bbc0047af16776fd1d30ebd05272161da3b9ff","toolName":"session_elicitation_probe","requestId":"RXKXK-ZNGJF","timestamp":"2026-08-13T02:14:22.569Z","operation":"HandleToolRequest","originalErrorName":"McpError","originalMessage":"Elicitation response content does not match the requested schema.","originalStack":"McpError: Elicitation response content does not match the requested schema.\n at invalidParams (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:78:62)\n at assertElicitedContent (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/elicitation.js:26:11)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/elicitation.js:69:13)\n at async handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/http-protocol-session-server.js:50:30)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/performance.js:212:34)\n at async measureToolExecution (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/performance.js:194:25)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:306:34)\n at async executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:34)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:46)"},"stack":"McpError: Elicitation response content does not match the requested schema.\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:334:26)\n at async executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:34)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:46)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_elicitation_probe: Elicitation response content does not match the requested schema."}
|
|
17
|
-
{"level":50,"time":1786587262580,"env":"testing","version":"0.0.0-test","pid":56148,"requestId":"X47C9-0LGGG","timestamp":"2026-08-13T02:14:22.578Z","operation":"HandleToolRequest","critical":false,"errorCode":-32603,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"f50b3cf6fc2f019ba54811c9b2aa89309eec20d4c11220d01ef05a4e5edad963","toolName":"session_elicitation_probe","errorData":{"sessionId":"f50b3cf6fc2f019ba54811c9b2aa89309eec20d4c11220d01ef05a4e5edad963","toolName":"session_elicitation_probe","requestId":"X47C9-0LGGG","timestamp":"2026-08-13T02:14:22.578Z","operation":"HandleToolRequest","originalErrorName":"McpError","originalMessage":"MCP error -32602: Client refused the elicitation request.","originalStack":"McpError: MCP error -32602: Client refused the elicitation request.\n at fromError (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js:2048:20)\n at _onresponse (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:490:36)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:234:22)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:55:18)\n at routeServerResponse (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/sessionStore.js:208:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:626:38)\n at filter (native:1:11)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:623:39)\n at async dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:358:26)\n at async dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:312:22)\n at async dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at async cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:76:11)\n at async dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/hono-base.js:307:31)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: MCP error -32602: Client refused the elicitation request.\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:334:26)\n at async executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:34)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:46)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_elicitation_probe: MCP error -32602: Client refused the elicitation request."}
|
|
18
|
-
{"level":50,"time":1786587262653,"env":"testing","version":"0.0.0-test","pid":56148,"requestId":"5KYGH-LMTHY","timestamp":"2026-08-13T02:14:22.651Z","operation":"HandleToolRequest","critical":false,"errorCode":-32004,"originalErrorType":"AbortError","finalErrorType":"McpError","sessionId":"3d74267a99633ef41a291060a6a52f06aa50143237ad9d1dc58aab9f50d0ae34","toolName":"session_cancellable_tool","errorData":{"sessionId":"3d74267a99633ef41a291060a6a52f06aa50143237ad9d1dc58aab9f50d0ae34","toolName":"session_cancellable_tool","requestId":"5KYGH-LMTHY","timestamp":"2026-08-13T02:14:22.651Z","operation":"HandleToolRequest","originalErrorName":"AbortError","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:178:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:334:26)\n at async executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:34)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at async <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:46)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:session_cancellable_tool: AbortError: cancel tool request"}
|
|
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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Multi-round-trip input plumbing shared by the tool, resource,
|
|
3
|
+
* and prompt handler factories (MCP protocol revision 2026-07-28).
|
|
4
|
+
*
|
|
5
|
+
* The 2025 push model — `await ctx.elicit(...)` mid-handler over a
|
|
6
|
+
* server-to-client request — has no channel on the 2026-07-28 wire. A handler
|
|
7
|
+
* now *returns* `inputRequired(...)` and is re-entered with the collected
|
|
8
|
+
* `inputResponses`. Framework handlers are pure functions returning a domain
|
|
9
|
+
* output, so the return path is expressed as a thrown {@link InputRequiredSignal}
|
|
10
|
+
* that each handler factory catches and converts back into the SDK's
|
|
11
|
+
* `input_required` result.
|
|
12
|
+
*
|
|
13
|
+
* One surface serves both eras: the SDK's legacy shim
|
|
14
|
+
* (`ServerOptions.inputRequired.legacyShim`, on by default) fulfils the same
|
|
15
|
+
* returns against 2025-era clients by issuing real `elicitation/create` /
|
|
16
|
+
* `sampling/createMessage` / `roots/list` requests and re-entering the handler.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr | MCP Multi-Round-Trip Requests}
|
|
19
|
+
* @module src/mcp-server/inputRequired
|
|
20
|
+
*/
|
|
21
|
+
import { type InputRequiredResult, type InputRequiredSpec, type ServerContext } from '@modelcontextprotocol/server';
|
|
22
|
+
import type { ContextInputs } from '../core/context.js';
|
|
23
|
+
/**
|
|
24
|
+
* Thrown by `ctx.requestInput(...)` and caught by the handler factories, which
|
|
25
|
+
* return the carried `input_required` result to the SDK instead of a normal
|
|
26
|
+
* tool/resource/prompt result.
|
|
27
|
+
*
|
|
28
|
+
* Not an {@link McpError}: it is protocol control flow, not a failure, and must
|
|
29
|
+
* bypass the error classifier entirely.
|
|
30
|
+
*/
|
|
31
|
+
export declare class InputRequiredSignal extends Error {
|
|
32
|
+
readonly result: InputRequiredResult;
|
|
33
|
+
/** Brand for `instanceof`-free detection across bundling boundaries. */
|
|
34
|
+
readonly isInputRequiredSignal: true;
|
|
35
|
+
constructor(result: InputRequiredResult);
|
|
36
|
+
}
|
|
37
|
+
/** Narrows an unknown thrown value to the input-required control-flow signal. */
|
|
38
|
+
export declare function isInputRequiredSignal(error: unknown): error is InputRequiredSignal;
|
|
39
|
+
/**
|
|
40
|
+
* Builds `ctx.requestInput`. Always present — a handler may request input on
|
|
41
|
+
* any transport and either era; whether the round trip is served by the client
|
|
42
|
+
* (2026) or by the SDK's legacy shim (2025) is not the handler's concern.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createRequestInput(): (spec: InputRequiredSpec) => never;
|
|
45
|
+
/**
|
|
46
|
+
* Builds the `ctx.inputs` reader over a retried request's `inputResponses`.
|
|
47
|
+
*
|
|
48
|
+
* Values arrive from the client and are never re-validated by the SDK — pass a
|
|
49
|
+
* schema to `accepted()` wherever the content matters.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createContextInputs(mcpReq: ServerContext['mcpReq'] | undefined): ContextInputs;
|
|
52
|
+
//# sourceMappingURL=inputRequired.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputRequired.d.ts","sourceRoot":"","sources":["../../src/mcp-server/inputRequired.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAItB,KAAK,aAAa,EAEnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAIhC,QAAQ,CAAC,MAAM,EAAE,mBAAmB;IAHhD,wEAAwE;IACxE,QAAQ,CAAC,qBAAqB,OAAiB;IAE/C,YAAqB,MAAM,EAAE,mBAAmB,EAG/C;CACF;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAOlF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,CAAC,IAAI,EAAE,iBAAiB,KAAK,KAAK,CAIvE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,SAAS,GAAG,aAAa,CAc9F"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Multi-round-trip input plumbing shared by the tool, resource,
|
|
3
|
+
* and prompt handler factories (MCP protocol revision 2026-07-28).
|
|
4
|
+
*
|
|
5
|
+
* The 2025 push model — `await ctx.elicit(...)` mid-handler over a
|
|
6
|
+
* server-to-client request — has no channel on the 2026-07-28 wire. A handler
|
|
7
|
+
* now *returns* `inputRequired(...)` and is re-entered with the collected
|
|
8
|
+
* `inputResponses`. Framework handlers are pure functions returning a domain
|
|
9
|
+
* output, so the return path is expressed as a thrown {@link InputRequiredSignal}
|
|
10
|
+
* that each handler factory catches and converts back into the SDK's
|
|
11
|
+
* `input_required` result.
|
|
12
|
+
*
|
|
13
|
+
* One surface serves both eras: the SDK's legacy shim
|
|
14
|
+
* (`ServerOptions.inputRequired.legacyShim`, on by default) fulfils the same
|
|
15
|
+
* returns against 2025-era clients by issuing real `elicitation/create` /
|
|
16
|
+
* `sampling/createMessage` / `roots/list` requests and re-entering the handler.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr | MCP Multi-Round-Trip Requests}
|
|
19
|
+
* @module src/mcp-server/inputRequired
|
|
20
|
+
*/
|
|
21
|
+
import { acceptedContent, inputRequired, inputResponse, } from '@modelcontextprotocol/server';
|
|
22
|
+
/**
|
|
23
|
+
* Thrown by `ctx.requestInput(...)` and caught by the handler factories, which
|
|
24
|
+
* return the carried `input_required` result to the SDK instead of a normal
|
|
25
|
+
* tool/resource/prompt result.
|
|
26
|
+
*
|
|
27
|
+
* Not an {@link McpError}: it is protocol control flow, not a failure, and must
|
|
28
|
+
* bypass the error classifier entirely.
|
|
29
|
+
*/
|
|
30
|
+
export class InputRequiredSignal extends Error {
|
|
31
|
+
result;
|
|
32
|
+
/** Brand for `instanceof`-free detection across bundling boundaries. */
|
|
33
|
+
isInputRequiredSignal = true;
|
|
34
|
+
constructor(result) {
|
|
35
|
+
super('Handler requires additional input before it can complete.');
|
|
36
|
+
this.result = result;
|
|
37
|
+
this.name = 'InputRequiredSignal';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Narrows an unknown thrown value to the input-required control-flow signal. */
|
|
41
|
+
export function isInputRequiredSignal(error) {
|
|
42
|
+
return (error instanceof InputRequiredSignal ||
|
|
43
|
+
(typeof error === 'object' &&
|
|
44
|
+
error !== null &&
|
|
45
|
+
error.isInputRequiredSignal === true));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Builds `ctx.requestInput`. Always present — a handler may request input on
|
|
49
|
+
* any transport and either era; whether the round trip is served by the client
|
|
50
|
+
* (2026) or by the SDK's legacy shim (2025) is not the handler's concern.
|
|
51
|
+
*/
|
|
52
|
+
export function createRequestInput() {
|
|
53
|
+
return (spec) => {
|
|
54
|
+
throw new InputRequiredSignal(inputRequired(spec));
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Builds the `ctx.inputs` reader over a retried request's `inputResponses`.
|
|
59
|
+
*
|
|
60
|
+
* Values arrive from the client and are never re-validated by the SDK — pass a
|
|
61
|
+
* schema to `accepted()` wherever the content matters.
|
|
62
|
+
*/
|
|
63
|
+
export function createContextInputs(mcpReq) {
|
|
64
|
+
const responses = mcpReq?.inputResponses;
|
|
65
|
+
const accepted = ((key, schema) => schema === undefined
|
|
66
|
+
? acceptedContent(responses, key)
|
|
67
|
+
: acceptedContent(responses, key, schema));
|
|
68
|
+
return {
|
|
69
|
+
accepted,
|
|
70
|
+
dropped: mcpReq?.droppedInputResponseKeys ?? [],
|
|
71
|
+
responses,
|
|
72
|
+
state: () => mcpReq?.requestState(),
|
|
73
|
+
view: (key) => inputResponse(responses, key),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=inputRequired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputRequired.js","sourceRoot":"","sources":["../../src/mcp-server/inputRequired.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,eAAe,EAIf,aAAa,EACb,aAAa,GAGd,MAAM,8BAA8B,CAAC;AAItC;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAIvB,MAAM;IAH3B,wEAAwE;IAC/D,qBAAqB,GAAG,IAAa,CAAC;IAE/C,YAAqB,MAA2B;QAC9C,KAAK,CAAC,2DAA2D,CAAC,CAAC;sBADhD,MAAM;QAEzB,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,iFAAiF;AACjF,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,CACL,KAAK,YAAY,mBAAmB;QACpC,CAAC,OAAO,KAAK,KAAK,QAAQ;YACxB,KAAK,KAAK,IAAI;YACb,KAA6C,CAAC,qBAAqB,KAAK,IAAI,CAAC,CACjF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,CAAC,IAAuB,EAAS,EAAE;QACxC,MAAM,IAAI,mBAAmB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAA2C;IAC7E,MAAM,SAAS,GAAG,MAAM,EAAE,cAAc,CAAC;IACzC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAW,EAAE,MAAyB,EAAE,EAAE,CAC3D,MAAM,KAAK,SAAS;QAClB,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC;QACjC,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,CAAC,CAA8B,CAAC;IAE5E,OAAO;QACL,QAAQ;QACR,OAAO,EAAE,MAAM,EAAE,wBAAwB,IAAI,EAAE;QAC/C,SAAS;QACT,KAAK,EAAE,GAA8B,EAAE,CAAC,MAAM,EAAE,YAAY,EAAK;QACjE,IAAI,EAAE,CAAC,GAAW,EAAqB,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,CAAC;KACxE,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Request-scoped list-changed / resource-updated notifiers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* standalone GET SSE stream
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
4
|
+
* Notifications fired from inside a handler are sent through the request's own
|
|
5
|
+
* `ctx.mcpReq.notify`, which stamps `relatedRequestId` so the message lands on
|
|
6
|
+
* that request's own response stream. The server-level `send*ListChanged()`
|
|
7
|
+
* path targets the standalone GET SSE stream instead, which does not exist
|
|
8
|
+
* under per-request serving (`createMcpHandler`'s modern leg and its stateless
|
|
9
|
+
* legacy fallback both build one instance per request) — notifications sent
|
|
10
|
+
* that way drop silently (#135).
|
|
11
|
+
*
|
|
12
|
+
* `notifications/resources/updated` is subscription-scoped: it is emitted only
|
|
13
|
+
* for URIs the client actually subscribed to via `resources/subscribe` (#354).
|
|
12
14
|
*
|
|
13
15
|
* @module src/mcp-server/notifications
|
|
14
16
|
*/
|
|
15
|
-
import type { ServerNotification } from '@modelcontextprotocol/
|
|
17
|
+
import type { ServerNotification } from '@modelcontextprotocol/server';
|
|
16
18
|
/**
|
|
17
|
-
* The
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* scope (some test harnesses pass a bare `Request`) has no sender, and we fall
|
|
22
|
-
* back to the server-level notifiers there.
|
|
19
|
+
* The slice of `ctx.mcpReq` these notifiers need. Typed with an optional
|
|
20
|
+
* `notify` so the runtime presence check is type-meaningful — a background or
|
|
21
|
+
* test scope may pass a stand-in without one, and callers fall back to the
|
|
22
|
+
* server-level notifiers there.
|
|
23
23
|
*/
|
|
24
24
|
interface NotificationSender {
|
|
25
|
-
|
|
25
|
+
notify?: (notification: ServerNotification) => Promise<void>;
|
|
26
26
|
}
|
|
27
27
|
/** The four list-changed / resource-updated closures attached to a handler `ctx`. */
|
|
28
28
|
export interface RequestScopedNotifiers {
|
|
@@ -31,25 +31,27 @@ export interface RequestScopedNotifiers {
|
|
|
31
31
|
notifyResourceUpdated: (uri: string) => void;
|
|
32
32
|
notifyToolListChanged: () => void;
|
|
33
33
|
}
|
|
34
|
+
/** Per-connection subscription state consulted before a resource-updated emit. */
|
|
35
|
+
export interface ResourceSubscriptions {
|
|
36
|
+
/** True when the connected client subscribed to this exact URI. */
|
|
37
|
+
has: (uri: string) => boolean;
|
|
38
|
+
}
|
|
34
39
|
/**
|
|
35
|
-
* Builds notifier closures bound to a single request's `
|
|
36
|
-
* The SDK stamps `relatedRequestId` onto these sends, so `@hono/mcp` routes them
|
|
37
|
-
* to that request's SSE response stream — the delivery path the server-level
|
|
38
|
-
* `server.send*ListChanged()` calls miss under the per-request McpServer model,
|
|
39
|
-
* where they drop silently (#135).
|
|
40
|
+
* Builds notifier closures bound to a single request's `ctx.mcpReq.notify`.
|
|
40
41
|
*
|
|
41
|
-
* Returns `undefined` when the supplied
|
|
42
|
-
* back to the server-level notifiers in that case.
|
|
42
|
+
* Returns `undefined` when the supplied request scope exposes no sender;
|
|
43
|
+
* callers fall back to the server-level notifiers in that case.
|
|
43
44
|
*
|
|
44
|
-
* Fire-and-forget by contract (`() => void`): the underlying
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* Fire-and-forget by contract (`() => void`): the underlying promise is not
|
|
46
|
+
* awaited — a notification that can't flush (client already gone, response not
|
|
47
|
+
* upgraded to SSE) must not fail the handler. A flush failure is logged at
|
|
48
|
+
* debug rather than swallowed silently.
|
|
48
49
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
50
|
+
* @param mcpReq - The request scope from the SDK's `ServerContext`.
|
|
51
|
+
* @param subscriptions - Per-connection `resources/subscribe` registry. When
|
|
52
|
+
* supplied, `notifyResourceUpdated` emits only for subscribed URIs; when
|
|
53
|
+
* omitted (no subscription tracking available) every URI is emitted.
|
|
52
54
|
*/
|
|
53
|
-
export declare function buildRequestScopedNotifiers(
|
|
55
|
+
export declare function buildRequestScopedNotifiers(mcpReq: NotificationSender, subscriptions?: ResourceSubscriptions): RequestScopedNotifiers | undefined;
|
|
54
56
|
export {};
|
|
55
57
|
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/mcp-server/notifications.ts"],"names":[],"mappings":"AAAA
|
|
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,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,kBAAkB,EAC1B,aAAa,CAAC,EAAE,qBAAqB,GACpC,sBAAsB,GAAG,SAAS,CA2BpC"}
|
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Request-scoped list-changed / resource-updated notifiers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* standalone GET SSE stream
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
4
|
+
* Notifications fired from inside a handler are sent through the request's own
|
|
5
|
+
* `ctx.mcpReq.notify`, which stamps `relatedRequestId` so the message lands on
|
|
6
|
+
* that request's own response stream. The server-level `send*ListChanged()`
|
|
7
|
+
* path targets the standalone GET SSE stream instead, which does not exist
|
|
8
|
+
* under per-request serving (`createMcpHandler`'s modern leg and its stateless
|
|
9
|
+
* legacy fallback both build one instance per request) — notifications sent
|
|
10
|
+
* that way drop silently (#135).
|
|
11
|
+
*
|
|
12
|
+
* `notifications/resources/updated` is subscription-scoped: it is emitted only
|
|
13
|
+
* for URIs the client actually subscribed to via `resources/subscribe` (#354).
|
|
12
14
|
*
|
|
13
15
|
* @module src/mcp-server/notifications
|
|
14
16
|
*/
|
|
15
17
|
import { logger } from '../utils/internal/logger.js';
|
|
16
18
|
/**
|
|
17
|
-
* Builds notifier closures bound to a single request's `
|
|
18
|
-
* The SDK stamps `relatedRequestId` onto these sends, so `@hono/mcp` routes them
|
|
19
|
-
* to that request's SSE response stream — the delivery path the server-level
|
|
20
|
-
* `server.send*ListChanged()` calls miss under the per-request McpServer model,
|
|
21
|
-
* where they drop silently (#135).
|
|
19
|
+
* Builds notifier closures bound to a single request's `ctx.mcpReq.notify`.
|
|
22
20
|
*
|
|
23
|
-
* Returns `undefined` when the supplied
|
|
24
|
-
* back to the server-level notifiers in that case.
|
|
21
|
+
* Returns `undefined` when the supplied request scope exposes no sender;
|
|
22
|
+
* callers fall back to the server-level notifiers in that case.
|
|
25
23
|
*
|
|
26
|
-
* Fire-and-forget by contract (`() => void`): the underlying
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* Fire-and-forget by contract (`() => void`): the underlying promise is not
|
|
25
|
+
* awaited — a notification that can't flush (client already gone, response not
|
|
26
|
+
* upgraded to SSE) must not fail the handler. A flush failure is logged at
|
|
27
|
+
* debug rather than swallowed silently.
|
|
30
28
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* @param mcpReq - The request scope from the SDK's `ServerContext`.
|
|
30
|
+
* @param subscriptions - Per-connection `resources/subscribe` registry. When
|
|
31
|
+
* supplied, `notifyResourceUpdated` emits only for subscribed URIs; when
|
|
32
|
+
* omitted (no subscription tracking available) every URI is emitted.
|
|
34
33
|
*/
|
|
35
|
-
export function buildRequestScopedNotifiers(
|
|
36
|
-
if (typeof
|
|
34
|
+
export function buildRequestScopedNotifiers(mcpReq, subscriptions) {
|
|
35
|
+
if (typeof mcpReq.notify !== 'function')
|
|
37
36
|
return;
|
|
38
|
-
const send =
|
|
37
|
+
const send = mcpReq.notify.bind(mcpReq);
|
|
39
38
|
const emit = (notification) => {
|
|
40
39
|
void send(notification).catch((error) => {
|
|
41
40
|
logger.debug(`Notification ${notification.method} not delivered: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -45,7 +44,16 @@ export function buildRequestScopedNotifiers(extra) {
|
|
|
45
44
|
notifyToolListChanged: () => emit({ method: 'notifications/tools/list_changed' }),
|
|
46
45
|
notifyResourceListChanged: () => emit({ method: 'notifications/resources/list_changed' }),
|
|
47
46
|
notifyPromptListChanged: () => emit({ method: 'notifications/prompts/list_changed' }),
|
|
48
|
-
notifyResourceUpdated: (uri) =>
|
|
47
|
+
notifyResourceUpdated: (uri) => {
|
|
48
|
+
// Spec: `notifications/resources/updated` SHOULD only be sent for a URI
|
|
49
|
+
// the client subscribed to. Emitting to a client that never subscribed is
|
|
50
|
+
// noise it has no handler for.
|
|
51
|
+
if (subscriptions && !subscriptions.has(uri)) {
|
|
52
|
+
logger.debug(`Resource update for ${uri} not sent: no active subscription.`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
emit({ method: 'notifications/resources/updated', params: { uri } });
|
|
56
|
+
},
|
|
49
57
|
};
|
|
50
58
|
}
|
|
51
59
|
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/mcp-server/notifications.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../src/mcp-server/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AA0BpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAA0B,EAC1B,aAAqC;IAErC,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU;QAAE,OAAO;IAChD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,CAAC,YAAgC,EAAQ,EAAE;QACtD,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YAC/C,MAAM,CAAC,KAAK,CACV,gBAAgB,YAAY,CAAC,MAAM,mBACjC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IACF,OAAO;QACL,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC;QACjF,yBAAyB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,sCAAsC,EAAE,CAAC;QACzF,uBAAuB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC;QACrF,qBAAqB,EAAE,CAAC,GAAW,EAAE,EAAE;YACrC,wEAAwE;YACxE,0EAA0E;YAC1E,+BAA+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,10 +2,10 @@
|
|
|
2
2
|
* @fileoverview Service for registering MCP prompts on a server instance.
|
|
3
3
|
*
|
|
4
4
|
* MCP Prompts Specification:
|
|
5
|
-
* @see {@link https://modelcontextprotocol.io/specification/
|
|
5
|
+
* @see {@link https://modelcontextprotocol.io/specification/2026-07-28/server/prompts | MCP Prompts}
|
|
6
6
|
* @module src/mcp-server/prompts/prompt-registration
|
|
7
7
|
*/
|
|
8
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
8
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
9
9
|
import type { AnyPromptDefinition } from '../../mcp-server/prompts/utils/promptDefinition.js';
|
|
10
10
|
import type { logger as defaultLogger } from '../../utils/internal/logger.js';
|
|
11
11
|
export declare class PromptRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/prompts/prompt-registration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"prompt-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/prompts/prompt-registration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAwC,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGpG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAG1F,OAAO,KAAK,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI1E,qBAAa,cAAc;IAKvB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,MAAM;IALhB,sEAAsE;IACtE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,YACU,UAAU,EAAE,mBAAmB,EAAE,EACjC,MAAM,EAAE,OAAO,aAAa,EAClC;IAEJ;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBlD;IAED,+EAA+E;IAC/E,OAAO,CAAC,gBAAgB;YAUV,cAAc;CAgE7B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isInputRequiredSignal } from '../../mcp-server/inputRequired.js';
|
|
1
2
|
import { JsonRpcErrorCode, McpError } from '../../types-global/errors.js';
|
|
2
3
|
import { ErrorHandler } from '../../utils/internal/error-handler/errorHandler.js';
|
|
3
4
|
import { measurePromptGeneration } from '../../utils/internal/performance.js';
|
|
@@ -20,10 +21,9 @@ export class PromptRegistry {
|
|
|
20
21
|
operation: 'PromptRegistry.registerAll',
|
|
21
22
|
});
|
|
22
23
|
this.logger.debug(`Registering ${this.promptDefs.length} prompt(s)...`, context);
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
server.setPromptRequestHandlers();
|
|
24
|
+
// `prompts/list` and `prompts/get` are installed by the SDK from the
|
|
25
|
+
// declared `prompts` capability, so a server with no prompts still answers
|
|
26
|
+
// `prompts/list` with an empty array rather than `-32601`.
|
|
27
27
|
for (const promptDef of this.promptDefs) {
|
|
28
28
|
await this.registerPrompt(server, promptDef, context);
|
|
29
29
|
}
|
|
@@ -44,8 +44,13 @@ export class PromptRegistry {
|
|
|
44
44
|
server.registerPrompt(promptDef.name, {
|
|
45
45
|
...(promptDef.title && { title: promptDef.title }),
|
|
46
46
|
description: promptDef.description,
|
|
47
|
+
// The ZodObject itself, not `.shape`: the raw-shape overload
|
|
48
|
+
// rebuilds a fresh non-strict object (dropping `.strict()` and any
|
|
49
|
+
// object-level refinement), and requiredness is derived from the
|
|
50
|
+
// emitted JSON Schema, so a `.default()`ed argument correctly
|
|
51
|
+
// advertises as optional (#258).
|
|
47
52
|
...(promptDef.args && {
|
|
48
|
-
argsSchema: promptDef.args
|
|
53
|
+
argsSchema: promptDef.args,
|
|
49
54
|
}),
|
|
50
55
|
}, async (args) => {
|
|
51
56
|
try {
|
|
@@ -54,6 +59,11 @@ export class PromptRegistry {
|
|
|
54
59
|
return { messages };
|
|
55
60
|
}
|
|
56
61
|
catch (error) {
|
|
62
|
+
// `ctx.requestInput(...)` is protocol control flow, not a failure
|
|
63
|
+
// — `prompts/get` honors `input_required` on the 2026-07-28
|
|
64
|
+
// revision.
|
|
65
|
+
if (isInputRequiredSignal(error))
|
|
66
|
+
return error.result;
|
|
57
67
|
const handled = ErrorHandler.handleError(error, {
|
|
58
68
|
operation: `prompt:${promptDef.name}`,
|
|
59
69
|
context,
|