@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/prompts/prompt-registration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompt-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/prompts/prompt-registration.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,OAAO,cAAc;IAKf,UAAU;IACV,MAAM;IALhB,sEAAsE;IACrD,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAErD,YACU,UAAiC,EACjC,MAA4B;0BAD5B,UAAU;sBACV,MAAM;IACb,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,MAAiB;QACjC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAE7B,MAAM,OAAO,GAAG,qBAAqB,CAAC,oBAAoB,CAAC;YACzD,SAAS,EAAE,4BAA4B;SACxC,CAAC,CAAC;QAEH,IAAI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P,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;YAChD,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @see {@link https://modelcontextprotocol.io/specification/2025-06-18/basic/prompts | MCP Prompts}
|
|
7
7
|
* @module src/mcp-server/prompts/utils/promptDefinition
|
|
8
8
|
*/
|
|
9
|
-
import type { PromptMessage } from '@modelcontextprotocol/
|
|
9
|
+
import type { PromptMessage } from '@modelcontextprotocol/server';
|
|
10
10
|
import type { ZodObject, ZodRawShape, z } from 'zod';
|
|
11
11
|
/**
|
|
12
12
|
* Represents the complete, self-contained definition of an MCP prompt.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptDefinition.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/utils/promptDefinition.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"promptDefinition.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/utils/promptDefinition.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,KAAK,SAAS,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,GAAG,SAAS;IAC5F;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,CACR,IAAI,EAAE,KAAK,SAAS,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAChF,aAAa,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAChD,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kFAAkF;AAClF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAAC;AAMvF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,SAAS,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,GAAG,SAAS,EACjF,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAC7C,gBAAgB,CAAC,KAAK,CAAC,CAEzB"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @fileoverview Encapsulates the registration of all resource definitions with an McpServer.
|
|
3
3
|
* @module src/mcp-server/resources/resource-registration
|
|
4
4
|
*/
|
|
5
|
-
import { type McpServer } from '@modelcontextprotocol/
|
|
6
|
-
import type {
|
|
5
|
+
import { type McpServer } from '@modelcontextprotocol/server';
|
|
6
|
+
import type { ResourceSubscriptions } from '../../mcp-server/notifications.js';
|
|
7
7
|
import type { AnyResourceDefinition } from '../../mcp-server/resources/utils/resourceDefinition.js';
|
|
8
8
|
import { type ResourceHandlerFactoryServices } from '../../mcp-server/resources/utils/resourceHandlerFactory.js';
|
|
9
9
|
export declare class ResourceRegistry {
|
|
@@ -15,7 +15,7 @@ export declare class ResourceRegistry {
|
|
|
15
15
|
/**
|
|
16
16
|
* Registers all resolved resource definitions with the provided McpServer instance.
|
|
17
17
|
*/
|
|
18
|
-
registerAll(server: McpServer,
|
|
18
|
+
registerAll(server: McpServer, subscriptions?: ResourceSubscriptions): Promise<void>;
|
|
19
19
|
/** Throws at startup if a resource with the same name was already registered. */
|
|
20
20
|
private assertUniqueName;
|
|
21
21
|
private registerResource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,
|
|
1
|
+
{"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,8BAA8B,CAAC;AAEhF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,wDAAwD,CAAC;AAUhE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,YACU,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B,EAC9C;IAEJ;;OAEG;IACU,WAAW,CACtB,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,IAAI,CAAC,CA2Bf;IAED,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAqD/B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Encapsulates the registration of all resource definitions with an McpServer.
|
|
3
3
|
* @module src/mcp-server/resources/resource-registration
|
|
4
4
|
*/
|
|
5
|
-
import { ResourceTemplate } from '@modelcontextprotocol/
|
|
5
|
+
import { ResourceTemplate } from '@modelcontextprotocol/server';
|
|
6
6
|
import { createResourceHandler, } from '../../mcp-server/resources/utils/resourceHandlerFactory.js';
|
|
7
7
|
import { JsonRpcErrorCode } from '../../types-global/errors.js';
|
|
8
8
|
import { ErrorHandler } from '../../utils/internal/error-handler/errorHandler.js';
|
|
@@ -23,7 +23,7 @@ export class ResourceRegistry {
|
|
|
23
23
|
/**
|
|
24
24
|
* Registers all resolved resource definitions with the provided McpServer instance.
|
|
25
25
|
*/
|
|
26
|
-
async registerAll(server,
|
|
26
|
+
async registerAll(server, subscriptions) {
|
|
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
|
|
@@ -31,25 +31,18 @@ export class ResourceRegistry {
|
|
|
31
31
|
// factory prefers request-scoped notifiers (#135) and falls back to these
|
|
32
32
|
// only when a request has no notification sender.
|
|
33
33
|
const notifiers = {
|
|
34
|
-
elicitInput: (params) => server.server.elicitInput(params),
|
|
35
|
-
getClientCapabilities: () => protocolSession?.clientCapabilities ?? server.server.getClientCapabilities(),
|
|
36
34
|
notifyPromptListChanged: () => server.sendPromptListChanged(),
|
|
37
35
|
notifyResourceListChanged: () => server.sendResourceListChanged(),
|
|
38
|
-
notifyResourceUpdated: (uri) => server.server.sendResourceUpdated({ uri }),
|
|
39
36
|
notifyToolListChanged: () => server.sendToolListChanged(),
|
|
40
|
-
|
|
41
|
-
...(protocolSession?.registerRequest && {
|
|
42
|
-
registerRequest: protocolSession.registerRequest,
|
|
43
|
-
}),
|
|
37
|
+
...(subscriptions && { subscriptions }),
|
|
44
38
|
};
|
|
45
39
|
const context = requestContextService.createRequestContext({
|
|
46
40
|
operation: 'ResourceRegistry.registerAll',
|
|
47
41
|
});
|
|
48
42
|
logger.debug(`Registering ${this.resourceDefs.length} resource(s)...`, context);
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
server.setResourceRequestHandlers();
|
|
43
|
+
// `resources/list` and `resources/read` are installed by the SDK from the
|
|
44
|
+
// declared `resources` capability, so a server with no resources still
|
|
45
|
+
// answers `resources/list` with an empty array rather than `-32601`.
|
|
53
46
|
for (const resourceDef of this.resourceDefs) {
|
|
54
47
|
await this.registerResource(server, resourceDef, notifiers);
|
|
55
48
|
}
|
|
@@ -88,10 +81,10 @@ export class ResourceRegistry {
|
|
|
88
81
|
list: def.list,
|
|
89
82
|
...(def.complete && { complete: def.complete }),
|
|
90
83
|
});
|
|
91
|
-
server.
|
|
84
|
+
server.registerResource(resourceName, template, metadata, handler);
|
|
92
85
|
}
|
|
93
86
|
else {
|
|
94
|
-
server.
|
|
87
|
+
server.registerResource(resourceName, def.uriTemplate, metadata, (uri, ctx) => handler(uri, {}, ctx));
|
|
95
88
|
}
|
|
96
89
|
logger.debug(`Resource '${resourceName}' registered successfully.`, registrationContext);
|
|
97
90
|
}, {
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAkB,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIhF,OAAO,EACL,qBAAqB,GAGtB,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,SAAS,uBAAuB,CAAC,WAAmB;IAClD,OAAO,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACvC,CAAC;AAED,M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AC,KAAK,EAAE,CAAC;aACvC,CAAC;YAEF,IAAI,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC7C,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,EAAE;oBACrD,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;iBAChD,CAAC,CAAC;gBAEH,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YACrE,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAC5E,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,CACtB,CAAC;YACJ,CAAC;YAED,MAAM,CAAC,KAAK,CAAC,aAAa,YAAY,4BAA4B,EAAE,mBAAmB,CAAC,CAAC;QAC3F,CAAC,EACD;YACE,SAAS,EAAE,uBAAuB,YAAY,EAAE;YAChD,OAAO,EAAE,mBAAmB;YAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;YAChD,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Per-connection `resources/subscribe` registry.
|
|
3
|
+
*
|
|
4
|
+
* The framework advertises `resources: { subscribe: true }`, and a declared
|
|
5
|
+
* capability is a promise: `resources/subscribe` and `resources/unsubscribe`
|
|
6
|
+
* must resolve, and `notifications/resources/updated` must only reach clients
|
|
7
|
+
* that actually subscribed to the URI (#354).
|
|
8
|
+
*
|
|
9
|
+
* This is the **2025-era** mechanism, and it is installed only on instances
|
|
10
|
+
* serving that era. The 2026-07-28 revision has no `resources/subscribe` RPC —
|
|
11
|
+
* a client opts in through `subscriptions/listen`'s `resourceSubscriptions`
|
|
12
|
+
* filter, and the SDK's listen router owns delivery. Handing a modern instance
|
|
13
|
+
* this registry would leave it permanently empty and silently drop every
|
|
14
|
+
* `ctx.notifyResourceUpdated(uri)`, so `createMcpServerInstance` passes none
|
|
15
|
+
* and the notifiers emit unconditionally there.
|
|
16
|
+
*
|
|
17
|
+
* Scope is the `McpServer` instance, which is also the connection: a persistent
|
|
18
|
+
* instance per session on the sessionful legacy arm, one per request under
|
|
19
|
+
* per-request serving. On the per-request arm a subscription cannot outlive the
|
|
20
|
+
* request that created it, so a handler-time `ctx.notifyResourceUpdated(uri)`
|
|
21
|
+
* only delivers when the same exchange subscribed first.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link https://modelcontextprotocol.io/specification/2026-07-28/server/resources | MCP Resources}
|
|
24
|
+
* @module src/mcp-server/resources/resourceSubscriptions
|
|
25
|
+
*/
|
|
26
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
27
|
+
import type { ResourceSubscriptions } from '../../mcp-server/notifications.js';
|
|
28
|
+
/**
|
|
29
|
+
* Read-only view of one connection's subscription set. The set is mutated only
|
|
30
|
+
* by the `resources/subscribe` / `resources/unsubscribe` handlers installed
|
|
31
|
+
* alongside it.
|
|
32
|
+
*/
|
|
33
|
+
export interface ResourceSubscriptionRegistry extends ResourceSubscriptions {
|
|
34
|
+
readonly size: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Installs `resources/subscribe` / `resources/unsubscribe` on a server instance
|
|
38
|
+
* and returns the registry the notifiers read.
|
|
39
|
+
*
|
|
40
|
+
* Both handlers are idempotent and never fail: re-subscribing is a no-op, and
|
|
41
|
+
* unsubscribing from a URI that was never subscribed succeeds (the spec
|
|
42
|
+
* defines no error for it, and clients tear down optimistically).
|
|
43
|
+
*/
|
|
44
|
+
export declare function installResourceSubscriptions(server: McpServer): ResourceSubscriptionRegistry;
|
|
45
|
+
//# sourceMappingURL=resourceSubscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceSubscriptions.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resourceSubscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,4BAA4B,CAmB5F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Per-connection `resources/subscribe` registry.
|
|
3
|
+
*
|
|
4
|
+
* The framework advertises `resources: { subscribe: true }`, and a declared
|
|
5
|
+
* capability is a promise: `resources/subscribe` and `resources/unsubscribe`
|
|
6
|
+
* must resolve, and `notifications/resources/updated` must only reach clients
|
|
7
|
+
* that actually subscribed to the URI (#354).
|
|
8
|
+
*
|
|
9
|
+
* This is the **2025-era** mechanism, and it is installed only on instances
|
|
10
|
+
* serving that era. The 2026-07-28 revision has no `resources/subscribe` RPC —
|
|
11
|
+
* a client opts in through `subscriptions/listen`'s `resourceSubscriptions`
|
|
12
|
+
* filter, and the SDK's listen router owns delivery. Handing a modern instance
|
|
13
|
+
* this registry would leave it permanently empty and silently drop every
|
|
14
|
+
* `ctx.notifyResourceUpdated(uri)`, so `createMcpServerInstance` passes none
|
|
15
|
+
* and the notifiers emit unconditionally there.
|
|
16
|
+
*
|
|
17
|
+
* Scope is the `McpServer` instance, which is also the connection: a persistent
|
|
18
|
+
* instance per session on the sessionful legacy arm, one per request under
|
|
19
|
+
* per-request serving. On the per-request arm a subscription cannot outlive the
|
|
20
|
+
* request that created it, so a handler-time `ctx.notifyResourceUpdated(uri)`
|
|
21
|
+
* only delivers when the same exchange subscribed first.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link https://modelcontextprotocol.io/specification/2026-07-28/server/resources | MCP Resources}
|
|
24
|
+
* @module src/mcp-server/resources/resourceSubscriptions
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Installs `resources/subscribe` / `resources/unsubscribe` on a server instance
|
|
28
|
+
* and returns the registry the notifiers read.
|
|
29
|
+
*
|
|
30
|
+
* Both handlers are idempotent and never fail: re-subscribing is a no-op, and
|
|
31
|
+
* unsubscribing from a URI that was never subscribed succeeds (the spec
|
|
32
|
+
* defines no error for it, and clients tear down optimistically).
|
|
33
|
+
*/
|
|
34
|
+
export function installResourceSubscriptions(server) {
|
|
35
|
+
const subscribed = new Set();
|
|
36
|
+
server.server.setRequestHandler('resources/subscribe', (request) => {
|
|
37
|
+
subscribed.add(request.params.uri);
|
|
38
|
+
return {};
|
|
39
|
+
});
|
|
40
|
+
server.server.setRequestHandler('resources/unsubscribe', (request) => {
|
|
41
|
+
subscribed.delete(request.params.uri);
|
|
42
|
+
return {};
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
has: (uri) => subscribed.has(uri),
|
|
46
|
+
get size() {
|
|
47
|
+
return subscribed.size;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=resourceSubscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceSubscriptions.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resourceSubscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAeH;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAErC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,OAAO,EAAE,EAAE;QACjE,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE;QACnE,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;QACjC,IAAI,IAAI;YACN,OAAO,UAAU,CAAC,IAAI,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
* Handler receives `(params, ctx)` — URI is available on `ctx.uri`.
|
|
4
4
|
*
|
|
5
5
|
* MCP Resources Specification:
|
|
6
|
-
* @see {@link https://modelcontextprotocol.io/specification/
|
|
6
|
+
* @see {@link https://modelcontextprotocol.io/specification/2026-07-28/server/resources | MCP Resources}
|
|
7
7
|
* @module src/mcp-server/resources/utils/resourceDefinition
|
|
8
8
|
*/
|
|
9
|
-
import type { CompleteResourceTemplateCallback } from '@modelcontextprotocol/
|
|
10
|
-
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
11
|
-
import type { ListResourcesResult, ReadResourceResult, ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
+
import type { CompleteResourceTemplateCallback, ListResourcesResult, ReadResourceResult, ServerContext } from '@modelcontextprotocol/server';
|
|
12
10
|
import type { ZodObject, ZodRawShape, z } from 'zod';
|
|
13
11
|
import type { HandlerContext, ReasonOf } from '../../../core/context.js';
|
|
14
12
|
import type { ErrorContract } from '../../../types-global/errors.js';
|
|
@@ -25,7 +23,7 @@ export interface ResourceAnnotations {
|
|
|
25
23
|
priority?: number;
|
|
26
24
|
}
|
|
27
25
|
/** Extra context provided to list() handlers. */
|
|
28
|
-
export type ListExtra =
|
|
26
|
+
export type ListExtra = ServerContext;
|
|
29
27
|
/**
|
|
30
28
|
* Represents a complete, self-contained definition of an MCP resource.
|
|
31
29
|
* Handler receives `(params, ctx)` — URI is available on `ctx.uri`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceDefinition.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceDefinition.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"resourceDefinition.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceDefinition.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,gCAAgC,EAChC,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC;IACpC,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,iDAAiD;AACjD,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,kBAA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* MCP Resources Specification:
|
|
6
|
-
* @see {@link https://modelcontextprotocol.io/specification/
|
|
6
|
+
* @see {@link https://modelcontextprotocol.io/specification/2026-07-28/server/resources | MCP Resources}
|
|
7
7
|
* @module src/mcp-server/resources/utils/resourceDefinition
|
|
8
8
|
*/
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceDefinition.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceDefinition.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"resourceDefinition.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceDefinition.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAuIH,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,QAAQ,CAKtB,WAAmB,EACnB,OAA2E;IAE3E,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -3,15 +3,11 @@
|
|
|
3
3
|
* Constructs Context (with `uri`), checks inline auth, validates params, formats response.
|
|
4
4
|
* @module src/mcp-server/resources/utils/resourceHandlerFactory
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
7
|
-
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';
|
|
6
|
+
import type { InputRequiredResult, ReadResourceResult, ServerContext, Variables } from '@modelcontextprotocol/server';
|
|
7
|
+
import { type ResourceSubscriptions } from '../../../mcp-server/notifications.js';
|
|
11
8
|
import type { AnyResourceDefinition } from '../../../mcp-server/resources/utils/resourceDefinition.js';
|
|
12
9
|
import type { StorageService } from '../../../storage/core/StorageService.js';
|
|
13
10
|
import type { Logger } from '../../../utils/internal/logger.js';
|
|
14
|
-
type SdkExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
|
|
15
11
|
/** Services required by the handler factory to construct Context. */
|
|
16
12
|
export interface ResourceHandlerFactoryServices {
|
|
17
13
|
/**
|
|
@@ -26,7 +22,7 @@ export interface ResourceHandlerFactoryServices {
|
|
|
26
22
|
}
|
|
27
23
|
/**
|
|
28
24
|
* Per-server notifier closures bound at registration time, targeting
|
|
29
|
-
* `server.send*ListChanged()
|
|
25
|
+
* `server.send*ListChanged()`.
|
|
30
26
|
*
|
|
31
27
|
* Split from {@link ResourceHandlerFactoryServices} so each per-request
|
|
32
28
|
* McpServer gets its own notifier closures — preventing a concurrent
|
|
@@ -34,17 +30,15 @@ export interface ResourceHandlerFactoryServices {
|
|
|
34
30
|
*
|
|
35
31
|
* The resource handler factory prefers request-scoped notifiers
|
|
36
32
|
* ({@link buildRequestScopedNotifiers}, #135) and uses these only as a fallback
|
|
37
|
-
* when the
|
|
38
|
-
*
|
|
39
|
-
* The elicitation fields come from {@link ElicitationNotifiers}.
|
|
33
|
+
* when the request scope exposes no sender (e.g. a non-request test scope).
|
|
40
34
|
*/
|
|
41
|
-
export interface ResourceHandlerNotifiers
|
|
35
|
+
export interface ResourceHandlerNotifiers {
|
|
42
36
|
notifyPromptListChanged?: () => void;
|
|
43
37
|
notifyResourceListChanged?: () => void;
|
|
44
38
|
notifyResourceUpdated?: (uri: string) => void;
|
|
45
39
|
notifyToolListChanged?: () => void;
|
|
46
|
-
/**
|
|
47
|
-
|
|
40
|
+
/** Per-connection `resources/subscribe` registry (#354). */
|
|
41
|
+
subscriptions?: ResourceSubscriptions;
|
|
48
42
|
}
|
|
49
43
|
/**
|
|
50
44
|
* Creates an MCP resource read handler from a resource definition.
|
|
@@ -58,6 +52,5 @@ export interface ResourceHandlerNotifiers extends ElicitationNotifiers {
|
|
|
58
52
|
* - Formats response via `format` or JSON default
|
|
59
53
|
* - Catches errors and re-throws for the SDK
|
|
60
54
|
*/
|
|
61
|
-
export declare function createResourceHandler(def: AnyResourceDefinition, services: ResourceHandlerFactoryServices, notifiers: ResourceHandlerNotifiers): (uri: URL, variables: Variables,
|
|
62
|
-
export {};
|
|
55
|
+
export declare function createResourceHandler(def: AnyResourceDefinition, services: ResourceHandlerFactoryServices, notifiers: ResourceHandlerNotifiers): (uri: URL, variables: Variables, ctx: ServerContext) => Promise<ReadResourceResult | InputRequiredResult>;
|
|
63
56
|
//# sourceMappingURL=resourceHandlerFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACV,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAEhG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAQzD,qEAAqE;AACrE,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAwB;IACvC,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,4DAA4D;IAC5D,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACvC;AA+CD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,8BAA8B,EACxC,SAAS,EAAE,wBAAwB,GAClC,CACD,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,CA+GrD"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { config } from '../../../config/index.js';
|
|
7
7
|
import { attachTypedFail, createContext } from '../../../core/context.js';
|
|
8
|
-
import {
|
|
9
|
-
import { buildRequestScopedNotifiers } from '../../../mcp-server/notifications.js';
|
|
8
|
+
import { createContextInputs, createRequestInput, isInputRequiredSignal, } from '../../../mcp-server/inputRequired.js';
|
|
9
|
+
import { buildRequestScopedNotifiers, } from '../../../mcp-server/notifications.js';
|
|
10
10
|
import { withRequiredScopes } from '../../../mcp-server/transports/auth/lib/authUtils.js';
|
|
11
11
|
import { McpError } from '../../../types-global/errors.js';
|
|
12
12
|
import { ErrorHandler } from '../../../utils/internal/error-handler/errorHandler.js';
|
|
@@ -63,19 +63,16 @@ function observableResourceUri(uri) {
|
|
|
63
63
|
export function createResourceHandler(def, services, notifiers) {
|
|
64
64
|
const mimeType = def.mimeType ?? 'application/json';
|
|
65
65
|
const formatter = def.format ?? defaultResponseFormatter;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
const signal =
|
|
70
|
-
? AbortSignal.any([sdkContext.signal, protocolRequest.signal])
|
|
71
|
-
: sdkContext.signal;
|
|
66
|
+
const resourceName = def.name ?? def.uriTemplate;
|
|
67
|
+
return async (uri, variables, serverContext) => {
|
|
68
|
+
const mcpReq = serverContext?.mcpReq;
|
|
69
|
+
const signal = mcpReq?.signal ?? new AbortController().signal;
|
|
72
70
|
// Route handler-time list-changed / resource-updated notifications through
|
|
73
|
-
// this request's `
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const sdkSessionId = typeof sdkContext?.sessionId === 'string' ? sdkContext.sessionId : undefined;
|
|
71
|
+
// this request's `ctx.mcpReq.notify` so they carry `relatedRequestId` and
|
|
72
|
+
// reach the client under per-request serving (#135). Fall back to the
|
|
73
|
+
// server-level notifiers when the scope exposes no sender.
|
|
74
|
+
const effectiveNotifiers = buildRequestScopedNotifiers(mcpReq ?? {}, notifiers.subscriptions) ?? notifiers;
|
|
75
|
+
const sdkSessionId = typeof serverContext?.sessionId === 'string' ? serverContext.sessionId : undefined;
|
|
79
76
|
// Surface sessionId on `Context` only when it has request-spanning
|
|
80
77
|
// lifetime — stateful HTTP (or `auto`, which resolves to stateful for
|
|
81
78
|
// HTTP). In stateless mode the SDK still hands us a per-request token;
|
|
@@ -93,17 +90,17 @@ export function createResourceHandler(def, services, notifiers) {
|
|
|
93
90
|
// query-string / caller-supplied and belongs in metrics, not logs.
|
|
94
91
|
// Log correlation always uses the raw SDK sessionId — useful even in
|
|
95
92
|
// stateless mode for tracing the SDK's per-request token through events.
|
|
93
|
+
const requestId = mcpReq?.id;
|
|
96
94
|
const appContext = requestContextService.createRequestContext({
|
|
97
95
|
parentContext: {
|
|
98
|
-
...(typeof
|
|
96
|
+
...(typeof requestId === 'string' ? { requestId } : {}),
|
|
99
97
|
...(sdkSessionId ? { sessionId: sdkSessionId } : {}),
|
|
100
98
|
},
|
|
101
99
|
operation: 'HandleResourceRead',
|
|
102
100
|
additionalContext: {
|
|
103
|
-
resourceName
|
|
101
|
+
resourceName,
|
|
104
102
|
resourceUri,
|
|
105
103
|
resourceHasQuery: uri.search.length > 0,
|
|
106
|
-
sessionId: sdkSessionId,
|
|
107
104
|
},
|
|
108
105
|
});
|
|
109
106
|
try {
|
|
@@ -121,7 +118,9 @@ export function createResourceHandler(def, services, notifiers) {
|
|
|
121
118
|
storage: services.storage,
|
|
122
119
|
signal,
|
|
123
120
|
sessionId: handlerSessionId,
|
|
124
|
-
|
|
121
|
+
inputs: createContextInputs(mcpReq),
|
|
122
|
+
requestInput: createRequestInput(),
|
|
123
|
+
...(mcpReq?.log && { wireLog: mcpReq.log }),
|
|
125
124
|
notifyPromptListChanged: effectiveNotifiers.notifyPromptListChanged,
|
|
126
125
|
notifyResourceListChanged: effectiveNotifiers.notifyResourceListChanged,
|
|
127
126
|
notifyResourceUpdated: effectiveNotifiers.notifyResourceUpdated,
|
|
@@ -129,7 +128,6 @@ export function createResourceHandler(def, services, notifiers) {
|
|
|
129
128
|
uri,
|
|
130
129
|
}), def.errors);
|
|
131
130
|
// Execute handler with performance measurement
|
|
132
|
-
const resourceName = def.name ?? def.uriTemplate;
|
|
133
131
|
const handlerResult = await measureResourceExecution(() => Promise.resolve(def.handler(validatedParams, ctx)), { ...appContext, resourceName }, { uri: resourceUri, mimeType });
|
|
134
132
|
// Validate output against schema when defined
|
|
135
133
|
const validatedResult = def.output ? def.output.parse(handlerResult) : handlerResult;
|
|
@@ -137,6 +135,10 @@ export function createResourceHandler(def, services, notifiers) {
|
|
|
137
135
|
return { contents };
|
|
138
136
|
}
|
|
139
137
|
catch (error) {
|
|
138
|
+
// `ctx.requestInput(...)` is protocol control flow, not a failure —
|
|
139
|
+
// `resources/read` honors `input_required` on the 2026-07-28 revision.
|
|
140
|
+
if (isInputRequiredSignal(error))
|
|
141
|
+
return error.result;
|
|
140
142
|
// Classify without logging — the SDK logs when it catches the thrown error.
|
|
141
143
|
if (error instanceof McpError) {
|
|
142
144
|
throw error;
|
|
@@ -144,9 +146,6 @@ export function createResourceHandler(def, services, notifiers) {
|
|
|
144
146
|
const { code, message, data } = ErrorHandler.classifyOnly(error);
|
|
145
147
|
throw new McpError(code, message, data, { cause: error });
|
|
146
148
|
}
|
|
147
|
-
finally {
|
|
148
|
-
protocolRequest?.unregister();
|
|
149
|
-
}
|
|
150
149
|
};
|
|
151
150
|
}
|
|
152
151
|
//# sourceMappingURL=resourceHandlerFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"resourceHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,2BAA2B,GAE5B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAE9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAwC3E,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;IACjF,OAAO,kBAAkB,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CACX,CAAC;YAEF,+CAA+C;YAC/C,MAAM,aAAa,GAAG,MAAM,wBAAwB,CAClD,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,EACxD,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,EAC/B,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,CAC/B,CAAC;YAEF,8CAA8C;YAC9C,MAAM,eAAe,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;YAErF,MAAM,QAAQ,GAAG,SAAS,CAAC,eAAe,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC/D,OAAO,EAAE,QAAQ,EAAE,CAAC;QACtB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,oEAAoE;YACpE,uEAAuE;YACvE,IAAI,qBAAqB,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC,MAAM,CAAC;YAEtD,4EAA4E;YAC5E,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;gBAC9B,MAAM,KAAK,CAAC;YACd,CAAC;YACD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACjE,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Factory for creating configured MCP server instances.
|
|
3
3
|
* Creates an McpServer with identity, capabilities, and registered
|
|
4
|
-
* tools/resources/prompts
|
|
4
|
+
* tools/resources/prompts from the provided registries.
|
|
5
5
|
*
|
|
6
6
|
* MCP Specification References:
|
|
7
|
-
* - Lifecycle: https://modelcontextprotocol.io/specification/
|
|
8
|
-
* - Overview (Capabilities): https://modelcontextprotocol.io/specification/
|
|
9
|
-
* - Transports: https://modelcontextprotocol.io/specification/
|
|
7
|
+
* - Lifecycle: https://modelcontextprotocol.io/specification/2026-07-28/basic/lifecycle
|
|
8
|
+
* - Overview (Capabilities): https://modelcontextprotocol.io/specification/2026-07-28/basic/index
|
|
9
|
+
* - Transports: https://modelcontextprotocol.io/specification/2026-07-28/basic/transports
|
|
10
10
|
* @module src/mcp-server/server
|
|
11
11
|
*/
|
|
12
|
-
import type
|
|
13
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
14
|
-
import type { Implementation } from '@modelcontextprotocol/sdk/types.js';
|
|
12
|
+
import { type Implementation, McpServer } from '@modelcontextprotocol/server';
|
|
15
13
|
import type { AppConfig } from '../config/index.js';
|
|
16
14
|
import type { PromptRegistry } from '../mcp-server/prompts/prompt-registration.js';
|
|
17
|
-
import type { ProtocolSessionHooks } from '../mcp-server/protocolSession.js';
|
|
18
15
|
import type { ResourceRegistry } from '../mcp-server/resources/resource-registration.js';
|
|
19
16
|
import type { ToolRegistry } from '../mcp-server/tools/tool-registration.js';
|
|
20
17
|
/** Dependencies required to create an MCP server instance. */
|
|
21
18
|
export interface McpServerDeps {
|
|
22
|
-
/**
|
|
23
|
-
* When true, advertise the experimental `tasks` capability (SEP-1686).
|
|
24
|
-
* The capability is gated on actual usage — at least one registered tool
|
|
25
|
-
* must be a task tool — because the capability ships in spec revision
|
|
26
|
-
* 2025-11-25 (GA) and clients pinned to 2025-06-18 fail on the unknown key.
|
|
27
|
-
*/
|
|
28
|
-
advertiseTasks?: boolean;
|
|
29
19
|
config: AppConfig;
|
|
30
20
|
/**
|
|
31
21
|
* One-line description forwarded to `new McpServer({ serverInfo })`.
|
|
32
22
|
* Explicit option wins over `MCP_SERVER_DESCRIPTION` / `package.json`.
|
|
33
23
|
*/
|
|
34
24
|
description?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The protocol era this instance will serve, from the factory's
|
|
27
|
+
* {@link McpRequestContext}. Selects the resource-subscription mechanism —
|
|
28
|
+
* see {@link installResourceSubscriptions}. Defaults to `legacy` for direct
|
|
29
|
+
* callers that construct an instance outside the serving factories.
|
|
30
|
+
*/
|
|
31
|
+
era?: 'legacy' | 'modern';
|
|
35
32
|
/** SEP-2133 extensions to advertise in server capabilities. */
|
|
36
33
|
extensions?: Record<string, object>;
|
|
37
34
|
/** Server icon(s) forwarded to `new McpServer({ serverInfo })`. */
|
|
@@ -45,13 +42,7 @@ export interface McpServerDeps {
|
|
|
45
42
|
*/
|
|
46
43
|
instructions?: string;
|
|
47
44
|
promptRegistry: PromptRegistry;
|
|
48
|
-
/** Request-spanning state restored for a per-request HTTP server instance. */
|
|
49
|
-
protocolSession?: ProtocolSessionHooks;
|
|
50
45
|
resourceRegistry: ResourceRegistry;
|
|
51
|
-
/** Task message queue for side-channel delivery via tasks/result. */
|
|
52
|
-
taskMessageQueue?: TaskMessageQueue;
|
|
53
|
-
/** Task store for managing task lifecycle (create, status, result). */
|
|
54
|
-
taskStore?: TaskStore;
|
|
55
46
|
/**
|
|
56
47
|
* Human-readable display name forwarded to `new McpServer({ serverInfo })`.
|
|
57
48
|
* Supplements the machine-identifier `name`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp-server/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp-server/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,KAAK,cAAc,EACnB,SAAS,EAEV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAExF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAI5E,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,mEAAmE;IACnE,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAuErF"}
|