@eclipse-glsp/server-mcp 2.7.0-next.9
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/LICENSE +642 -0
- package/README.md +57 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +41 -0
- package/lib/index.js.map +1 -0
- package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts +43 -0
- package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts.map +1 -0
- package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js +96 -0
- package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js.map +1 -0
- package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts +43 -0
- package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts.map +1 -0
- package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js +95 -0
- package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js.map +1 -0
- package/lib/prompts/index.d.ts +18 -0
- package/lib/prompts/index.d.ts.map +1 -0
- package/lib/prompts/index.js +34 -0
- package/lib/prompts/index.js.map +1 -0
- package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts +81 -0
- package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts.map +1 -0
- package/lib/resources/handlers/diagram-png-mcp-resource-handler.js +174 -0
- package/lib/resources/handlers/diagram-png-mcp-resource-handler.js.map +1 -0
- package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts +52 -0
- package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts.map +1 -0
- package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js +96 -0
- package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js.map +1 -0
- package/lib/resources/index.d.ts +20 -0
- package/lib/resources/index.d.ts.map +1 -0
- package/lib/resources/index.js +36 -0
- package/lib/resources/index.js.map +1 -0
- package/lib/resources/services/element-types-provider.d.ts +65 -0
- package/lib/resources/services/element-types-provider.d.ts.map +1 -0
- package/lib/resources/services/element-types-provider.js +81 -0
- package/lib/resources/services/element-types-provider.js.map +1 -0
- package/lib/resources/services/mcp-model-serializer.d.ts +78 -0
- package/lib/resources/services/mcp-model-serializer.d.ts.map +1 -0
- package/lib/resources/services/mcp-model-serializer.js +188 -0
- package/lib/resources/services/mcp-model-serializer.js.map +1 -0
- package/lib/server/glsp-mcp-server.d.ts +82 -0
- package/lib/server/glsp-mcp-server.d.ts.map +1 -0
- package/lib/server/glsp-mcp-server.js +140 -0
- package/lib/server/glsp-mcp-server.js.map +1 -0
- package/lib/server/index.d.ts +37 -0
- package/lib/server/index.d.ts.map +1 -0
- package/lib/server/index.js +57 -0
- package/lib/server/index.js.map +1 -0
- package/lib/server/lru-event-store.d.ts +53 -0
- package/lib/server/lru-event-store.d.ts.map +1 -0
- package/lib/server/lru-event-store.js +100 -0
- package/lib/server/lru-event-store.js.map +1 -0
- package/lib/server/mcp-diagram-handler-dispatcher.d.ts +144 -0
- package/lib/server/mcp-diagram-handler-dispatcher.d.ts.map +1 -0
- package/lib/server/mcp-diagram-handler-dispatcher.js +382 -0
- package/lib/server/mcp-diagram-handler-dispatcher.js.map +1 -0
- package/lib/server/mcp-diagram-module.d.ts +123 -0
- package/lib/server/mcp-diagram-module.d.ts.map +1 -0
- package/lib/server/mcp-diagram-module.js +186 -0
- package/lib/server/mcp-diagram-module.js.map +1 -0
- package/lib/server/mcp-diagram-prompt-handler-registry.d.ts +33 -0
- package/lib/server/mcp-diagram-prompt-handler-registry.d.ts.map +1 -0
- package/lib/server/mcp-diagram-prompt-handler-registry.js +76 -0
- package/lib/server/mcp-diagram-prompt-handler-registry.js.map +1 -0
- package/lib/server/mcp-diagram-resource-handler-registry.d.ts +35 -0
- package/lib/server/mcp-diagram-resource-handler-registry.d.ts.map +1 -0
- package/lib/server/mcp-diagram-resource-handler-registry.js +94 -0
- package/lib/server/mcp-diagram-resource-handler-registry.js.map +1 -0
- package/lib/server/mcp-diagram-tool-handler-registry.d.ts +57 -0
- package/lib/server/mcp-diagram-tool-handler-registry.d.ts.map +1 -0
- package/lib/server/mcp-diagram-tool-handler-registry.js +111 -0
- package/lib/server/mcp-diagram-tool-handler-registry.js.map +1 -0
- package/lib/server/mcp-handler-shared.d.ts +142 -0
- package/lib/server/mcp-handler-shared.d.ts.map +1 -0
- package/lib/server/mcp-handler-shared.js +199 -0
- package/lib/server/mcp-handler-shared.js.map +1 -0
- package/lib/server/mcp-http-transport.d.ts +93 -0
- package/lib/server/mcp-http-transport.d.ts.map +1 -0
- package/lib/server/mcp-http-transport.js +350 -0
- package/lib/server/mcp-http-transport.js.map +1 -0
- package/lib/server/mcp-id-alias-service.d.ts +70 -0
- package/lib/server/mcp-id-alias-service.d.ts.map +1 -0
- package/lib/server/mcp-id-alias-service.js +85 -0
- package/lib/server/mcp-id-alias-service.js.map +1 -0
- package/lib/server/mcp-input-schemas.d.ts +73 -0
- package/lib/server/mcp-input-schemas.d.ts.map +1 -0
- package/lib/server/mcp-input-schemas.js +67 -0
- package/lib/server/mcp-input-schemas.js.map +1 -0
- package/lib/server/mcp-label-provider.d.ts +45 -0
- package/lib/server/mcp-label-provider.d.ts.map +1 -0
- package/lib/server/mcp-label-provider.js +42 -0
- package/lib/server/mcp-label-provider.js.map +1 -0
- package/lib/server/mcp-log-level-registry.d.ts +54 -0
- package/lib/server/mcp-log-level-registry.d.ts.map +1 -0
- package/lib/server/mcp-log-level-registry.js +80 -0
- package/lib/server/mcp-log-level-registry.js.map +1 -0
- package/lib/server/mcp-logger.d.ts +59 -0
- package/lib/server/mcp-logger.d.ts.map +1 -0
- package/lib/server/mcp-logger.js +104 -0
- package/lib/server/mcp-logger.js.map +1 -0
- package/lib/server/mcp-mime-types.d.ts +28 -0
- package/lib/server/mcp-mime-types.d.ts.map +1 -0
- package/lib/server/mcp-mime-types.js +18 -0
- package/lib/server/mcp-mime-types.js.map +1 -0
- package/lib/server/mcp-options.d.ts +39 -0
- package/lib/server/mcp-options.d.ts.map +1 -0
- package/lib/server/mcp-options.js +53 -0
- package/lib/server/mcp-options.js.map +1 -0
- package/lib/server/mcp-progress-reporter.d.ts +48 -0
- package/lib/server/mcp-progress-reporter.d.ts.map +1 -0
- package/lib/server/mcp-progress-reporter.js +66 -0
- package/lib/server/mcp-progress-reporter.js.map +1 -0
- package/lib/server/mcp-prompt-handler.d.ts +120 -0
- package/lib/server/mcp-prompt-handler.d.ts.map +1 -0
- package/lib/server/mcp-prompt-handler.js +131 -0
- package/lib/server/mcp-prompt-handler.js.map +1 -0
- package/lib/server/mcp-request-context.d.ts +37 -0
- package/lib/server/mcp-request-context.d.ts.map +1 -0
- package/lib/server/mcp-request-context.js +37 -0
- package/lib/server/mcp-request-context.js.map +1 -0
- package/lib/server/mcp-resource-handler.d.ts +212 -0
- package/lib/server/mcp-resource-handler.d.ts.map +1 -0
- package/lib/server/mcp-resource-handler.js +298 -0
- package/lib/server/mcp-resource-handler.js.map +1 -0
- package/lib/server/mcp-server-launcher.d.ts +143 -0
- package/lib/server/mcp-server-launcher.d.ts.map +1 -0
- package/lib/server/mcp-server-launcher.js +355 -0
- package/lib/server/mcp-server-launcher.js.map +1 -0
- package/lib/server/mcp-server-module.d.ts +143 -0
- package/lib/server/mcp-server-module.d.ts.map +1 -0
- package/lib/server/mcp-server-module.js +249 -0
- package/lib/server/mcp-server-module.js.map +1 -0
- package/lib/server/mcp-session.d.ts +44 -0
- package/lib/server/mcp-session.d.ts.map +1 -0
- package/lib/server/mcp-session.js +18 -0
- package/lib/server/mcp-session.js.map +1 -0
- package/lib/server/mcp-tool-handler.d.ts +259 -0
- package/lib/server/mcp-tool-handler.d.ts.map +1 -0
- package/lib/server/mcp-tool-handler.js +355 -0
- package/lib/server/mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts +46 -0
- package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/count-elements-mcp-tool-handler.js +76 -0
- package/lib/tools/handlers/count-elements-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts +112 -0
- package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/create-edges-mcp-tool-handler.js +190 -0
- package/lib/tools/handlers/create-edges-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts +81 -0
- package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/create-nodes-mcp-tool-handler.js +123 -0
- package/lib/tools/handlers/create-nodes-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts +52 -0
- package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/delete-elements-mcp-tool-handler.js +73 -0
- package/lib/tools/handlers/delete-elements-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts +59 -0
- package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/diagram-model-mcp-tool-handler.js +78 -0
- package/lib/tools/handlers/diagram-model-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts +97 -0
- package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/element-types-mcp-tool-handler.js +155 -0
- package/lib/tools/handlers/element-types-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts +43 -0
- package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/get-selection-mcp-tool-handler.js +68 -0
- package/lib/tools/handlers/get-selection-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/layout-mcp-tool-handler.d.ts +43 -0
- package/lib/tools/handlers/layout-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/layout-mcp-tool-handler.js +71 -0
- package/lib/tools/handlers/layout-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts +78 -0
- package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/modify-edges-mcp-tool-handler.js +136 -0
- package/lib/tools/handlers/modify-edges-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts +92 -0
- package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js +125 -0
- package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts +102 -0
- package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/query-elements-mcp-tool-handler.js +158 -0
- package/lib/tools/handlers/query-elements-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/redo-mcp-tool-handler.d.ts +45 -0
- package/lib/tools/handlers/redo-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/redo-mcp-tool-handler.js +73 -0
- package/lib/tools/handlers/redo-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts +55 -0
- package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/save-model-mcp-tool-handler.js +91 -0
- package/lib/tools/handlers/save-model-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts +65 -0
- package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/session-info-mcp-tool-handler.js +108 -0
- package/lib/tools/handlers/session-info-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts +60 -0
- package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/set-selection-mcp-tool-handler.js +103 -0
- package/lib/tools/handlers/set-selection-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts +110 -0
- package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/set-view-mcp-tool-handler.js +142 -0
- package/lib/tools/handlers/set-view-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/undo-mcp-tool-handler.d.ts +45 -0
- package/lib/tools/handlers/undo-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/undo-mcp-tool-handler.js +74 -0
- package/lib/tools/handlers/undo-mcp-tool-handler.js.map +1 -0
- package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts +66 -0
- package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts.map +1 -0
- package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js +0 -0
- package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js.map +1 -0
- package/lib/tools/index.d.ts +34 -0
- package/lib/tools/index.d.ts.map +1 -0
- package/lib/tools/index.js +50 -0
- package/lib/tools/index.js.map +1 -0
- package/lib/util/index.d.ts +18 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +34 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/markdown-util.d.ts +20 -0
- package/lib/util/markdown-util.d.ts.map +1 -0
- package/lib/util/markdown-util.js +45 -0
- package/lib/util/markdown-util.js.map +1 -0
- package/lib/util/mcp-util.d.ts +22 -0
- package/lib/util/mcp-util.d.ts.map +1 -0
- package/lib/util/mcp-util.js +29 -0
- package/lib/util/mcp-util.js.map +1 -0
- package/package.json +63 -0
- package/src/index.ts +24 -0
- package/src/prompts/handlers/describe-diagram-mcp-prompt-handler.ts +89 -0
- package/src/prompts/handlers/suggest-improvements-mcp-prompt-handler.ts +86 -0
- package/src/prompts/index.ts +18 -0
- package/src/resources/handlers/diagram-png-mcp-resource-handler.ts +181 -0
- package/src/resources/handlers/diagram-svg-mcp-resource-handler.ts +89 -0
- package/src/resources/index.ts +20 -0
- package/src/resources/services/element-types-provider.ts +105 -0
- package/src/resources/services/mcp-model-serializer.ts +211 -0
- package/src/server/glsp-mcp-server.spec.ts +73 -0
- package/src/server/glsp-mcp-server.ts +196 -0
- package/src/server/index.ts +42 -0
- package/src/server/lru-event-store.spec.ts +121 -0
- package/src/server/lru-event-store.ts +112 -0
- package/src/server/mcp-diagram-handler-dispatcher.spec.ts +231 -0
- package/src/server/mcp-diagram-handler-dispatcher.ts +459 -0
- package/src/server/mcp-diagram-module.ts +248 -0
- package/src/server/mcp-diagram-prompt-handler-registry.ts +59 -0
- package/src/server/mcp-diagram-resource-handler-registry.ts +73 -0
- package/src/server/mcp-diagram-tool-handler-registry.ts +97 -0
- package/src/server/mcp-handler-shared.spec.ts +53 -0
- package/src/server/mcp-handler-shared.ts +247 -0
- package/src/server/mcp-http-transport-e2e.spec.ts +151 -0
- package/src/server/mcp-http-transport.spec.ts +385 -0
- package/src/server/mcp-http-transport.ts +368 -0
- package/src/server/mcp-id-alias-service.spec.ts +106 -0
- package/src/server/mcp-id-alias-service.ts +104 -0
- package/src/server/mcp-input-schemas.ts +82 -0
- package/src/server/mcp-label-provider.ts +52 -0
- package/src/server/mcp-log-level-registry.spec.ts +75 -0
- package/src/server/mcp-log-level-registry.ts +90 -0
- package/src/server/mcp-logger.spec.ts +227 -0
- package/src/server/mcp-logger.ts +91 -0
- package/src/server/mcp-mime-types.ts +31 -0
- package/src/server/mcp-options.ts +43 -0
- package/src/server/mcp-progress-reporter.spec.ts +93 -0
- package/src/server/mcp-progress-reporter.ts +67 -0
- package/src/server/mcp-prompt-handler.ts +157 -0
- package/src/server/mcp-request-context.ts +39 -0
- package/src/server/mcp-resource-handler.ts +389 -0
- package/src/server/mcp-server-launcher.spec.ts +173 -0
- package/src/server/mcp-server-launcher.ts +369 -0
- package/src/server/mcp-server-module.ts +287 -0
- package/src/server/mcp-session.ts +45 -0
- package/src/server/mcp-tool-handler.spec.ts +182 -0
- package/src/server/mcp-tool-handler.ts +431 -0
- package/src/server/raw-http.spec.ts +59 -0
- package/src/tools/handlers/count-elements-mcp-tool-handler.spec.ts +99 -0
- package/src/tools/handlers/count-elements-mcp-tool-handler.ts +66 -0
- package/src/tools/handlers/create-edges-mcp-tool-handler.spec.ts +196 -0
- package/src/tools/handlers/create-edges-mcp-tool-handler.ts +205 -0
- package/src/tools/handlers/create-nodes-mcp-tool-handler.spec.ts +197 -0
- package/src/tools/handlers/create-nodes-mcp-tool-handler.ts +131 -0
- package/src/tools/handlers/delete-elements-mcp-tool-handler.ts +73 -0
- package/src/tools/handlers/diagram-model-mcp-tool-handler.ts +66 -0
- package/src/tools/handlers/element-types-mcp-tool-handler.ts +151 -0
- package/src/tools/handlers/get-selection-mcp-tool-handler.ts +54 -0
- package/src/tools/handlers/layout-mcp-tool-handler.ts +56 -0
- package/src/tools/handlers/modify-edges-mcp-tool-handler.ts +148 -0
- package/src/tools/handlers/modify-nodes-mcp-tool-handler.ts +140 -0
- package/src/tools/handlers/query-elements-mcp-tool-handler.spec.ts +210 -0
- package/src/tools/handlers/query-elements-mcp-tool-handler.ts +161 -0
- package/src/tools/handlers/redo-mcp-tool-handler.ts +62 -0
- package/src/tools/handlers/save-model-mcp-tool-handler.ts +71 -0
- package/src/tools/handlers/session-info-mcp-tool-handler.spec.ts +152 -0
- package/src/tools/handlers/session-info-mcp-tool-handler.ts +97 -0
- package/src/tools/handlers/set-selection-mcp-tool-handler.spec.ts +118 -0
- package/src/tools/handlers/set-selection-mcp-tool-handler.ts +90 -0
- package/src/tools/handlers/set-view-mcp-tool-handler.ts +162 -0
- package/src/tools/handlers/undo-mcp-tool-handler.ts +61 -0
- package/src/tools/handlers/validate-diagram-mcp-tool-handler.ts +0 -0
- package/src/tools/index.ts +34 -0
- package/src/tools/tool-annotations.spec.ts +141 -0
- package/src/util/index.ts +18 -0
- package/src/util/markdown-util.ts +44 -0
- package/src/util/mcp-util.ts +25 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2025-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 { ClientSessionManager, Disposable, DisposableCollection, GLSPServer, GLSPServerInitializer, GLSPServerListener, InitializeParameters, InitializeResult, Logger, McpServerConfiguration, McpServerInitOptions } from '@eclipse-glsp/server';
|
|
17
|
+
import { ServerCapabilities } from '@modelcontextprotocol/sdk/types.js';
|
|
18
|
+
import { GLSPMcpServer, GLSPMcpServerFactory } from './glsp-mcp-server';
|
|
19
|
+
import { McpDiagramHandlerDispatcher } from './mcp-diagram-handler-dispatcher';
|
|
20
|
+
import { McpHttpTransport } from './mcp-http-transport';
|
|
21
|
+
import { McpLogLevelRegistry } from './mcp-log-level-registry';
|
|
22
|
+
import { McpServerDefaults, McpServerOptions } from './mcp-options';
|
|
23
|
+
import { McpPromptHandler } from './mcp-prompt-handler';
|
|
24
|
+
import { McpResourceHandler } from './mcp-resource-handler';
|
|
25
|
+
import { McpSession } from './mcp-session';
|
|
26
|
+
import { McpToolHandler } from './mcp-tool-handler';
|
|
27
|
+
/**
|
|
28
|
+
* Stdout tag used to announce the started MCP server so IDE integrations can pick up the URL
|
|
29
|
+
* automatically. The full line is `MCP_SERVER_READY_MSG + JSON.stringify({name, url, route})`,
|
|
30
|
+
* mirroring how the GLSP server itself announces its port via `START_UP_COMPLETE_MSG`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MCP_SERVER_READY_MSG = "[GLSP-MCP-Server]:Ready. ";
|
|
33
|
+
/**
|
|
34
|
+
* Server version reported in MCP `initialize` handshake responses (the SDK's `serverInfo.version`
|
|
35
|
+
* field). Sourced from the package's own `package.json` so adopters and clients can tell builds
|
|
36
|
+
* apart without the server author having to remember to bump a literal.
|
|
37
|
+
*/
|
|
38
|
+
export declare const SERVER_VERSION: string;
|
|
39
|
+
/**
|
|
40
|
+
* Launcher's internal handoff shape: everything from the public {@link McpServerConfiguration}
|
|
41
|
+
* with all fields resolved, plus `host`. `host` is deliberately *not* in the public protocol's
|
|
42
|
+
* init schema — it lives on `McpServerDeployOptions` (deploy-only) rather than
|
|
43
|
+
* `McpServerInitOptions` (init-controllable). The launcher reads it from the adopter-supplied
|
|
44
|
+
* defaults via `McpServerOptions.values.host` (whose ship default lives in
|
|
45
|
+
* `DefaultMcpServerModule.DEFAULT_OPTIONS`). The init/deploy split limits blast radius:
|
|
46
|
+
* MCP clients can negotiate behavioral fields like `port` over the wire, but security-sensitive
|
|
47
|
+
* fields like the bind interface are settable only by the adopter at process start.
|
|
48
|
+
*/
|
|
49
|
+
export type FullMcpServerConfiguration = Required<McpServerConfiguration> & {
|
|
50
|
+
host: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Defense-in-depth filter for the init-side options payload. The static type already rules
|
|
54
|
+
* out deploy-only fields (`host`, `allowedHosts`, `allowedOrigins`, `acknowledgedNoAuth`) on
|
|
55
|
+
* `McpServerConfiguration.options`, but the wire payload is JSON, so a malformed or
|
|
56
|
+
* malicious client could smuggle extra keys. Destructure-based pick drops anything outside
|
|
57
|
+
* the allowed set so deploy-only fields are sourced *only* from adopter defaults.
|
|
58
|
+
*
|
|
59
|
+
* **Update this allowlist when adding a field to `McpServerInitOptions`** — the destructure
|
|
60
|
+
* below is the single source of truth for which init-side fields cross the wire.
|
|
61
|
+
*
|
|
62
|
+
* Exported for regression-test access only; not part of the public package surface.
|
|
63
|
+
*/
|
|
64
|
+
export declare function pickInitOptions(options: McpServerInitOptions): McpServerInitOptions;
|
|
65
|
+
/**
|
|
66
|
+
* Returns true iff `host` is a loopback bind: `localhost`, `::1`, or any IPv4 in
|
|
67
|
+
* `127.0.0.0/8`. Any other value (`0.0.0.0`, `::`, LAN/public addresses) is non-loopback.
|
|
68
|
+
* Used by {@link assertLoopbackOrAcknowledged} for the auth-footgun runtime check.
|
|
69
|
+
*/
|
|
70
|
+
export declare function isLoopbackHost(host: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Refuse to bind on a non-loopback host unless the operator has acknowledged that traffic is
|
|
73
|
+
* authenticated externally (reverse proxy, mTLS, ACL). The MCP server has no built-in auth.
|
|
74
|
+
* Exported for regression tests only; not part of the public surface.
|
|
75
|
+
*/
|
|
76
|
+
export declare function assertLoopbackOrAcknowledged(host: string, acknowledgedNoAuth: boolean | undefined): void;
|
|
77
|
+
/**
|
|
78
|
+
* Boots the embedded MCP HTTP server when a GLSP `initialize` call carries an `mcpServer`
|
|
79
|
+
* configuration. Runs in-process via the {@link GLSPServerInitializer} lifecycle — not a
|
|
80
|
+
* separate process runner. Diagram-scope handler discovery and dispatch are delegated to
|
|
81
|
+
* {@link McpDiagramHandlerDispatcher}.
|
|
82
|
+
*/
|
|
83
|
+
export declare class McpServerLauncher implements GLSPServerInitializer, GLSPServerListener, Disposable {
|
|
84
|
+
protected logger: Logger;
|
|
85
|
+
protected mcpOptions: McpServerOptions;
|
|
86
|
+
protected mcpDefaults: McpServerDefaults;
|
|
87
|
+
protected transport: McpHttpTransport;
|
|
88
|
+
protected glspMcpServerFactory: GLSPMcpServerFactory;
|
|
89
|
+
protected dispatcher: McpDiagramHandlerDispatcher;
|
|
90
|
+
protected logLevelRegistry: McpLogLevelRegistry;
|
|
91
|
+
protected clientSessionManager: ClientSessionManager;
|
|
92
|
+
protected toolHandlers: McpToolHandler[];
|
|
93
|
+
protected resourceHandlers: McpResourceHandler[];
|
|
94
|
+
protected promptHandlers: McpPromptHandler[];
|
|
95
|
+
protected toDispose: DisposableCollection;
|
|
96
|
+
protected serverUrl: string | undefined;
|
|
97
|
+
protected serverConfig: FullMcpServerConfiguration | undefined;
|
|
98
|
+
/** Per-MCP-session GLSPMcpServer registry — populated on session-init, cleared on session-close. */
|
|
99
|
+
protected readonly sessionServers: Map<string, GLSPMcpServer>;
|
|
100
|
+
initializeServer(server: GLSPServer, params: InitializeParameters, result: InitializeResult): Promise<InitializeResult>;
|
|
101
|
+
protected onSessionInitialized(client: McpSession, config: FullMcpServerConfiguration): void;
|
|
102
|
+
protected onSessionClosed(sessionId: string): void;
|
|
103
|
+
/**
|
|
104
|
+
* Fire `notifications/resources/list_changed` to every connected MCP client when a GLSP
|
|
105
|
+
* session opens or closes — diagram-scope resources aggregate across GLSP sessions, so the
|
|
106
|
+
* visible list mutates with that lifecycle. No-op when no diagram-scope resources are bound.
|
|
107
|
+
*/
|
|
108
|
+
protected installResourceListChangedNotifier(): void;
|
|
109
|
+
/** Best-effort fan-out — failures on individual MCP sessions (e.g. transport mid-close) are swallowed. */
|
|
110
|
+
protected broadcastResourceListChanged(): void;
|
|
111
|
+
/** Register `logging/setLevel` so a connected MCP client can adjust its message severity threshold. */
|
|
112
|
+
protected registerLogLevelHandler(glspMcpServer: GLSPMcpServer, sessionId: string): void;
|
|
113
|
+
protected createGlspMcpServer({ name, options }: FullMcpServerConfiguration): GLSPMcpServer;
|
|
114
|
+
/**
|
|
115
|
+
* Build the MCP capabilities map from what is actually bound. Only declare a key when at
|
|
116
|
+
* least one handler contributes — declaring a capability the SDK never registers a handler
|
|
117
|
+
* for produces `-32601 Method not found` on `<cap>/list`. Resources surfaced as tools
|
|
118
|
+
* (`dataMode === 'tools'`) count toward `tools`, not `resources`.
|
|
119
|
+
*/
|
|
120
|
+
protected buildCapabilities(resourcesAsResources: boolean): ServerCapabilities;
|
|
121
|
+
/**
|
|
122
|
+
* Registers tool/resource/prompt handlers against the per-MCP-session GLSP MCP server. Two
|
|
123
|
+
* sources flow into the catalog:
|
|
124
|
+
*
|
|
125
|
+
* 1. **Server-scope handlers**: singletons bound under `McpToolHandler` /
|
|
126
|
+
* `McpResourceHandler` / `McpPromptHandler`. Registered via their `register*(server)`
|
|
127
|
+
* methods — they're already-instantiated objects that close over their own state.
|
|
128
|
+
*
|
|
129
|
+
* 2. **Diagram-scope handlers**: registered by {@link McpDiagramHandlerDispatcher}, which
|
|
130
|
+
* walks the catalogs harvested at server start and dispatches each registered SDK
|
|
131
|
+
* callback by `params.sessionId` → per-GLSP-session container → registry lookup.
|
|
132
|
+
*/
|
|
133
|
+
protected registerHandlers(glspMcpServer: GLSPMcpServer, resourcesAsResources: boolean): void;
|
|
134
|
+
/**
|
|
135
|
+
* Warn when a server-scope prompt's {@link AbstractMcpPromptHandler.referencedToolNames}
|
|
136
|
+
* contains a name not registered on this MCP session — catches adopters who unbind a tool
|
|
137
|
+
* a shipped prompt references via `${OtherHandler.NAME}`.
|
|
138
|
+
*/
|
|
139
|
+
protected validatePromptToolReferences(glspMcpServer: GLSPMcpServer): void;
|
|
140
|
+
serverShutDown(server: GLSPServer): void;
|
|
141
|
+
dispose(): void;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=mcp-server-launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server-launcher.d.ts","sourceRoot":"","sources":["../../src/server/mcp-server-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAEH,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,MAAM,EAGN,sB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,IAAI,EAAE,OAAO,EAAE,EAAE,0BAA0B,GAAG,aAAa;IAc3F;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,oBAAoB,EAAE,OAAO,GAAG,kBAAkB;IAyB9E;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,OAAO,GAAG,IAAI;IAa7F;;;;OAIG;IACH,SAAS,CAAC,4BAA4B,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;IAY1E,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAIxC,OAAO,IAAI,IAAI;CASlB"}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2025-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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.McpServerLauncher = exports.SERVER_VERSION = exports.MCP_SERVER_READY_MSG = void 0;
|
|
28
|
+
exports.pickInitOptions = pickInitOptions;
|
|
29
|
+
exports.isLoopbackHost = isLoopbackHost;
|
|
30
|
+
exports.assertLoopbackOrAcknowledged = assertLoopbackOrAcknowledged;
|
|
31
|
+
const server_1 = require("@eclipse-glsp/server");
|
|
32
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
33
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
34
|
+
const inversify_1 = require("inversify");
|
|
35
|
+
const package_json_1 = require("../../package.json");
|
|
36
|
+
const glsp_mcp_server_1 = require("./glsp-mcp-server");
|
|
37
|
+
const mcp_diagram_handler_dispatcher_1 = require("./mcp-diagram-handler-dispatcher");
|
|
38
|
+
const mcp_http_transport_1 = require("./mcp-http-transport");
|
|
39
|
+
const mcp_log_level_registry_1 = require("./mcp-log-level-registry");
|
|
40
|
+
const mcp_options_1 = require("./mcp-options");
|
|
41
|
+
const mcp_prompt_handler_1 = require("./mcp-prompt-handler");
|
|
42
|
+
const mcp_resource_handler_1 = require("./mcp-resource-handler");
|
|
43
|
+
const mcp_tool_handler_1 = require("./mcp-tool-handler");
|
|
44
|
+
/**
|
|
45
|
+
* Stdout tag used to announce the started MCP server so IDE integrations can pick up the URL
|
|
46
|
+
* automatically. The full line is `MCP_SERVER_READY_MSG + JSON.stringify({name, url, route})`,
|
|
47
|
+
* mirroring how the GLSP server itself announces its port via `START_UP_COMPLETE_MSG`.
|
|
48
|
+
*/
|
|
49
|
+
exports.MCP_SERVER_READY_MSG = '[GLSP-MCP-Server]:Ready. ';
|
|
50
|
+
/**
|
|
51
|
+
* Server version reported in MCP `initialize` handshake responses (the SDK's `serverInfo.version`
|
|
52
|
+
* field). Sourced from the package's own `package.json` so adopters and clients can tell builds
|
|
53
|
+
* apart without the server author having to remember to bump a literal.
|
|
54
|
+
*/
|
|
55
|
+
exports.SERVER_VERSION = package_json_1.version;
|
|
56
|
+
/**
|
|
57
|
+
* Defense-in-depth filter for the init-side options payload. The static type already rules
|
|
58
|
+
* out deploy-only fields (`host`, `allowedHosts`, `allowedOrigins`, `acknowledgedNoAuth`) on
|
|
59
|
+
* `McpServerConfiguration.options`, but the wire payload is JSON, so a malformed or
|
|
60
|
+
* malicious client could smuggle extra keys. Destructure-based pick drops anything outside
|
|
61
|
+
* the allowed set so deploy-only fields are sourced *only* from adopter defaults.
|
|
62
|
+
*
|
|
63
|
+
* **Update this allowlist when adding a field to `McpServerInitOptions`** — the destructure
|
|
64
|
+
* below is the single source of truth for which init-side fields cross the wire.
|
|
65
|
+
*
|
|
66
|
+
* Exported for regression-test access only; not part of the public package surface.
|
|
67
|
+
*/
|
|
68
|
+
function pickInitOptions(options) {
|
|
69
|
+
const { dataMode, agentPersona, eventStoreLimit } = options;
|
|
70
|
+
const picked = {};
|
|
71
|
+
if (dataMode !== undefined)
|
|
72
|
+
picked.dataMode = dataMode;
|
|
73
|
+
if (agentPersona !== undefined)
|
|
74
|
+
picked.agentPersona = agentPersona;
|
|
75
|
+
if (eventStoreLimit !== undefined)
|
|
76
|
+
picked.eventStoreLimit = eventStoreLimit;
|
|
77
|
+
return picked;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Returns true iff `host` is a loopback bind: `localhost`, `::1`, or any IPv4 in
|
|
81
|
+
* `127.0.0.0/8`. Any other value (`0.0.0.0`, `::`, LAN/public addresses) is non-loopback.
|
|
82
|
+
* Used by {@link assertLoopbackOrAcknowledged} for the auth-footgun runtime check.
|
|
83
|
+
*/
|
|
84
|
+
function isLoopbackHost(host) {
|
|
85
|
+
return host === 'localhost' || host === '::1' || /^127\./.test(host);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Refuse to bind on a non-loopback host unless the operator has acknowledged that traffic is
|
|
89
|
+
* authenticated externally (reverse proxy, mTLS, ACL). The MCP server has no built-in auth.
|
|
90
|
+
* Exported for regression tests only; not part of the public surface.
|
|
91
|
+
*/
|
|
92
|
+
function assertLoopbackOrAcknowledged(host, acknowledgedNoAuth) {
|
|
93
|
+
if (isLoopbackHost(host) || acknowledgedNoAuth === true) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
throw new Error(`Refusing to bind MCP server to non-loopback host '${host}' without authentication. ` +
|
|
97
|
+
'The MCP server has no built-in auth; binding to a non-loopback interface exposes an ' +
|
|
98
|
+
'unauthenticated MCP endpoint to the network. If this is intentional (e.g., the endpoint ' +
|
|
99
|
+
'is fronted by a reverse proxy, mTLS, or a network ACL that authenticates traffic), set ' +
|
|
100
|
+
'`acknowledgedNoAuth: true` on the McpServerDefaults you pass to the server module.');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Boots the embedded MCP HTTP server when a GLSP `initialize` call carries an `mcpServer`
|
|
104
|
+
* configuration. Runs in-process via the {@link GLSPServerInitializer} lifecycle — not a
|
|
105
|
+
* separate process runner. Diagram-scope handler discovery and dispatch are delegated to
|
|
106
|
+
* {@link McpDiagramHandlerDispatcher}.
|
|
107
|
+
*/
|
|
108
|
+
let McpServerLauncher = class McpServerLauncher {
|
|
109
|
+
constructor() {
|
|
110
|
+
this.toolHandlers = [];
|
|
111
|
+
this.resourceHandlers = [];
|
|
112
|
+
this.promptHandlers = [];
|
|
113
|
+
this.toDispose = new server_1.DisposableCollection();
|
|
114
|
+
/** Per-MCP-session GLSPMcpServer registry — populated on session-init, cleared on session-close. */
|
|
115
|
+
this.sessionServers = new Map();
|
|
116
|
+
}
|
|
117
|
+
async initializeServer(server, params, result) {
|
|
118
|
+
var _a, _b;
|
|
119
|
+
const mcpServerParam = server_1.McpInitializeParameters.getServerConfig(params);
|
|
120
|
+
if (!mcpServerParam) {
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
// Idempotent: subsequent client sessions of the same GLSP server reuse the existing
|
|
124
|
+
// MCP HTTP server. Only the first call starts it.
|
|
125
|
+
if (this.serverUrl && this.serverConfig) {
|
|
126
|
+
return server_1.McpInitializeResult.attachServer(result, { name: this.serverConfig.name, url: this.serverUrl });
|
|
127
|
+
}
|
|
128
|
+
// Port defaults to 0 (random); the resolved URL is announced via the stdout marker
|
|
129
|
+
// below. `host` is intentionally NOT in the init-time schema — it comes from the
|
|
130
|
+
// server module's adopter defaults (no DNS-rebinding foot-gun via the LLM path).
|
|
131
|
+
const { port = 0, route = '/mcp', name = 'glsp', options = {} } = mcpServerParam;
|
|
132
|
+
// Init-time options win per field, but only fields in the init allowlist —
|
|
133
|
+
// `pickInitOptions` strips any wire-smuggled deploy-only keys before merge.
|
|
134
|
+
const mergedOptions = { ...this.mcpDefaults, ...pickInitOptions(options) };
|
|
135
|
+
this.mcpOptions.values = mergedOptions;
|
|
136
|
+
const host = (_a = mergedOptions.host) !== null && _a !== void 0 ? _a : '127.0.0.1';
|
|
137
|
+
// Auth-footgun guard: refuse non-loopback bind unless the operator opted in via
|
|
138
|
+
// `acknowledgedNoAuth`. Runs BEFORE the transport binds the socket so a careless
|
|
139
|
+
// `host: '0.0.0.0'` doesn't get a chance to expose an unauthenticated endpoint.
|
|
140
|
+
assertLoopbackOrAcknowledged(host, mergedOptions.acknowledgedNoAuth);
|
|
141
|
+
const mcpServerConfig = { port, host, route, name, options: mergedOptions };
|
|
142
|
+
this.dispatcher.harvest();
|
|
143
|
+
// Capture the per-init subscription disposables so a dispose-then-restart cycle
|
|
144
|
+
// (transport is `inSingletonScope()`) doesn't accumulate stale listeners.
|
|
145
|
+
this.toDispose.push(this.transport.onSessionInitialized(client => this.onSessionInitialized(client, mcpServerConfig)));
|
|
146
|
+
this.toDispose.push(this.transport.onSessionClosed(sessionId => this.onSessionClosed(sessionId)));
|
|
147
|
+
this.toDispose.push(this.transport);
|
|
148
|
+
this.installResourceListChangedNotifier();
|
|
149
|
+
const endpoint = await this.transport.start(mcpServerConfig);
|
|
150
|
+
this.serverUrl = endpoint.url;
|
|
151
|
+
this.serverConfig = mcpServerConfig;
|
|
152
|
+
this.logger.info(`MCP server '${mcpServerConfig.name}' is ready to accept new client requests on: ${(_b = this.serverUrl) !== null && _b !== void 0 ? _b : '(no network endpoint)'}`);
|
|
153
|
+
// stdout ready-marker for parent processes to discover the URL. Uses `console.log`
|
|
154
|
+
// (not the GLSP logger) so adopter logger config can never hide it.
|
|
155
|
+
console.log(exports.MCP_SERVER_READY_MSG + JSON.stringify({ name: mcpServerConfig.name, url: this.serverUrl, route }));
|
|
156
|
+
if (endpoint.url) {
|
|
157
|
+
return server_1.McpInitializeResult.attachServer(result, {
|
|
158
|
+
name: mcpServerConfig.name,
|
|
159
|
+
url: endpoint.url,
|
|
160
|
+
headers: endpoint.headers
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
onSessionInitialized(client, config) {
|
|
166
|
+
this.logger.info(`MCP session initialized with ID: ${client.sessionId}`);
|
|
167
|
+
const glspMcpServer = this.createGlspMcpServer(config);
|
|
168
|
+
this.sessionServers.set(client.sessionId, glspMcpServer);
|
|
169
|
+
this.registerLogLevelHandler(glspMcpServer, client.sessionId);
|
|
170
|
+
// server assumes control of the connection
|
|
171
|
+
glspMcpServer.connect(client);
|
|
172
|
+
}
|
|
173
|
+
onSessionClosed(sessionId) {
|
|
174
|
+
const glspMcpServer = this.sessionServers.get(sessionId);
|
|
175
|
+
if (glspMcpServer) {
|
|
176
|
+
this.sessionServers.delete(sessionId);
|
|
177
|
+
this.logLevelRegistry.clear(sessionId);
|
|
178
|
+
// The transport already closes the client end; close the SDK server end too.
|
|
179
|
+
glspMcpServer.dispose();
|
|
180
|
+
this.logger.info(`MCP session closed: ${sessionId}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Fire `notifications/resources/list_changed` to every connected MCP client when a GLSP
|
|
185
|
+
* session opens or closes — diagram-scope resources aggregate across GLSP sessions, so the
|
|
186
|
+
* visible list mutates with that lifecycle. No-op when no diagram-scope resources are bound.
|
|
187
|
+
*/
|
|
188
|
+
installResourceListChangedNotifier() {
|
|
189
|
+
if (!this.dispatcher.hasDiagramResources()) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const listener = {
|
|
193
|
+
sessionCreated: () => this.broadcastResourceListChanged(),
|
|
194
|
+
sessionDisposed: () => this.broadcastResourceListChanged()
|
|
195
|
+
};
|
|
196
|
+
this.clientSessionManager.addListener(listener);
|
|
197
|
+
this.toDispose.push(server_1.Disposable.create(() => this.clientSessionManager.removeListener(listener)));
|
|
198
|
+
}
|
|
199
|
+
/** Best-effort fan-out — failures on individual MCP sessions (e.g. transport mid-close) are swallowed. */
|
|
200
|
+
broadcastResourceListChanged() {
|
|
201
|
+
for (const glspMcpServer of this.sessionServers.values()) {
|
|
202
|
+
glspMcpServer
|
|
203
|
+
.getRawServer()
|
|
204
|
+
.server.sendResourceListChanged()
|
|
205
|
+
.catch(err => this.logger.debug('sendResourceListChanged failed:', err));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/** Register `logging/setLevel` so a connected MCP client can adjust its message severity threshold. */
|
|
209
|
+
registerLogLevelHandler(glspMcpServer, sessionId) {
|
|
210
|
+
glspMcpServer.getRawServer().server.setRequestHandler(types_js_1.SetLevelRequestSchema, async (request) => {
|
|
211
|
+
this.logLevelRegistry.setLevel(sessionId, request.params.level);
|
|
212
|
+
return {};
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
createGlspMcpServer({ name, options }) {
|
|
216
|
+
const resourcesAsResources = options.dataMode === 'resources';
|
|
217
|
+
const server = new mcp_js_1.McpServer({ name, version: exports.SERVER_VERSION }, {
|
|
218
|
+
capabilities: this.buildCapabilities(resourcesAsResources),
|
|
219
|
+
instructions: options.agentPersona
|
|
220
|
+
});
|
|
221
|
+
const glspMcpServer = this.glspMcpServerFactory(server, options);
|
|
222
|
+
this.registerHandlers(glspMcpServer, resourcesAsResources);
|
|
223
|
+
return glspMcpServer;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Build the MCP capabilities map from what is actually bound. Only declare a key when at
|
|
227
|
+
* least one handler contributes — declaring a capability the SDK never registers a handler
|
|
228
|
+
* for produces `-32601 Method not found` on `<cap>/list`. Resources surfaced as tools
|
|
229
|
+
* (`dataMode === 'tools'`) count toward `tools`, not `resources`.
|
|
230
|
+
*/
|
|
231
|
+
buildCapabilities(resourcesAsResources) {
|
|
232
|
+
const hasStaticTools = this.toolHandlers.length > 0;
|
|
233
|
+
const hasStaticPrompts = this.promptHandlers.length > 0;
|
|
234
|
+
const hasStaticResources = this.resourceHandlers.length > 0;
|
|
235
|
+
const hasDiagramTools = this.dispatcher.hasDiagramTools();
|
|
236
|
+
const hasDiagramPrompts = this.dispatcher.hasDiagramPrompts();
|
|
237
|
+
const hasDiagramResources = this.dispatcher.hasDiagramResources();
|
|
238
|
+
const anyResources = hasStaticResources || hasDiagramResources;
|
|
239
|
+
const hasTools = hasStaticTools || hasDiagramTools || (!resourcesAsResources && anyResources);
|
|
240
|
+
const hasPrompts = hasStaticPrompts || hasDiagramPrompts;
|
|
241
|
+
const hasResources = resourcesAsResources && anyResources;
|
|
242
|
+
return {
|
|
243
|
+
logging: {},
|
|
244
|
+
...(hasTools ? { tools: { listChanged: false } } : {}),
|
|
245
|
+
// `resources.listChanged: true` iff the catalog contains diagram-scope resources —
|
|
246
|
+
// those aggregate across open GLSP sessions, so the visible list mutates with
|
|
247
|
+
// session add/remove. Server-scope-only catalogs are static, so the flag stays
|
|
248
|
+
// honest at `false` (the SDK reads it; clients refetch only when notified).
|
|
249
|
+
...(hasResources ? { resources: { listChanged: hasDiagramResources } } : {}),
|
|
250
|
+
...(hasPrompts ? { prompts: { listChanged: false } } : {})
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Registers tool/resource/prompt handlers against the per-MCP-session GLSP MCP server. Two
|
|
255
|
+
* sources flow into the catalog:
|
|
256
|
+
*
|
|
257
|
+
* 1. **Server-scope handlers**: singletons bound under `McpToolHandler` /
|
|
258
|
+
* `McpResourceHandler` / `McpPromptHandler`. Registered via their `register*(server)`
|
|
259
|
+
* methods — they're already-instantiated objects that close over their own state.
|
|
260
|
+
*
|
|
261
|
+
* 2. **Diagram-scope handlers**: registered by {@link McpDiagramHandlerDispatcher}, which
|
|
262
|
+
* walks the catalogs harvested at server start and dispatches each registered SDK
|
|
263
|
+
* callback by `params.sessionId` → per-GLSP-session container → registry lookup.
|
|
264
|
+
*/
|
|
265
|
+
registerHandlers(glspMcpServer, resourcesAsResources) {
|
|
266
|
+
this.toolHandlers.forEach(handler => handler.registerTool(glspMcpServer));
|
|
267
|
+
this.promptHandlers.forEach(handler => handler.registerPrompt(glspMcpServer));
|
|
268
|
+
if (resourcesAsResources) {
|
|
269
|
+
this.resourceHandlers.forEach(handler => handler.registerResource(glspMcpServer));
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
this.resourceHandlers.forEach(handler => { var _a; return (_a = handler.registerToolAlternative) === null || _a === void 0 ? void 0 : _a.call(handler, glspMcpServer); });
|
|
273
|
+
}
|
|
274
|
+
this.dispatcher.registerAll(glspMcpServer, resourcesAsResources);
|
|
275
|
+
this.validatePromptToolReferences(glspMcpServer);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Warn when a server-scope prompt's {@link AbstractMcpPromptHandler.referencedToolNames}
|
|
279
|
+
* contains a name not registered on this MCP session — catches adopters who unbind a tool
|
|
280
|
+
* a shipped prompt references via `${OtherHandler.NAME}`.
|
|
281
|
+
*/
|
|
282
|
+
validatePromptToolReferences(glspMcpServer) {
|
|
283
|
+
for (const handler of this.promptHandlers) {
|
|
284
|
+
const missing = handler.referencedToolNames().filter(name => !glspMcpServer.hasTool(name));
|
|
285
|
+
if (missing.length > 0) {
|
|
286
|
+
this.logger.warn(`Prompt '${handler.name}' references unbound tool(s): ${missing.join(', ')}. ` +
|
|
287
|
+
'The prompt will still register but its text points at tools the LLM cannot invoke.');
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
serverShutDown(server) {
|
|
292
|
+
this.dispose();
|
|
293
|
+
}
|
|
294
|
+
dispose() {
|
|
295
|
+
this.sessionServers.forEach(glspMcpServer => glspMcpServer.dispose());
|
|
296
|
+
this.sessionServers.clear();
|
|
297
|
+
this.toDispose.dispose();
|
|
298
|
+
this.toDispose.clear();
|
|
299
|
+
this.serverUrl = undefined;
|
|
300
|
+
this.serverConfig = undefined;
|
|
301
|
+
this.dispatcher.reset();
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
exports.McpServerLauncher = McpServerLauncher;
|
|
305
|
+
__decorate([
|
|
306
|
+
(0, inversify_1.inject)(server_1.Logger),
|
|
307
|
+
__metadata("design:type", server_1.Logger)
|
|
308
|
+
], McpServerLauncher.prototype, "logger", void 0);
|
|
309
|
+
__decorate([
|
|
310
|
+
(0, inversify_1.inject)(mcp_options_1.McpServerOptions),
|
|
311
|
+
__metadata("design:type", mcp_options_1.McpServerOptions)
|
|
312
|
+
], McpServerLauncher.prototype, "mcpOptions", void 0);
|
|
313
|
+
__decorate([
|
|
314
|
+
(0, inversify_1.inject)(mcp_options_1.McpServerDefaults),
|
|
315
|
+
__metadata("design:type", Object)
|
|
316
|
+
], McpServerLauncher.prototype, "mcpDefaults", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
(0, inversify_1.inject)(mcp_http_transport_1.McpHttpTransport),
|
|
319
|
+
__metadata("design:type", mcp_http_transport_1.McpHttpTransport)
|
|
320
|
+
], McpServerLauncher.prototype, "transport", void 0);
|
|
321
|
+
__decorate([
|
|
322
|
+
(0, inversify_1.inject)(glsp_mcp_server_1.GLSPMcpServerFactory),
|
|
323
|
+
__metadata("design:type", Function)
|
|
324
|
+
], McpServerLauncher.prototype, "glspMcpServerFactory", void 0);
|
|
325
|
+
__decorate([
|
|
326
|
+
(0, inversify_1.inject)(mcp_diagram_handler_dispatcher_1.McpDiagramHandlerDispatcher),
|
|
327
|
+
__metadata("design:type", Object)
|
|
328
|
+
], McpServerLauncher.prototype, "dispatcher", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
(0, inversify_1.inject)(mcp_log_level_registry_1.McpLogLevelRegistry),
|
|
331
|
+
__metadata("design:type", Object)
|
|
332
|
+
], McpServerLauncher.prototype, "logLevelRegistry", void 0);
|
|
333
|
+
__decorate([
|
|
334
|
+
(0, inversify_1.inject)(server_1.ClientSessionManager),
|
|
335
|
+
__metadata("design:type", Object)
|
|
336
|
+
], McpServerLauncher.prototype, "clientSessionManager", void 0);
|
|
337
|
+
__decorate([
|
|
338
|
+
(0, inversify_1.multiInject)(mcp_tool_handler_1.McpToolHandler),
|
|
339
|
+
(0, inversify_1.optional)(),
|
|
340
|
+
__metadata("design:type", Array)
|
|
341
|
+
], McpServerLauncher.prototype, "toolHandlers", void 0);
|
|
342
|
+
__decorate([
|
|
343
|
+
(0, inversify_1.multiInject)(mcp_resource_handler_1.McpResourceHandler),
|
|
344
|
+
(0, inversify_1.optional)(),
|
|
345
|
+
__metadata("design:type", Array)
|
|
346
|
+
], McpServerLauncher.prototype, "resourceHandlers", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
(0, inversify_1.multiInject)(mcp_prompt_handler_1.McpPromptHandler),
|
|
349
|
+
(0, inversify_1.optional)(),
|
|
350
|
+
__metadata("design:type", Array)
|
|
351
|
+
], McpServerLauncher.prototype, "promptHandlers", void 0);
|
|
352
|
+
exports.McpServerLauncher = McpServerLauncher = __decorate([
|
|
353
|
+
(0, inversify_1.injectable)()
|
|
354
|
+
], McpServerLauncher);
|
|
355
|
+
//# sourceMappingURL=mcp-server-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server-launcher.js","sourceRoot":"","sources":["../../src/server/mcp-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAsElF,0CAOC;AAOD,wCAEC;AAOD,oEAWC;AAtGD,iDAe8B;AAC9B,oEAAoE;AACpE,iEAA+F;AAC/F,yCAAsE;AACtE,qDAA+D;AAC/D,uDAAwE;AACxE,qFAA+E;AAC/E,6DAAwD;AACxD,qEAA+D;AAC/D,+CAAoE;AACpE,6DAAwD;AACxD,iEAA4D;AAE5D,yDAAoD;AAEpD;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE;;;;GAIG;AACU,QAAA,cAAc,GAAW,sBAAc,CAAC;AAcrD;;;;;;;;;;;GAWG;AACH,SAAgB,eAAe,CAAC,OAA6B;IACzD,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAC5D,MAAM,MAAM,GAAyB,EAAE,CAAC;IACxC,IAAI,QAAQ,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACvD,IAAI,YAAY,KAAK,SAAS;QAAE,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;IACnE,IAAI,eAAe,KAAK,SAAS;QAAE,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;IAC5E,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY;IACvC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,SAAgB,4BAA4B,CAAC,IAAY,EAAE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