@eclipse-glsp/server-mcp 2.7.0-next.9 → 2.8.0-next.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/README.md +17 -3
- package/{lib/util/index.d.ts → browser.d.ts} +1 -3
- package/browser.js +18 -0
- package/common.d.ts +16 -0
- package/common.js +18 -0
- package/lib/{resources → browser}/index.d.ts +5 -4
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/{index.js → browser/index.js} +20 -24
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/modules/browser-mcp-server-module.d.ts +42 -0
- package/lib/browser/modules/browser-mcp-server-module.d.ts.map +1 -0
- package/lib/browser/modules/browser-mcp-server-module.js +50 -0
- package/lib/browser/modules/browser-mcp-server-module.js.map +1 -0
- package/lib/browser/reexport.d.ts +17 -0
- package/lib/browser/reexport.d.ts.map +1 -0
- package/lib/{util/index.js → browser/reexport.js} +17 -18
- package/lib/browser/reexport.js.map +1 -0
- package/lib/browser/server/browser-mcp-request-context.d.ts +27 -0
- package/lib/browser/server/browser-mcp-request-context.d.ts.map +1 -0
- package/lib/browser/server/browser-mcp-request-context.js +67 -0
- package/lib/browser/server/browser-mcp-request-context.js.map +1 -0
- package/lib/browser/server/mcp-worker-bridge.d.ts +81 -0
- package/lib/browser/server/mcp-worker-bridge.d.ts.map +1 -0
- package/lib/browser/server/mcp-worker-bridge.js +159 -0
- package/lib/browser/server/mcp-worker-bridge.js.map +1 -0
- package/lib/browser/server/web-mcp-server-launcher.d.ts +34 -0
- package/lib/browser/server/web-mcp-server-launcher.d.ts.map +1 -0
- package/lib/browser/server/web-mcp-server-launcher.js +50 -0
- package/lib/browser/server/web-mcp-server-launcher.js.map +1 -0
- package/lib/common/index.d.ts +65 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +81 -0
- package/lib/common/index.js.map +1 -0
- package/lib/{server/mcp-server-module.d.ts → common/modules/abstract-mcp-server-module.d.ts} +55 -46
- package/lib/common/modules/abstract-mcp-server-module.d.ts.map +1 -0
- package/lib/{server/mcp-server-module.js → common/modules/abstract-mcp-server-module.js} +58 -79
- package/lib/common/modules/abstract-mcp-server-module.js.map +1 -0
- package/lib/{server → common/modules}/mcp-diagram-module.d.ts +5 -5
- package/lib/common/modules/mcp-diagram-module.d.ts.map +1 -0
- package/lib/{server → common/modules}/mcp-diagram-module.js +44 -28
- package/lib/common/modules/mcp-diagram-module.js.map +1 -0
- package/lib/{prompts → common/prompts}/handlers/describe-diagram-mcp-prompt-handler.d.ts +2 -1
- package/lib/common/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts.map +1 -0
- package/lib/{prompts → common/prompts}/handlers/describe-diagram-mcp-prompt-handler.js +21 -15
- package/lib/common/prompts/handlers/describe-diagram-mcp-prompt-handler.js.map +1 -0
- package/lib/{prompts → common/prompts}/handlers/suggest-improvements-mcp-prompt-handler.d.ts +2 -1
- package/lib/common/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts.map +1 -0
- package/lib/{prompts → common/prompts}/handlers/suggest-improvements-mcp-prompt-handler.js +16 -12
- package/lib/common/prompts/handlers/suggest-improvements-mcp-prompt-handler.js.map +1 -0
- package/lib/{resources → common/resources}/handlers/diagram-png-mcp-resource-handler.d.ts +4 -1
- package/lib/common/resources/handlers/diagram-png-mcp-resource-handler.d.ts.map +1 -0
- package/lib/{resources → common/resources}/handlers/diagram-png-mcp-resource-handler.js +10 -7
- package/lib/common/resources/handlers/diagram-png-mcp-resource-handler.js.map +1 -0
- package/lib/{resources → common/resources}/handlers/diagram-svg-mcp-resource-handler.d.ts +4 -1
- package/lib/common/resources/handlers/diagram-svg-mcp-resource-handler.d.ts.map +1 -0
- package/lib/{resources → common/resources}/handlers/diagram-svg-mcp-resource-handler.js +9 -6
- package/lib/common/resources/handlers/diagram-svg-mcp-resource-handler.js.map +1 -0
- package/lib/common/resources/services/element-types-provider.d.ts.map +1 -0
- package/lib/common/resources/services/element-types-provider.js.map +1 -0
- package/lib/common/resources/services/mcp-model-serializer.d.ts.map +1 -0
- package/lib/{resources → common/resources}/services/mcp-model-serializer.js +2 -2
- package/lib/common/resources/services/mcp-model-serializer.js.map +1 -0
- package/lib/common/server/abstract-mcp-server-launcher.d.ts +168 -0
- package/lib/common/server/abstract-mcp-server-launcher.d.ts.map +1 -0
- package/lib/{server/mcp-server-launcher.js → common/server/abstract-mcp-server-launcher.js} +235 -121
- package/lib/common/server/abstract-mcp-server-launcher.js.map +1 -0
- package/lib/{server → common/server}/glsp-mcp-server.d.ts +1 -1
- package/lib/common/server/glsp-mcp-server.d.ts.map +1 -0
- package/lib/{server → common/server}/glsp-mcp-server.js +6 -1
- package/lib/common/server/glsp-mcp-server.js.map +1 -0
- package/lib/{server → common/server}/lru-event-store.d.ts +1 -1
- package/lib/common/server/lru-event-store.d.ts.map +1 -0
- package/lib/common/server/lru-event-store.js.map +1 -0
- package/lib/{server → common/server}/mcp-diagram-handler-dispatcher.d.ts +3 -1
- package/lib/common/server/mcp-diagram-handler-dispatcher.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-diagram-handler-dispatcher.js +12 -6
- package/lib/common/server/mcp-diagram-handler-dispatcher.js.map +1 -0
- package/lib/common/server/mcp-diagram-prompt-handler-registry.d.ts.map +1 -0
- package/lib/common/server/mcp-diagram-prompt-handler-registry.js.map +1 -0
- package/lib/common/server/mcp-diagram-resource-handler-registry.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-diagram-resource-handler-registry.js +4 -1
- package/lib/common/server/mcp-diagram-resource-handler-registry.js.map +1 -0
- package/lib/common/server/mcp-diagram-tool-handler-registry.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-diagram-tool-handler-registry.js +3 -1
- package/lib/common/server/mcp-diagram-tool-handler-registry.js.map +1 -0
- package/lib/common/server/mcp-handler-shared.d.ts.map +1 -0
- package/lib/common/server/mcp-handler-shared.js.map +1 -0
- package/lib/common/server/mcp-id-alias-service.d.ts.map +1 -0
- package/lib/common/server/mcp-id-alias-service.js.map +1 -0
- package/lib/{server → common/server}/mcp-input-schemas.d.ts +8 -0
- package/lib/common/server/mcp-input-schemas.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-input-schemas.js +13 -1
- package/lib/common/server/mcp-input-schemas.js.map +1 -0
- package/lib/common/server/mcp-label-provider.d.ts.map +1 -0
- package/lib/common/server/mcp-label-provider.js.map +1 -0
- package/lib/{server → common/server}/mcp-log-level-registry.d.ts +1 -1
- package/lib/common/server/mcp-log-level-registry.d.ts.map +1 -0
- package/lib/common/server/mcp-log-level-registry.js.map +1 -0
- package/lib/{server → common/server}/mcp-logger.d.ts +4 -2
- package/lib/common/server/mcp-logger.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-logger.js +11 -3
- package/lib/common/server/mcp-logger.js.map +1 -0
- package/lib/common/server/mcp-mime-types.d.ts.map +1 -0
- package/lib/common/server/mcp-mime-types.js.map +1 -0
- package/lib/{server → common/server}/mcp-options.d.ts +1 -1
- package/lib/common/server/mcp-options.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-options.js +1 -1
- package/lib/common/server/mcp-options.js.map +1 -0
- package/lib/{server → common/server}/mcp-progress-reporter.d.ts +4 -2
- package/lib/common/server/mcp-progress-reporter.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-progress-reporter.js +14 -3
- package/lib/common/server/mcp-progress-reporter.js.map +1 -0
- package/lib/{server → common/server}/mcp-prompt-handler.d.ts +3 -1
- package/lib/common/server/mcp-prompt-handler.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-prompt-handler.js +10 -2
- package/lib/common/server/mcp-prompt-handler.js.map +1 -0
- package/lib/common/server/mcp-request-context.d.ts +35 -0
- package/lib/common/server/mcp-request-context.d.ts.map +1 -0
- package/lib/common/server/mcp-request-context.js +30 -0
- package/lib/common/server/mcp-request-context.js.map +1 -0
- package/lib/{server → common/server}/mcp-resource-handler.d.ts +3 -1
- package/lib/common/server/mcp-resource-handler.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-resource-handler.js +13 -5
- package/lib/common/server/mcp-resource-handler.js.map +1 -0
- package/lib/common/server/mcp-session.d.ts.map +1 -0
- package/lib/common/server/mcp-session.js.map +1 -0
- package/lib/{server → common/server}/mcp-tool-handler.d.ts +3 -1
- package/lib/common/server/mcp-tool-handler.d.ts.map +1 -0
- package/lib/{server → common/server}/mcp-tool-handler.js +7 -1
- package/lib/{server → common/server}/mcp-tool-handler.js.map +1 -1
- package/lib/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/count-elements-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.js +4 -3
- package/lib/common/tools/handlers/count-elements-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.d.ts +4 -1
- package/lib/common/tools/handlers/create-edges-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.js +9 -7
- package/lib/common/tools/handlers/create-edges-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.d.ts +4 -1
- package/lib/common/tools/handlers/create-nodes-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.js +10 -8
- package/lib/common/tools/handlers/create-nodes-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/delete-elements-mcp-tool-handler.d.ts +4 -1
- package/lib/common/tools/handlers/delete-elements-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/delete-elements-mcp-tool-handler.js +9 -6
- package/lib/common/tools/handlers/delete-elements-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/diagram-model-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/diagram-model-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/diagram-model-mcp-tool-handler.js +4 -3
- package/lib/common/tools/handlers/diagram-model-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/element-types-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/element-types-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/element-types-mcp-tool-handler.js +6 -5
- package/lib/common/tools/handlers/element-types-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/get-selection-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/get-selection-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/get-selection-mcp-tool-handler.js +6 -4
- package/lib/common/tools/handlers/get-selection-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/layout-mcp-tool-handler.d.ts +4 -1
- package/lib/common/tools/handlers/layout-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/layout-mcp-tool-handler.js +7 -5
- package/lib/common/tools/handlers/layout-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/modify-edges-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/modify-edges-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/modify-edges-mcp-tool-handler.js +12 -10
- package/lib/common/tools/handlers/modify-edges-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/modify-nodes-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/modify-nodes-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/modify-nodes-mcp-tool-handler.js +13 -11
- package/lib/common/tools/handlers/modify-nodes-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/query-elements-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.js +7 -5
- package/lib/common/tools/handlers/query-elements-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/redo-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/redo-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/redo-mcp-tool-handler.js +6 -4
- package/lib/common/tools/handlers/redo-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/save-model-mcp-tool-handler.d.ts +3 -1
- package/lib/common/tools/handlers/save-model-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/save-model-mcp-tool-handler.js +7 -5
- package/lib/common/tools/handlers/save-model-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/session-info-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/session-info-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/session-info-mcp-tool-handler.js +4 -3
- package/lib/common/tools/handlers/session-info-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/set-selection-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.js +6 -5
- package/lib/common/tools/handlers/set-selection-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/set-view-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/set-view-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/set-view-mcp-tool-handler.js +10 -8
- package/lib/common/tools/handlers/set-view-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/undo-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/undo-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/undo-mcp-tool-handler.js +6 -4
- package/lib/common/tools/handlers/undo-mcp-tool-handler.js.map +1 -0
- package/lib/{tools → common/tools}/handlers/validate-diagram-mcp-tool-handler.d.ts +2 -1
- package/lib/common/tools/handlers/validate-diagram-mcp-tool-handler.d.ts.map +1 -0
- package/lib/{tools → common/tools}/handlers/validate-diagram-mcp-tool-handler.js +0 -0
- package/lib/common/tools/handlers/validate-diagram-mcp-tool-handler.js.map +1 -0
- package/lib/common/util/markdown-util.d.ts.map +1 -0
- package/lib/common/util/markdown-util.js.map +1 -0
- package/lib/common/util/mcp-util.d.ts.map +1 -0
- package/lib/common/util/mcp-util.js.map +1 -0
- package/lib/{prompts → node}/index.d.ts +4 -2
- package/lib/node/index.d.ts.map +1 -0
- package/lib/{resources → node}/index.js +4 -4
- package/lib/node/index.js.map +1 -0
- package/lib/node/modules/node-mcp-server-module.d.ts +37 -0
- package/lib/node/modules/node-mcp-server-module.d.ts.map +1 -0
- package/lib/node/modules/node-mcp-server-module.js +52 -0
- package/lib/node/modules/node-mcp-server-module.js.map +1 -0
- package/lib/node/reexport.d.ts +17 -0
- package/lib/node/reexport.d.ts.map +1 -0
- package/lib/{prompts/index.js → node/reexport.js} +17 -18
- package/lib/node/reexport.js.map +1 -0
- package/lib/node/server/node-mcp-request-context.d.ts +24 -0
- package/lib/node/server/node-mcp-request-context.d.ts.map +1 -0
- package/lib/node/server/node-mcp-request-context.js +43 -0
- package/lib/node/server/node-mcp-request-context.js.map +1 -0
- package/lib/node/server/node-mcp-server-launcher.d.ts +55 -0
- package/lib/node/server/node-mcp-server-launcher.d.ts.map +1 -0
- package/lib/node/server/node-mcp-server-launcher.js +123 -0
- package/lib/node/server/node-mcp-server-launcher.js.map +1 -0
- package/node.d.ts +16 -0
- package/{src/util/index.ts → node.js} +2 -2
- package/package.json +19 -13
- package/src/{resources → browser}/index.ts +5 -4
- package/src/browser/modules/browser-mcp-server-module.ts +54 -0
- package/src/browser/reexport.ts +16 -0
- package/src/browser/server/browser-mcp-request-context.ts +59 -0
- package/src/browser/server/mcp-worker-bridge.ts +200 -0
- package/src/browser/server/web-mcp-server-launcher.ts +39 -0
- package/src/common/index.ts +65 -0
- package/src/{server/mcp-server-module.ts → common/modules/abstract-mcp-server-module.ts} +65 -77
- package/src/{server → common/modules}/mcp-diagram-module.ts +27 -28
- package/src/{prompts → common/prompts}/handlers/describe-diagram-mcp-prompt-handler.ts +8 -9
- package/src/{prompts → common/prompts}/handlers/suggest-improvements-mcp-prompt-handler.ts +6 -7
- package/src/{resources → common/resources}/handlers/diagram-png-mcp-resource-handler.ts +5 -9
- package/src/{resources → common/resources}/handlers/diagram-svg-mcp-resource-handler.ts +5 -9
- package/src/{resources → common/resources}/services/mcp-model-serializer.ts +1 -1
- package/src/common/server/abstract-mcp-server-launcher.spec.ts +458 -0
- package/src/common/server/abstract-mcp-server-launcher.ts +524 -0
- package/src/{server → common/server}/glsp-mcp-server.ts +7 -2
- package/src/{server → common/server}/lru-event-store.ts +1 -1
- package/src/{server → common/server}/mcp-diagram-handler-dispatcher.ts +13 -9
- package/src/{server → common/server}/mcp-diagram-resource-handler-registry.ts +4 -1
- package/src/{server → common/server}/mcp-diagram-tool-handler-registry.ts +3 -1
- package/src/{server → common/server}/mcp-input-schemas.ts +13 -0
- package/src/{server → common/server}/mcp-log-level-registry.ts +1 -1
- package/src/{server → common/server}/mcp-logger.spec.ts +26 -18
- package/src/{server → common/server}/mcp-logger.ts +9 -5
- package/src/{server → common/server}/mcp-options.ts +1 -1
- package/src/{server → common/server}/mcp-progress-reporter.spec.ts +19 -9
- package/src/{server → common/server}/mcp-progress-reporter.ts +9 -5
- package/src/{server → common/server}/mcp-prompt-handler.ts +8 -4
- package/src/{server → common/server}/mcp-request-context.ts +20 -16
- package/src/{server → common/server}/mcp-resource-handler.ts +11 -7
- package/src/{server → common/server}/mcp-tool-handler.spec.ts +4 -4
- package/src/{server → common/server}/mcp-tool-handler.ts +8 -4
- package/src/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.spec.ts +3 -1
- package/src/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.ts +3 -1
- package/src/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.spec.ts +3 -1
- package/src/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.ts +7 -5
- package/src/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.spec.ts +3 -1
- package/src/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.ts +7 -5
- package/src/{tools → common/tools}/handlers/delete-elements-mcp-tool-handler.ts +7 -9
- package/src/{tools → common/tools}/handlers/diagram-model-mcp-tool-handler.ts +3 -1
- package/src/{tools → common/tools}/handlers/element-types-mcp-tool-handler.ts +2 -1
- package/src/{tools → common/tools}/handlers/get-selection-mcp-tool-handler.ts +3 -1
- package/src/{tools → common/tools}/handlers/layout-mcp-tool-handler.ts +6 -3
- package/src/{tools → common/tools}/handlers/modify-edges-mcp-tool-handler.ts +6 -6
- package/src/{tools → common/tools}/handlers/modify-nodes-mcp-tool-handler.ts +6 -6
- package/src/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.spec.ts +3 -1
- package/src/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.ts +3 -7
- package/src/{tools → common/tools}/handlers/redo-mcp-tool-handler.ts +3 -1
- package/src/{tools → common/tools}/handlers/save-model-mcp-tool-handler.ts +4 -1
- package/src/{tools → common/tools}/handlers/session-info-mcp-tool-handler.spec.ts +1 -1
- package/src/{tools → common/tools}/handlers/session-info-mcp-tool-handler.ts +2 -1
- package/src/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.spec.ts +3 -1
- package/src/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.ts +3 -1
- package/src/{tools → common/tools}/handlers/set-view-mcp-tool-handler.ts +3 -9
- package/src/{tools → common/tools}/handlers/undo-mcp-tool-handler.ts +3 -1
- package/src/{tools → common/tools}/handlers/validate-diagram-mcp-tool-handler.ts +0 -0
- package/src/{prompts → node}/index.ts +4 -2
- package/src/node/modules/node-mcp-server-module.ts +56 -0
- package/src/node/reexport.ts +16 -0
- package/src/node/server/mcp-http-transport-e2e.spec.ts +297 -0
- package/src/node/server/node-mcp-request-context.ts +33 -0
- package/src/{server/mcp-server-launcher.spec.ts → node/server/node-mcp-server-launcher.spec.ts} +19 -8
- package/src/node/server/node-mcp-server-launcher.ts +130 -0
- package/lib/index.d.ts +0 -23
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts.map +0 -1
- package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js.map +0 -1
- package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts.map +0 -1
- package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js.map +0 -1
- package/lib/prompts/index.d.ts.map +0 -1
- package/lib/prompts/index.js.map +0 -1
- package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts.map +0 -1
- package/lib/resources/handlers/diagram-png-mcp-resource-handler.js.map +0 -1
- package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts.map +0 -1
- package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js.map +0 -1
- package/lib/resources/index.d.ts.map +0 -1
- package/lib/resources/index.js.map +0 -1
- package/lib/resources/services/element-types-provider.d.ts.map +0 -1
- package/lib/resources/services/element-types-provider.js.map +0 -1
- package/lib/resources/services/mcp-model-serializer.d.ts.map +0 -1
- package/lib/resources/services/mcp-model-serializer.js.map +0 -1
- package/lib/server/glsp-mcp-server.d.ts.map +0 -1
- package/lib/server/glsp-mcp-server.js.map +0 -1
- package/lib/server/index.d.ts +0 -37
- package/lib/server/index.d.ts.map +0 -1
- package/lib/server/index.js +0 -57
- package/lib/server/index.js.map +0 -1
- package/lib/server/lru-event-store.d.ts.map +0 -1
- package/lib/server/lru-event-store.js.map +0 -1
- package/lib/server/mcp-diagram-handler-dispatcher.d.ts.map +0 -1
- package/lib/server/mcp-diagram-handler-dispatcher.js.map +0 -1
- package/lib/server/mcp-diagram-module.d.ts.map +0 -1
- package/lib/server/mcp-diagram-module.js.map +0 -1
- package/lib/server/mcp-diagram-prompt-handler-registry.d.ts.map +0 -1
- package/lib/server/mcp-diagram-prompt-handler-registry.js.map +0 -1
- package/lib/server/mcp-diagram-resource-handler-registry.d.ts.map +0 -1
- package/lib/server/mcp-diagram-resource-handler-registry.js.map +0 -1
- package/lib/server/mcp-diagram-tool-handler-registry.d.ts.map +0 -1
- package/lib/server/mcp-diagram-tool-handler-registry.js.map +0 -1
- package/lib/server/mcp-handler-shared.d.ts.map +0 -1
- package/lib/server/mcp-handler-shared.js.map +0 -1
- package/lib/server/mcp-http-transport.d.ts +0 -93
- package/lib/server/mcp-http-transport.d.ts.map +0 -1
- package/lib/server/mcp-http-transport.js +0 -350
- package/lib/server/mcp-http-transport.js.map +0 -1
- package/lib/server/mcp-id-alias-service.d.ts.map +0 -1
- package/lib/server/mcp-id-alias-service.js.map +0 -1
- package/lib/server/mcp-input-schemas.d.ts.map +0 -1
- package/lib/server/mcp-input-schemas.js.map +0 -1
- package/lib/server/mcp-label-provider.d.ts.map +0 -1
- package/lib/server/mcp-label-provider.js.map +0 -1
- package/lib/server/mcp-log-level-registry.d.ts.map +0 -1
- package/lib/server/mcp-log-level-registry.js.map +0 -1
- package/lib/server/mcp-logger.d.ts.map +0 -1
- package/lib/server/mcp-logger.js.map +0 -1
- package/lib/server/mcp-mime-types.d.ts.map +0 -1
- package/lib/server/mcp-mime-types.js.map +0 -1
- package/lib/server/mcp-options.d.ts.map +0 -1
- package/lib/server/mcp-options.js.map +0 -1
- package/lib/server/mcp-progress-reporter.d.ts.map +0 -1
- package/lib/server/mcp-progress-reporter.js.map +0 -1
- package/lib/server/mcp-prompt-handler.d.ts.map +0 -1
- package/lib/server/mcp-prompt-handler.js.map +0 -1
- package/lib/server/mcp-request-context.d.ts +0 -37
- package/lib/server/mcp-request-context.d.ts.map +0 -1
- package/lib/server/mcp-request-context.js +0 -37
- package/lib/server/mcp-request-context.js.map +0 -1
- package/lib/server/mcp-resource-handler.d.ts.map +0 -1
- package/lib/server/mcp-resource-handler.js.map +0 -1
- package/lib/server/mcp-server-launcher.d.ts +0 -143
- package/lib/server/mcp-server-launcher.d.ts.map +0 -1
- package/lib/server/mcp-server-launcher.js.map +0 -1
- package/lib/server/mcp-server-module.d.ts.map +0 -1
- package/lib/server/mcp-server-module.js.map +0 -1
- package/lib/server/mcp-session.d.ts.map +0 -1
- package/lib/server/mcp-session.js.map +0 -1
- package/lib/server/mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/count-elements-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/create-edges-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/create-nodes-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/delete-elements-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/diagram-model-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/element-types-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/get-selection-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/layout-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/layout-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/modify-edges-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/query-elements-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/redo-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/redo-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/save-model-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/session-info-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/set-selection-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/set-view-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/undo-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/undo-mcp-tool-handler.js.map +0 -1
- package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts.map +0 -1
- package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js.map +0 -1
- package/lib/tools/index.d.ts +0 -34
- package/lib/tools/index.d.ts.map +0 -1
- package/lib/tools/index.js +0 -50
- package/lib/tools/index.js.map +0 -1
- package/lib/util/index.d.ts.map +0 -1
- package/lib/util/index.js.map +0 -1
- package/lib/util/markdown-util.d.ts.map +0 -1
- package/lib/util/markdown-util.js.map +0 -1
- package/lib/util/mcp-util.d.ts.map +0 -1
- package/lib/util/mcp-util.js.map +0 -1
- package/src/index.ts +0 -24
- package/src/server/index.ts +0 -42
- package/src/server/mcp-http-transport-e2e.spec.ts +0 -151
- package/src/server/mcp-http-transport.spec.ts +0 -385
- package/src/server/mcp-http-transport.ts +0 -368
- package/src/server/mcp-server-launcher.ts +0 -369
- package/src/tools/index.ts +0 -34
- /package/lib/{resources → common/resources}/services/element-types-provider.d.ts +0 -0
- /package/lib/{resources → common/resources}/services/element-types-provider.js +0 -0
- /package/lib/{resources → common/resources}/services/mcp-model-serializer.d.ts +0 -0
- /package/lib/{server → common/server}/lru-event-store.js +0 -0
- /package/lib/{server → common/server}/mcp-diagram-prompt-handler-registry.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-diagram-prompt-handler-registry.js +0 -0
- /package/lib/{server → common/server}/mcp-diagram-resource-handler-registry.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-diagram-tool-handler-registry.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-handler-shared.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-handler-shared.js +0 -0
- /package/lib/{server → common/server}/mcp-id-alias-service.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-id-alias-service.js +0 -0
- /package/lib/{server → common/server}/mcp-label-provider.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-label-provider.js +0 -0
- /package/lib/{server → common/server}/mcp-log-level-registry.js +0 -0
- /package/lib/{server → common/server}/mcp-mime-types.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-mime-types.js +0 -0
- /package/lib/{server → common/server}/mcp-session.d.ts +0 -0
- /package/lib/{server → common/server}/mcp-session.js +0 -0
- /package/lib/{util → common/util}/markdown-util.d.ts +0 -0
- /package/lib/{util → common/util}/markdown-util.js +0 -0
- /package/lib/{util → common/util}/mcp-util.d.ts +0 -0
- /package/lib/{util → common/util}/mcp-util.js +0 -0
- /package/src/{resources → common/resources}/services/element-types-provider.ts +0 -0
- /package/src/{server → common/server}/glsp-mcp-server.spec.ts +0 -0
- /package/src/{server → common/server}/lru-event-store.spec.ts +0 -0
- /package/src/{server → common/server}/mcp-diagram-handler-dispatcher.spec.ts +0 -0
- /package/src/{server → common/server}/mcp-diagram-prompt-handler-registry.ts +0 -0
- /package/src/{server → common/server}/mcp-handler-shared.spec.ts +0 -0
- /package/src/{server → common/server}/mcp-handler-shared.ts +0 -0
- /package/src/{server → common/server}/mcp-id-alias-service.spec.ts +0 -0
- /package/src/{server → common/server}/mcp-id-alias-service.ts +0 -0
- /package/src/{server → common/server}/mcp-label-provider.ts +0 -0
- /package/src/{server → common/server}/mcp-log-level-registry.spec.ts +0 -0
- /package/src/{server → common/server}/mcp-mime-types.ts +0 -0
- /package/src/{server → common/server}/mcp-session.ts +0 -0
- /package/src/{tools → common/tools}/tool-annotations.spec.ts +0 -0
- /package/src/{util → common/util}/markdown-util.ts +0 -0
- /package/src/{util → common/util}/mcp-util.ts +0 -0
- /package/src/{server → node/server}/raw-http.spec.ts +0 -0
package/README.md
CHANGED
|
@@ -27,7 +27,8 @@ Load the MCP container modules in your GLSP server's DI configuration:
|
|
|
27
27
|
```typescript
|
|
28
28
|
import { GModelStorage, WebSocketServerLauncher, createAppModule } from '@eclipse-glsp/server/node';
|
|
29
29
|
import { Container } from 'inversify';
|
|
30
|
-
import { DefaultMcpDiagramModule
|
|
30
|
+
import { DefaultMcpDiagramModule } from '@eclipse-glsp/server-mcp';
|
|
31
|
+
import { NodeMcpServerModule } from '@eclipse-glsp/server-mcp/node';
|
|
31
32
|
|
|
32
33
|
const appContainer = new Container();
|
|
33
34
|
appContainer.load(createAppModule(options));
|
|
@@ -38,16 +39,29 @@ const serverModule = new MyServerModule().configureDiagramModule(new MyDiagramMo
|
|
|
38
39
|
|
|
39
40
|
const launcher = appContainer.resolve(WebSocketServerLauncher);
|
|
40
41
|
// Launcher-level bindings — must not be part of `configureDiagramModule`.
|
|
41
|
-
launcher.configure(serverModule, new
|
|
42
|
+
launcher.configure(serverModule, new NodeMcpServerModule());
|
|
42
43
|
```
|
|
43
44
|
|
|
44
45
|
The two modules are deliberately separate because they bind into different container scopes:
|
|
45
46
|
|
|
46
47
|
- `DefaultMcpDiagramModule` is mounted inside `configureDiagramModule`, so each `ClientSession.container` gets its own per-session services (`McpIdAliasService`, `McpModelSerializer`, the diagram-scope handler registries).
|
|
47
|
-
- `
|
|
48
|
+
- `NodeMcpServerModule` is mounted at the launcher container, so the MCP HTTP server, the option holder, and the server-scope tool/resource handlers live as launcher singletons.
|
|
48
49
|
|
|
49
50
|
The MCP server itself is started lazily on the first GLSP `InitializeAction` that carries an `mcpServer` configuration.
|
|
50
51
|
|
|
52
|
+
### Browser / Web Worker target
|
|
53
|
+
|
|
54
|
+
For browser, Bun, Deno, Cloudflare Workers, or any Fetch-shaped runtime, use the `browser` subpath. `McpWorkerBridge` wires `postMessage` traffic into the launcher for the common Service-Worker → Web-Worker setup:
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import { McpWorkerBridge } from '@eclipse-glsp/server-mcp/browser';
|
|
58
|
+
|
|
59
|
+
const bridge = new McpWorkerBridge();
|
|
60
|
+
launcher.configure(serverModule, bridge.createServerModule());
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The page-side proxy — a Service Worker that intercepts `fetch('/mcp', …)` and forwards each `Request` to the bridge over a `MessageChannel` — is host-side scaffolding that adopters own. See `examples/workflow-server-mcp-demo/mcp-service-worker.js` for a working reference implementation that the workflow browser demo uses end-to-end.
|
|
64
|
+
|
|
51
65
|
## Further reading
|
|
52
66
|
|
|
53
67
|
See [ARCHITECTURE.md](./ARCHITECTURE.md) for the architecture, security model, configuration surface, deployment guidance, and the extension cookbook. The workflow example (`examples/workflow-server`) is the canonical reference for adopter wiring; each shipped handler carries an LLM-facing `description` field that doubles as developer-facing documentation.
|
|
@@ -13,6 +13,4 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './mcp-util';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
16
|
+
export * from './lib/browser/index';
|
package/browser.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
module.exports = require('./lib/browser/index');
|
package/common.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './lib/common/index';
|
package/common.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
module.exports = require('./lib/common/index');
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './
|
|
16
|
+
export * from './modules/browser-mcp-server-module';
|
|
17
|
+
export * from './reexport';
|
|
18
|
+
export * from './server/browser-mcp-request-context';
|
|
19
|
+
export * from './server/mcp-worker-bridge';
|
|
20
|
+
export * from './server/web-mcp-server-launcher';
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,qCAAqC,CAAC;AACpD,cAAc,YAAY,CAAC;AAC3B,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
2
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
18
|
if (k2 === undefined) k2 = k;
|
|
4
19
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -14,28 +29,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
29
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
30
|
};
|
|
16
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
23
|
-
*
|
|
24
|
-
* This Source Code may also be made available under the following Secondary
|
|
25
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
26
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
27
|
-
* with the GNU Classpath Exception which is available at
|
|
28
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
29
|
-
*
|
|
30
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
31
|
-
********************************************************************************/
|
|
32
|
-
__exportStar(require("./prompts"), exports);
|
|
33
|
-
__exportStar(require("./resources"), exports);
|
|
34
|
-
__exportStar(require("./server"), exports);
|
|
35
|
-
__exportStar(require("./tools"), exports);
|
|
36
|
-
__exportStar(require("./util"), exports);
|
|
37
|
-
// Module classes — exported here (not from `./server`) to avoid circular imports through
|
|
38
|
-
// the handler barrels which the modules consume.
|
|
39
|
-
__exportStar(require("./server/mcp-diagram-module"), exports);
|
|
40
|
-
__exportStar(require("./server/mcp-server-module"), exports);
|
|
32
|
+
__exportStar(require("./modules/browser-mcp-server-module"), exports);
|
|
33
|
+
__exportStar(require("./reexport"), exports);
|
|
34
|
+
__exportStar(require("./server/browser-mcp-request-context"), exports);
|
|
35
|
+
__exportStar(require("./server/mcp-worker-bridge"), exports);
|
|
36
|
+
__exportStar(require("./server/web-mcp-server-launcher"), exports);
|
|
41
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,sEAAoD;AACpD,6CAA2B;AAC3B,uEAAqD;AACrD,6DAA2C;AAC3C,mEAAiD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { BindingTarget } from '@eclipse-glsp/server';
|
|
17
|
+
import { AbstractMcpServerModule } from '../../common/modules/abstract-mcp-server-module';
|
|
18
|
+
import { AbstractMcpServerLauncher } from '../../common/server/abstract-mcp-server-launcher';
|
|
19
|
+
import { McpServerDefaults } from '../../common/server/mcp-options';
|
|
20
|
+
import { McpRequestContext } from '../../common/server/mcp-request-context';
|
|
21
|
+
/**
|
|
22
|
+
* Default {@link AbstractMcpServerModule} entry point for browser/web hosts (Bun, Deno, Cloudflare
|
|
23
|
+
* Worker, Service Worker, in-page Worker). Ships GLSP-default option values (see
|
|
24
|
+
* {@link BrowserMcpServerModule.DEFAULT_OPTIONS}) on top of the abstract module's hook defaults,
|
|
25
|
+
* and binds the web {@link WebMcpServerLauncher} + {@link BrowserMcpRequestContext}. Adopter-provided
|
|
26
|
+
* overrides via the constructor merge on top.
|
|
27
|
+
*
|
|
28
|
+
* Node-only deploy-side fields (`host`, `allowedHosts`, `allowedOrigins`, `acknowledgedNoAuth`)
|
|
29
|
+
* are intentionally omitted from defaults — adopters set these for their deployment, or run their
|
|
30
|
+
* own auth middleware around {@link AbstractMcpServerLauncher.getRequestHandler}.
|
|
31
|
+
*
|
|
32
|
+
* @experimental The MCP integration is under active development. Option names, schema shapes,
|
|
33
|
+
* and handler contracts MAY change in minor releases until the feature graduates from
|
|
34
|
+
* experimental status.
|
|
35
|
+
*/
|
|
36
|
+
export declare class BrowserMcpServerModule extends AbstractMcpServerModule {
|
|
37
|
+
static readonly DEFAULT_OPTIONS: McpServerDefaults;
|
|
38
|
+
constructor(overrides?: McpServerDefaults);
|
|
39
|
+
protected bindMcpServerLauncher(): BindingTarget<AbstractMcpServerLauncher>;
|
|
40
|
+
protected bindMcpRequestContext(): BindingTarget<McpRequestContext>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=browser-mcp-server-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-mcp-server-module.d.ts","sourceRoot":"","sources":["../../../src/browser/modules/browser-mcp-server-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAuB,MAAM,iDAAiD,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAI5E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,SAAQ,uBAAuB;IAC/D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAA8B;gBAEpE,SAAS,GAAE,iBAAsB;cAI1B,qBAAqB,IAAI,aAAa,CAAC,yBAAyB,CAAC;cAIjE,qBAAqB,IAAI,aAAa,CAAC,iBAAiB,CAAC;CAG/E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.BrowserMcpServerModule = void 0;
|
|
19
|
+
const abstract_mcp_server_module_1 = require("../../common/modules/abstract-mcp-server-module");
|
|
20
|
+
const browser_mcp_request_context_1 = require("../server/browser-mcp-request-context");
|
|
21
|
+
const web_mcp_server_launcher_1 = require("../server/web-mcp-server-launcher");
|
|
22
|
+
/**
|
|
23
|
+
* Default {@link AbstractMcpServerModule} entry point for browser/web hosts (Bun, Deno, Cloudflare
|
|
24
|
+
* Worker, Service Worker, in-page Worker). Ships GLSP-default option values (see
|
|
25
|
+
* {@link BrowserMcpServerModule.DEFAULT_OPTIONS}) on top of the abstract module's hook defaults,
|
|
26
|
+
* and binds the web {@link WebMcpServerLauncher} + {@link BrowserMcpRequestContext}. Adopter-provided
|
|
27
|
+
* overrides via the constructor merge on top.
|
|
28
|
+
*
|
|
29
|
+
* Node-only deploy-side fields (`host`, `allowedHosts`, `allowedOrigins`, `acknowledgedNoAuth`)
|
|
30
|
+
* are intentionally omitted from defaults — adopters set these for their deployment, or run their
|
|
31
|
+
* own auth middleware around {@link AbstractMcpServerLauncher.getRequestHandler}.
|
|
32
|
+
*
|
|
33
|
+
* @experimental The MCP integration is under active development. Option names, schema shapes,
|
|
34
|
+
* and handler contracts MAY change in minor releases until the feature graduates from
|
|
35
|
+
* experimental status.
|
|
36
|
+
*/
|
|
37
|
+
class BrowserMcpServerModule extends abstract_mcp_server_module_1.AbstractMcpServerModule {
|
|
38
|
+
constructor(overrides = {}) {
|
|
39
|
+
super({ ...BrowserMcpServerModule.DEFAULT_OPTIONS, ...overrides });
|
|
40
|
+
}
|
|
41
|
+
bindMcpServerLauncher() {
|
|
42
|
+
return web_mcp_server_launcher_1.WebMcpServerLauncher;
|
|
43
|
+
}
|
|
44
|
+
bindMcpRequestContext() {
|
|
45
|
+
return browser_mcp_request_context_1.BrowserMcpRequestContext;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.BrowserMcpServerModule = BrowserMcpServerModule;
|
|
49
|
+
BrowserMcpServerModule.DEFAULT_OPTIONS = { ...abstract_mcp_server_module_1.DEFAULT_MCP_OPTIONS };
|
|
50
|
+
//# sourceMappingURL=browser-mcp-server-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-mcp-server-module.js","sourceRoot":"","sources":["../../../src/browser/modules/browser-mcp-server-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,gGAA+G;AAI/G,uFAAiF;AACjF,+EAAyE;AAEzE;;;;;;;;;;;;;;GAcG;AACH,MAAa,sBAAuB,SAAQ,oDAAuB;IAG/D,YAAY,YAA+B,EAAE;QACzC,KAAK,CAAC,EAAE,GAAG,sBAAsB,CAAC,eAAe,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACvE,CAAC;IAEkB,qBAAqB;QACpC,OAAO,8CAAoB,CAAC;IAChC,CAAC;IAEkB,qBAAqB;QACpC,OAAO,sDAAwB,CAAC;IACpC,CAAC;;AAbL,wDAcC;AAbmB,sCAAe,GAAsB,EAAE,GAAG,gDAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from '../common';
|
|
17
|
+
//# sourceMappingURL=reexport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reexport.d.ts","sourceRoot":"","sources":["../../src/browser/reexport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,WAAW,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/********************************************************************************
|
|
3
|
-
* Copyright (c) 2026 EclipseSource and others.
|
|
4
|
-
*
|
|
5
|
-
* This program and the accompanying materials are made available under the
|
|
6
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
*
|
|
9
|
-
* This Source Code may also be made available under the following Secondary
|
|
10
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
* with the GNU Classpath Exception which is available at
|
|
13
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
*
|
|
15
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
-
********************************************************************************/
|
|
17
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -29,6 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
29
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
15
|
};
|
|
31
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
/********************************************************************************
|
|
18
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
19
|
+
*
|
|
20
|
+
* This program and the accompanying materials are made available under the
|
|
21
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
22
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
23
|
+
*
|
|
24
|
+
* This Source Code may also be made available under the following Secondary
|
|
25
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
26
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
27
|
+
* with the GNU Classpath Exception which is available at
|
|
28
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
29
|
+
*
|
|
30
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
31
|
+
********************************************************************************/
|
|
32
|
+
__exportStar(require("../common"), exports);
|
|
33
|
+
//# sourceMappingURL=reexport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reexport.js","sourceRoot":"","sources":["../../src/browser/reexport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4CAA0B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { McpRequestContext, McpRequestExtra } from '../../common/server/mcp-request-context';
|
|
17
|
+
/**
|
|
18
|
+
* Browser-compatible {@link McpRequestContext} that holds one request context at a time.
|
|
19
|
+
* Hosts must serialise dispatches so they don't overwrite each other (e.g. via {@link McpWorkerBridge}).
|
|
20
|
+
*/
|
|
21
|
+
export declare class BrowserMcpRequestContext implements McpRequestContext {
|
|
22
|
+
protected current: McpRequestExtra | undefined;
|
|
23
|
+
protected concurrencyWarned: boolean;
|
|
24
|
+
run<R>(extra: McpRequestExtra, callback: () => R): R;
|
|
25
|
+
getStore(): McpRequestExtra | undefined;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=browser-mcp-request-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-mcp-request-context.d.ts","sourceRoot":"","sources":["../../../src/browser/server/browser-mcp-request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE7F;;;GAGG;AACH,qBACa,wBAAyB,YAAW,iBAAiB;IAC9D,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IAC/C,SAAS,CAAC,iBAAiB,UAAS;IAEpC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IA2BpD,QAAQ,IAAI,eAAe,GAAG,SAAS;CAG1C"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.BrowserMcpRequestContext = void 0;
|
|
25
|
+
const inversify_1 = require("inversify");
|
|
26
|
+
/**
|
|
27
|
+
* Browser-compatible {@link McpRequestContext} that holds one request context at a time.
|
|
28
|
+
* Hosts must serialise dispatches so they don't overwrite each other (e.g. via {@link McpWorkerBridge}).
|
|
29
|
+
*/
|
|
30
|
+
let BrowserMcpRequestContext = class BrowserMcpRequestContext {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.concurrencyWarned = false;
|
|
33
|
+
}
|
|
34
|
+
run(extra, callback) {
|
|
35
|
+
// Warn once if an adopter forgot to serialise dispatches — silent context corruption would be hard to debug.
|
|
36
|
+
if (this.current !== undefined && !this.concurrencyWarned) {
|
|
37
|
+
this.concurrencyWarned = true;
|
|
38
|
+
console.warn('BrowserMcpRequestContext: concurrent run() detected — request contexts will overwrite each other. ' +
|
|
39
|
+
'Serialise MCP dispatches (e.g. via McpWorkerBridge or an adopter-side queue around launcher.handleRequest).');
|
|
40
|
+
}
|
|
41
|
+
const prior = this.current;
|
|
42
|
+
this.current = extra;
|
|
43
|
+
let result;
|
|
44
|
+
try {
|
|
45
|
+
result = callback();
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.current = prior;
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
if (result instanceof Promise) {
|
|
52
|
+
return result.finally(() => {
|
|
53
|
+
this.current = prior;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
this.current = prior;
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
getStore() {
|
|
60
|
+
return this.current;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.BrowserMcpRequestContext = BrowserMcpRequestContext;
|
|
64
|
+
exports.BrowserMcpRequestContext = BrowserMcpRequestContext = __decorate([
|
|
65
|
+
(0, inversify_1.injectable)()
|
|
66
|
+
], BrowserMcpRequestContext);
|
|
67
|
+
//# sourceMappingURL=browser-mcp-request-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-mcp-request-context.js","sourceRoot":"","sources":["../../../src/browser/server/browser-mcp-request-context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,yCAAuC;AAGvC;;;GAGG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QAEO,sBAAiB,GAAG,KAAK,CAAC;IAgCxC,CAAC;IA9BG,GAAG,CAAI,KAAsB,EAAE,QAAiB;QAC5C,6GAA6G;QAC7G,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACxD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,OAAO,CAAC,IAAI,CACR,oGAAoG;gBAChG,6GAA6G,CACpH,CAAC;QACN,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,MAAS,CAAC;QACd,IAAI,CAAC;YACD,MAAM,GAAG,QAAQ,EAAE,CAAC;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,MAAM,KAAK,CAAC;QAChB,CAAC;QACD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;YAC5B,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,CAAC,CAAiB,CAAC;QACvB,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ,CAAA;AAlCY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAkCpC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { Disposable } from '@eclipse-glsp/server';
|
|
17
|
+
import { AbstractMcpServerLauncher } from '../../common/server/abstract-mcp-server-launcher';
|
|
18
|
+
import { McpServerDefaults } from '../../common/server/mcp-options';
|
|
19
|
+
import { BrowserMcpServerModule } from '../modules/browser-mcp-server-module';
|
|
20
|
+
export declare const MCP_REQUEST_MESSAGE_TYPE = "mcp-request";
|
|
21
|
+
export declare const MCP_RESPONSE_MESSAGE_TYPE = "mcp-response";
|
|
22
|
+
export declare const MCP_INIT_PORT_MESSAGE_TYPE = "mcp-init-port";
|
|
23
|
+
export interface McpRequestMessage {
|
|
24
|
+
type: typeof MCP_REQUEST_MESSAGE_TYPE;
|
|
25
|
+
id: string;
|
|
26
|
+
url: string;
|
|
27
|
+
method: string;
|
|
28
|
+
headers: Record<string, string>;
|
|
29
|
+
body?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface McpResponseMessage {
|
|
32
|
+
type: typeof MCP_RESPONSE_MESSAGE_TYPE;
|
|
33
|
+
id: string;
|
|
34
|
+
status: number;
|
|
35
|
+
statusText: string;
|
|
36
|
+
headers: Record<string, string>;
|
|
37
|
+
/** `ReadableStream` on Chromium (streams SSE); buffered `ArrayBuffer` on browsers without transferable streams. */
|
|
38
|
+
body: ReadableStream<Uint8Array> | ArrayBuffer | null;
|
|
39
|
+
}
|
|
40
|
+
/** Carries the SW↔Worker `MessagePort` transfer that wires MCP traffic over a dedicated channel. */
|
|
41
|
+
export interface McpInitPortMessage {
|
|
42
|
+
type: typeof MCP_INIT_PORT_MESSAGE_TYPE;
|
|
43
|
+
}
|
|
44
|
+
export declare function isMcpRequestMessage(value: unknown): value is McpRequestMessage;
|
|
45
|
+
export declare function isMcpInitPortMessage(value: unknown): value is McpInitPortMessage;
|
|
46
|
+
/** Probes whether the current realm can transfer `ReadableStream` via `postMessage` (Chromium yes; Firefox / Safari no). */
|
|
47
|
+
export declare function canTransferReadableStream(): boolean;
|
|
48
|
+
/** Minimal Worker scope contract — defined locally so the package compiles without the `webworker` lib. */
|
|
49
|
+
export interface McpBridgeScope {
|
|
50
|
+
addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
51
|
+
removeEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
52
|
+
postMessage(message: unknown, transfer?: Transferable[]): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Bridges `postMessage` traffic to an {@link AbstractMcpServerLauncher} for browser / Web Worker
|
|
56
|
+
* adopters that proxy MCP requests via Service-Worker → Web-Worker plumbing.
|
|
57
|
+
* See `ARCHITECTURE.md` (Portable handler) for the message protocol and queueing semantics.
|
|
58
|
+
*/
|
|
59
|
+
export declare class McpWorkerBridge implements Disposable {
|
|
60
|
+
protected readonly scope: McpBridgeScope;
|
|
61
|
+
protected resolveLauncher: (launcher: AbstractMcpServerLauncher) => void;
|
|
62
|
+
protected readonly launcherReady: Promise<AbstractMcpServerLauncher>;
|
|
63
|
+
protected readonly listener: (event: MessageEvent) => void;
|
|
64
|
+
/** Serialise dispatches — `BrowserMcpRequestContext` is a single-slot store, not concurrency-safe. */
|
|
65
|
+
protected dispatchChain: Promise<void>;
|
|
66
|
+
protected readonly streamTransferable: boolean;
|
|
67
|
+
protected bufferingWarned: boolean;
|
|
68
|
+
constructor(scope?: McpBridgeScope);
|
|
69
|
+
dispose(): void;
|
|
70
|
+
/** Returns a {@link BrowserMcpServerModule} that registers its launcher with this bridge on DI activation. */
|
|
71
|
+
createServerModule(overrides?: McpServerDefaults): BrowserMcpServerModule;
|
|
72
|
+
/** First call binds; subsequent calls are no-ops. */
|
|
73
|
+
bindLauncher(launcher: AbstractMcpServerLauncher): void;
|
|
74
|
+
protected onMessage(event: MessageEvent): void;
|
|
75
|
+
protected enqueueDispatch(request: McpRequestMessage, port: MessagePort | undefined): void;
|
|
76
|
+
protected dispatch(request: McpRequestMessage, port: MessagePort | undefined): Promise<void>;
|
|
77
|
+
/** Stream on Chromium; buffer to `ArrayBuffer` (still transferable) on browsers without transferable streams. */
|
|
78
|
+
protected encodeBody(response: Response): Promise<ReadableStream<Uint8Array> | ArrayBuffer | null>;
|
|
79
|
+
protected reply(port: MessagePort | undefined, message: McpResponseMessage): void;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=mcp-worker-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-worker-bridge.d.ts","sourceRoot":"","sources":["../../../src/browser/server/mcp-worker-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AACtD,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,OAAO,wBAAwB,CAAC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,OAAO,yBAAyB,CAAC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,mHAAmH;IACnH,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC;CACzD;AAED,oGAAoG;AACpG,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,OAAO,0BAA0B,CAAC;CAC3C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAEhF;AAED,4HAA4H;AAC5H,wBAAgB,yBAAyB,IAAI,OAAO,CAQnD;AAED,2GAA2G;AAC3G,MAAM,WAAW,cAAc;IAC3B,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IACjF,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IACpF,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;CAClE;AAED;;;;GAIG;AACH,qBAAa,eAAgB,YAAW,UAAU;IASlC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc;IARpD,SAAS,CAAC,eAAe,EAAG,CAAC,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC1E,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACrE,SAAS,CAAC,QAAQ,CAAC,QAAQ,GAAI,OAAO,YAAY,KAAG,IAAI,CAA0B;IACnF,sGAAsG;IACtG,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAAqB;IAC3D,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAA+B;IAC7E,SAAS,CAAC,eAAe,UAAS;gBAEH,KAAK,GAAE,cAAkD;IAOxF,OAAO,IAAI,IAAI;IAIf,8GAA8G;IAC9G,kBAAkB,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,sBAAsB;IAUzE,qDAAqD;IACrD,YAAY,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAIvD,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAqB9C,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;cAM1E,QAAQ,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAiClG,iHAAiH;cACjG,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC;IAcxG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI;CAQpF"}
|