@eclipse-glsp/server-mcp 2.7.0-next.10

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.
Files changed (278) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +57 -0
  3. package/lib/index.d.ts +66 -0
  4. package/lib/index.d.ts.map +1 -0
  5. package/lib/index.js +82 -0
  6. package/lib/index.js.map +1 -0
  7. package/lib/modules/mcp-diagram-module.d.ts +123 -0
  8. package/lib/modules/mcp-diagram-module.d.ts.map +1 -0
  9. package/lib/modules/mcp-diagram-module.js +202 -0
  10. package/lib/modules/mcp-diagram-module.js.map +1 -0
  11. package/lib/modules/mcp-server-module.d.ts +143 -0
  12. package/lib/modules/mcp-server-module.d.ts.map +1 -0
  13. package/lib/modules/mcp-server-module.js +251 -0
  14. package/lib/modules/mcp-server-module.js.map +1 -0
  15. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts +44 -0
  16. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts.map +1 -0
  17. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js +102 -0
  18. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js.map +1 -0
  19. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts +44 -0
  20. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts.map +1 -0
  21. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js +99 -0
  22. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js.map +1 -0
  23. package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts +84 -0
  24. package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts.map +1 -0
  25. package/lib/resources/handlers/diagram-png-mcp-resource-handler.js +177 -0
  26. package/lib/resources/handlers/diagram-png-mcp-resource-handler.js.map +1 -0
  27. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts +55 -0
  28. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts.map +1 -0
  29. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js +99 -0
  30. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js.map +1 -0
  31. package/lib/resources/services/element-types-provider.d.ts +65 -0
  32. package/lib/resources/services/element-types-provider.d.ts.map +1 -0
  33. package/lib/resources/services/element-types-provider.js +81 -0
  34. package/lib/resources/services/element-types-provider.js.map +1 -0
  35. package/lib/resources/services/mcp-model-serializer.d.ts +78 -0
  36. package/lib/resources/services/mcp-model-serializer.d.ts.map +1 -0
  37. package/lib/resources/services/mcp-model-serializer.js +188 -0
  38. package/lib/resources/services/mcp-model-serializer.js.map +1 -0
  39. package/lib/server/glsp-mcp-server.d.ts +82 -0
  40. package/lib/server/glsp-mcp-server.d.ts.map +1 -0
  41. package/lib/server/glsp-mcp-server.js +140 -0
  42. package/lib/server/glsp-mcp-server.js.map +1 -0
  43. package/lib/server/lru-event-store.d.ts +53 -0
  44. package/lib/server/lru-event-store.d.ts.map +1 -0
  45. package/lib/server/lru-event-store.js +100 -0
  46. package/lib/server/lru-event-store.js.map +1 -0
  47. package/lib/server/mcp-diagram-handler-dispatcher.d.ts +144 -0
  48. package/lib/server/mcp-diagram-handler-dispatcher.d.ts.map +1 -0
  49. package/lib/server/mcp-diagram-handler-dispatcher.js +382 -0
  50. package/lib/server/mcp-diagram-handler-dispatcher.js.map +1 -0
  51. package/lib/server/mcp-diagram-prompt-handler-registry.d.ts +33 -0
  52. package/lib/server/mcp-diagram-prompt-handler-registry.d.ts.map +1 -0
  53. package/lib/server/mcp-diagram-prompt-handler-registry.js +76 -0
  54. package/lib/server/mcp-diagram-prompt-handler-registry.js.map +1 -0
  55. package/lib/server/mcp-diagram-resource-handler-registry.d.ts +35 -0
  56. package/lib/server/mcp-diagram-resource-handler-registry.d.ts.map +1 -0
  57. package/lib/server/mcp-diagram-resource-handler-registry.js +94 -0
  58. package/lib/server/mcp-diagram-resource-handler-registry.js.map +1 -0
  59. package/lib/server/mcp-diagram-tool-handler-registry.d.ts +57 -0
  60. package/lib/server/mcp-diagram-tool-handler-registry.d.ts.map +1 -0
  61. package/lib/server/mcp-diagram-tool-handler-registry.js +111 -0
  62. package/lib/server/mcp-diagram-tool-handler-registry.js.map +1 -0
  63. package/lib/server/mcp-handler-shared.d.ts +142 -0
  64. package/lib/server/mcp-handler-shared.d.ts.map +1 -0
  65. package/lib/server/mcp-handler-shared.js +199 -0
  66. package/lib/server/mcp-handler-shared.js.map +1 -0
  67. package/lib/server/mcp-http-transport.d.ts +93 -0
  68. package/lib/server/mcp-http-transport.d.ts.map +1 -0
  69. package/lib/server/mcp-http-transport.js +350 -0
  70. package/lib/server/mcp-http-transport.js.map +1 -0
  71. package/lib/server/mcp-id-alias-service.d.ts +70 -0
  72. package/lib/server/mcp-id-alias-service.d.ts.map +1 -0
  73. package/lib/server/mcp-id-alias-service.js +85 -0
  74. package/lib/server/mcp-id-alias-service.js.map +1 -0
  75. package/lib/server/mcp-input-schemas.d.ts +73 -0
  76. package/lib/server/mcp-input-schemas.d.ts.map +1 -0
  77. package/lib/server/mcp-input-schemas.js +67 -0
  78. package/lib/server/mcp-input-schemas.js.map +1 -0
  79. package/lib/server/mcp-label-provider.d.ts +45 -0
  80. package/lib/server/mcp-label-provider.d.ts.map +1 -0
  81. package/lib/server/mcp-label-provider.js +42 -0
  82. package/lib/server/mcp-label-provider.js.map +1 -0
  83. package/lib/server/mcp-log-level-registry.d.ts +54 -0
  84. package/lib/server/mcp-log-level-registry.d.ts.map +1 -0
  85. package/lib/server/mcp-log-level-registry.js +80 -0
  86. package/lib/server/mcp-log-level-registry.js.map +1 -0
  87. package/lib/server/mcp-logger.d.ts +59 -0
  88. package/lib/server/mcp-logger.d.ts.map +1 -0
  89. package/lib/server/mcp-logger.js +104 -0
  90. package/lib/server/mcp-logger.js.map +1 -0
  91. package/lib/server/mcp-mime-types.d.ts +28 -0
  92. package/lib/server/mcp-mime-types.d.ts.map +1 -0
  93. package/lib/server/mcp-mime-types.js +18 -0
  94. package/lib/server/mcp-mime-types.js.map +1 -0
  95. package/lib/server/mcp-options.d.ts +39 -0
  96. package/lib/server/mcp-options.d.ts.map +1 -0
  97. package/lib/server/mcp-options.js +53 -0
  98. package/lib/server/mcp-options.js.map +1 -0
  99. package/lib/server/mcp-progress-reporter.d.ts +48 -0
  100. package/lib/server/mcp-progress-reporter.d.ts.map +1 -0
  101. package/lib/server/mcp-progress-reporter.js +66 -0
  102. package/lib/server/mcp-progress-reporter.js.map +1 -0
  103. package/lib/server/mcp-prompt-handler.d.ts +120 -0
  104. package/lib/server/mcp-prompt-handler.d.ts.map +1 -0
  105. package/lib/server/mcp-prompt-handler.js +131 -0
  106. package/lib/server/mcp-prompt-handler.js.map +1 -0
  107. package/lib/server/mcp-request-context.d.ts +37 -0
  108. package/lib/server/mcp-request-context.d.ts.map +1 -0
  109. package/lib/server/mcp-request-context.js +37 -0
  110. package/lib/server/mcp-request-context.js.map +1 -0
  111. package/lib/server/mcp-resource-handler.d.ts +212 -0
  112. package/lib/server/mcp-resource-handler.d.ts.map +1 -0
  113. package/lib/server/mcp-resource-handler.js +298 -0
  114. package/lib/server/mcp-resource-handler.js.map +1 -0
  115. package/lib/server/mcp-server-launcher.d.ts +143 -0
  116. package/lib/server/mcp-server-launcher.d.ts.map +1 -0
  117. package/lib/server/mcp-server-launcher.js +355 -0
  118. package/lib/server/mcp-server-launcher.js.map +1 -0
  119. package/lib/server/mcp-session.d.ts +44 -0
  120. package/lib/server/mcp-session.d.ts.map +1 -0
  121. package/lib/server/mcp-session.js +18 -0
  122. package/lib/server/mcp-session.js.map +1 -0
  123. package/lib/server/mcp-tool-handler.d.ts +259 -0
  124. package/lib/server/mcp-tool-handler.d.ts.map +1 -0
  125. package/lib/server/mcp-tool-handler.js +355 -0
  126. package/lib/server/mcp-tool-handler.js.map +1 -0
  127. package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts +47 -0
  128. package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts.map +1 -0
  129. package/lib/tools/handlers/count-elements-mcp-tool-handler.js +77 -0
  130. package/lib/tools/handlers/count-elements-mcp-tool-handler.js.map +1 -0
  131. package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts +113 -0
  132. package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts.map +1 -0
  133. package/lib/tools/handlers/create-edges-mcp-tool-handler.js +191 -0
  134. package/lib/tools/handlers/create-edges-mcp-tool-handler.js.map +1 -0
  135. package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts +82 -0
  136. package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts.map +1 -0
  137. package/lib/tools/handlers/create-nodes-mcp-tool-handler.js +124 -0
  138. package/lib/tools/handlers/create-nodes-mcp-tool-handler.js.map +1 -0
  139. package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts +53 -0
  140. package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts.map +1 -0
  141. package/lib/tools/handlers/delete-elements-mcp-tool-handler.js +74 -0
  142. package/lib/tools/handlers/delete-elements-mcp-tool-handler.js.map +1 -0
  143. package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts +60 -0
  144. package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts.map +1 -0
  145. package/lib/tools/handlers/diagram-model-mcp-tool-handler.js +79 -0
  146. package/lib/tools/handlers/diagram-model-mcp-tool-handler.js.map +1 -0
  147. package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts +98 -0
  148. package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts.map +1 -0
  149. package/lib/tools/handlers/element-types-mcp-tool-handler.js +156 -0
  150. package/lib/tools/handlers/element-types-mcp-tool-handler.js.map +1 -0
  151. package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts +44 -0
  152. package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts.map +1 -0
  153. package/lib/tools/handlers/get-selection-mcp-tool-handler.js +70 -0
  154. package/lib/tools/handlers/get-selection-mcp-tool-handler.js.map +1 -0
  155. package/lib/tools/handlers/layout-mcp-tool-handler.d.ts +44 -0
  156. package/lib/tools/handlers/layout-mcp-tool-handler.d.ts.map +1 -0
  157. package/lib/tools/handlers/layout-mcp-tool-handler.js +72 -0
  158. package/lib/tools/handlers/layout-mcp-tool-handler.js.map +1 -0
  159. package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts +79 -0
  160. package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts.map +1 -0
  161. package/lib/tools/handlers/modify-edges-mcp-tool-handler.js +138 -0
  162. package/lib/tools/handlers/modify-edges-mcp-tool-handler.js.map +1 -0
  163. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts +93 -0
  164. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts.map +1 -0
  165. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js +127 -0
  166. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js.map +1 -0
  167. package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts +103 -0
  168. package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts.map +1 -0
  169. package/lib/tools/handlers/query-elements-mcp-tool-handler.js +160 -0
  170. package/lib/tools/handlers/query-elements-mcp-tool-handler.js.map +1 -0
  171. package/lib/tools/handlers/redo-mcp-tool-handler.d.ts +46 -0
  172. package/lib/tools/handlers/redo-mcp-tool-handler.d.ts.map +1 -0
  173. package/lib/tools/handlers/redo-mcp-tool-handler.js +75 -0
  174. package/lib/tools/handlers/redo-mcp-tool-handler.js.map +1 -0
  175. package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts +57 -0
  176. package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts.map +1 -0
  177. package/lib/tools/handlers/save-model-mcp-tool-handler.js +93 -0
  178. package/lib/tools/handlers/save-model-mcp-tool-handler.js.map +1 -0
  179. package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts +66 -0
  180. package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts.map +1 -0
  181. package/lib/tools/handlers/session-info-mcp-tool-handler.js +109 -0
  182. package/lib/tools/handlers/session-info-mcp-tool-handler.js.map +1 -0
  183. package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts +61 -0
  184. package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts.map +1 -0
  185. package/lib/tools/handlers/set-selection-mcp-tool-handler.js +104 -0
  186. package/lib/tools/handlers/set-selection-mcp-tool-handler.js.map +1 -0
  187. package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts +111 -0
  188. package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts.map +1 -0
  189. package/lib/tools/handlers/set-view-mcp-tool-handler.js +144 -0
  190. package/lib/tools/handlers/set-view-mcp-tool-handler.js.map +1 -0
  191. package/lib/tools/handlers/undo-mcp-tool-handler.d.ts +46 -0
  192. package/lib/tools/handlers/undo-mcp-tool-handler.d.ts.map +1 -0
  193. package/lib/tools/handlers/undo-mcp-tool-handler.js +76 -0
  194. package/lib/tools/handlers/undo-mcp-tool-handler.js.map +1 -0
  195. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts +67 -0
  196. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts.map +1 -0
  197. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js +0 -0
  198. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js.map +1 -0
  199. package/lib/util/markdown-util.d.ts +20 -0
  200. package/lib/util/markdown-util.d.ts.map +1 -0
  201. package/lib/util/markdown-util.js +45 -0
  202. package/lib/util/markdown-util.js.map +1 -0
  203. package/lib/util/mcp-util.d.ts +22 -0
  204. package/lib/util/mcp-util.d.ts.map +1 -0
  205. package/lib/util/mcp-util.js +29 -0
  206. package/lib/util/mcp-util.js.map +1 -0
  207. package/package.json +63 -0
  208. package/src/index.ts +65 -0
  209. package/src/modules/mcp-diagram-module.ts +247 -0
  210. package/src/modules/mcp-server-module.ts +289 -0
  211. package/src/prompts/handlers/describe-diagram-mcp-prompt-handler.ts +88 -0
  212. package/src/prompts/handlers/suggest-improvements-mcp-prompt-handler.ts +85 -0
  213. package/src/resources/handlers/diagram-png-mcp-resource-handler.ts +177 -0
  214. package/src/resources/handlers/diagram-svg-mcp-resource-handler.ts +85 -0
  215. package/src/resources/services/element-types-provider.ts +105 -0
  216. package/src/resources/services/mcp-model-serializer.ts +211 -0
  217. package/src/server/glsp-mcp-server.spec.ts +73 -0
  218. package/src/server/glsp-mcp-server.ts +196 -0
  219. package/src/server/lru-event-store.spec.ts +121 -0
  220. package/src/server/lru-event-store.ts +112 -0
  221. package/src/server/mcp-diagram-handler-dispatcher.spec.ts +231 -0
  222. package/src/server/mcp-diagram-handler-dispatcher.ts +459 -0
  223. package/src/server/mcp-diagram-prompt-handler-registry.ts +59 -0
  224. package/src/server/mcp-diagram-resource-handler-registry.ts +73 -0
  225. package/src/server/mcp-diagram-tool-handler-registry.ts +97 -0
  226. package/src/server/mcp-handler-shared.spec.ts +53 -0
  227. package/src/server/mcp-handler-shared.ts +247 -0
  228. package/src/server/mcp-http-transport-e2e.spec.ts +151 -0
  229. package/src/server/mcp-http-transport.spec.ts +385 -0
  230. package/src/server/mcp-http-transport.ts +368 -0
  231. package/src/server/mcp-id-alias-service.spec.ts +106 -0
  232. package/src/server/mcp-id-alias-service.ts +104 -0
  233. package/src/server/mcp-input-schemas.ts +82 -0
  234. package/src/server/mcp-label-provider.ts +52 -0
  235. package/src/server/mcp-log-level-registry.spec.ts +75 -0
  236. package/src/server/mcp-log-level-registry.ts +90 -0
  237. package/src/server/mcp-logger.spec.ts +227 -0
  238. package/src/server/mcp-logger.ts +91 -0
  239. package/src/server/mcp-mime-types.ts +31 -0
  240. package/src/server/mcp-options.ts +43 -0
  241. package/src/server/mcp-progress-reporter.spec.ts +93 -0
  242. package/src/server/mcp-progress-reporter.ts +67 -0
  243. package/src/server/mcp-prompt-handler.ts +157 -0
  244. package/src/server/mcp-request-context.ts +39 -0
  245. package/src/server/mcp-resource-handler.ts +389 -0
  246. package/src/server/mcp-server-launcher.spec.ts +173 -0
  247. package/src/server/mcp-server-launcher.ts +369 -0
  248. package/src/server/mcp-session.ts +45 -0
  249. package/src/server/mcp-tool-handler.spec.ts +182 -0
  250. package/src/server/mcp-tool-handler.ts +431 -0
  251. package/src/server/raw-http.spec.ts +59 -0
  252. package/src/tools/handlers/count-elements-mcp-tool-handler.spec.ts +101 -0
  253. package/src/tools/handlers/count-elements-mcp-tool-handler.ts +68 -0
  254. package/src/tools/handlers/create-edges-mcp-tool-handler.spec.ts +198 -0
  255. package/src/tools/handlers/create-edges-mcp-tool-handler.ts +200 -0
  256. package/src/tools/handlers/create-nodes-mcp-tool-handler.spec.ts +199 -0
  257. package/src/tools/handlers/create-nodes-mcp-tool-handler.ts +126 -0
  258. package/src/tools/handlers/delete-elements-mcp-tool-handler.ts +69 -0
  259. package/src/tools/handlers/diagram-model-mcp-tool-handler.ts +68 -0
  260. package/src/tools/handlers/element-types-mcp-tool-handler.ts +152 -0
  261. package/src/tools/handlers/get-selection-mcp-tool-handler.ts +56 -0
  262. package/src/tools/handlers/layout-mcp-tool-handler.ts +58 -0
  263. package/src/tools/handlers/modify-edges-mcp-tool-handler.ts +142 -0
  264. package/src/tools/handlers/modify-nodes-mcp-tool-handler.ts +134 -0
  265. package/src/tools/handlers/query-elements-mcp-tool-handler.spec.ts +212 -0
  266. package/src/tools/handlers/query-elements-mcp-tool-handler.ts +157 -0
  267. package/src/tools/handlers/redo-mcp-tool-handler.ts +64 -0
  268. package/src/tools/handlers/save-model-mcp-tool-handler.ts +74 -0
  269. package/src/tools/handlers/session-info-mcp-tool-handler.spec.ts +152 -0
  270. package/src/tools/handlers/session-info-mcp-tool-handler.ts +98 -0
  271. package/src/tools/handlers/set-selection-mcp-tool-handler.spec.ts +120 -0
  272. package/src/tools/handlers/set-selection-mcp-tool-handler.ts +92 -0
  273. package/src/tools/handlers/set-view-mcp-tool-handler.ts +156 -0
  274. package/src/tools/handlers/undo-mcp-tool-handler.ts +63 -0
  275. package/src/tools/handlers/validate-diagram-mcp-tool-handler.ts +0 -0
  276. package/src/tools/tool-annotations.spec.ts +141 -0
  277. package/src/util/markdown-util.ts +44 -0
  278. package/src/util/mcp-util.ts +25 -0
@@ -0,0 +1,143 @@
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 { BindingContext } from '@eclipse-glsp/protocol/lib/di';
17
+ import { AbstractMultiBinding, BindingTarget, GLSPModule } from '@eclipse-glsp/server';
18
+ import { interfaces } from 'inversify';
19
+ import { GLSPMcpServerFactory } from '../server/glsp-mcp-server';
20
+ import { McpDiagramHandlerDispatcher } from '../server/mcp-diagram-handler-dispatcher';
21
+ import { McpLogLevelRegistry } from '../server/mcp-log-level-registry';
22
+ import { McpHttpTransport } from '../server/mcp-http-transport';
23
+ import { McpLogger } from '../server/mcp-logger';
24
+ import { McpServerDefaults, McpServerOptions } from '../server/mcp-options';
25
+ import { McpProgressReporter } from '../server/mcp-progress-reporter';
26
+ import { McpPromptHandler } from '../server/mcp-prompt-handler';
27
+ import { McpResourceHandler } from '../server/mcp-resource-handler';
28
+ import { McpServerLauncher } from '../server/mcp-server-launcher';
29
+ import { McpToolHandler } from '../server/mcp-tool-handler';
30
+ /**
31
+ * Multi-binding helper for MCP handler classes. Singleton-scoped sibling of core's
32
+ * `MultiBinding<T>` — same `binding.add(...)` / `binding.rebind(old, new)` adopter shape, but
33
+ * core's plain `MultiBinding` binds in transient scope, while MCP handlers cache deferred
34
+ * resolvers (selection/PNG round-trips) and need singleton scope to keep their state.
35
+ */
36
+ export declare class McpHandlerMultiBinding<T> extends AbstractMultiBinding<interfaces.Newable<T>> {
37
+ applyBindings(context: BindingContext): void;
38
+ }
39
+ /**
40
+ * Server-scope DI module for the MCP server. Adopters subclass {@link DefaultMcpServerModule}
41
+ * and override the `bind*` hooks to swap single-instance services or the `configure*` hooks to
42
+ * add/replace handlers in the multi-bindings. Mirrors the `DiagramModule` pattern from core
43
+ * (`bindGModelSerializer()`, `configureActionHandlers(binding)`, etc.).
44
+ *
45
+ * Adopter-provided default option values flow through the constructor — pass a
46
+ * `Partial<McpServerOptions>` to override individual fields. The launcher then merges these
47
+ * defaults with init-time options from the GLSP `initialize` request (init-time wins per field).
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * // Drop-in: GLSP defaults.
52
+ * launcher.configure(serverModule, new DefaultMcpServerModule());
53
+ *
54
+ * // Drop-in with a product-specific override.
55
+ * launcher.configure(serverModule, new DefaultMcpServerModule({ dataMode: 'resources' }));
56
+ *
57
+ * // Subclass when handler customization is needed.
58
+ * class WorkflowMcpServerModule extends DefaultMcpServerModule {
59
+ * constructor() { super({ agentPersona: WORKFLOW_PERSONA }); }
60
+ * protected override configureToolHandlers(binding) {
61
+ * super.configureToolHandlers(binding);
62
+ * binding.add(WorkflowSpecificTool);
63
+ * }
64
+ * }
65
+ * ```
66
+ */
67
+ export declare abstract class AbstractMcpServerModule extends GLSPModule {
68
+ protected readonly defaultOptions: McpServerDefaults;
69
+ protected bind: interfaces.Bind;
70
+ protected rebind: interfaces.Rebind;
71
+ constructor(defaultOptions?: McpServerDefaults);
72
+ protected configure(bind: interfaces.Bind, _unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind): void;
73
+ /**
74
+ * {@link McpServerLauncher} binding. Bound as a singleton AND aliased to
75
+ * `GLSPServerInitializer` + `GLSPServerListener` (the launcher implements both).
76
+ * Override to swap in a custom launcher impl.
77
+ */
78
+ protected bindMcpServerLauncher(): BindingTarget<McpServerLauncher>;
79
+ /** {@link McpHttpTransport} binding. Override to swap to a different transport implementation. */
80
+ protected bindMcpHttpTransport(): BindingTarget<McpHttpTransport>;
81
+ /**
82
+ * {@link McpDiagramHandlerDispatcher} binding. Owns diagram-scope handler discovery,
83
+ * SDK registration, and per-call dispatch routing. Override (or `rebind` to a subclass)
84
+ * to customize registration without subclassing the launcher itself.
85
+ */
86
+ protected bindMcpDiagramHandlerDispatcher(): BindingTarget<McpDiagramHandlerDispatcher>;
87
+ /** {@link McpServerOptions} holder binding. Mutated at init by the launcher. */
88
+ protected bindMcpServerOptions(): BindingTarget<McpServerOptions>;
89
+ /**
90
+ * {@link McpServerDefaults} binding — adopter-supplied default option values flow through
91
+ * the constructor and land here as a constant. The launcher merges these defaults with
92
+ * init-time options at server init (init-time wins per field).
93
+ */
94
+ protected bindMcpServerDefaults(): BindingTarget<McpServerDefaults>;
95
+ /**
96
+ * {@link McpLogger} binding. Bound on the server container; per-session containers inherit
97
+ * it, so handlers at any scope can inject it; routes through the active MCP request via
98
+ * {@link mcpRequestContext}.
99
+ */
100
+ protected bindMcpLogger(): BindingTarget<McpLogger>;
101
+ /** {@link McpProgressReporter} binding. Same scope/lifecycle story as {@link bindMcpLogger}. */
102
+ protected bindMcpProgressReporter(): BindingTarget<McpProgressReporter>;
103
+ /**
104
+ * {@link McpLogLevelRegistry} binding — holds per-MCP-session `logging/setLevel` thresholds
105
+ * read by {@link McpLogger} when filtering `notifications/message`.
106
+ */
107
+ protected bindMcpLogLevelRegistry(): BindingTarget<McpLogLevelRegistry>;
108
+ /**
109
+ * {@link GLSPMcpServerFactory} binding — produces a fresh {@link DefaultGLSPMcpServer} per
110
+ * MCP-session-init call. Override to wrap the SDK `McpServer` differently (e.g. add custom
111
+ * middleware, swap the Proxy strategy).
112
+ */
113
+ protected bindGLSPMcpServerFactory(): BindingTarget<GLSPMcpServerFactory>;
114
+ /**
115
+ * Override to add or replace tool handlers. Adopters typically `super.configureToolHandlers(binding)`
116
+ * to keep the defaults, then `binding.add(MyTool)` for additions or
117
+ * `binding.rebind(StandardTool, MyTool)` for overrides.
118
+ */
119
+ protected configureToolHandlers(binding: McpHandlerMultiBinding<McpToolHandler>): void;
120
+ /** See {@link configureToolHandlers}. No server-scope resources ship by default. */
121
+ protected configureResourceHandlers(_binding: McpHandlerMultiBinding<McpResourceHandler>): void;
122
+ /**
123
+ * See {@link configureToolHandlers}. Server-scope by default because the shipped prompts
124
+ * (`describe-diagram`, `suggest-improvements`) are diagram-type-agnostic and resolve their
125
+ * target session at invocation time — diagram-scope adopters add prompts via
126
+ * {@link DefaultMcpDiagramModule.configurePromptHandlers}.
127
+ */
128
+ protected configurePromptHandlers(binding: McpHandlerMultiBinding<McpPromptHandler>): void;
129
+ }
130
+ /**
131
+ * Default {@link AbstractMcpServerModule} entry point. Ships GLSP-default option values (see
132
+ * {@link DEFAULT_OPTIONS}) on top of the abstract module's hook defaults. Adopter-provided
133
+ * overrides via the constructor merge on top.
134
+ *
135
+ * @experimental The MCP integration is under active development. Option names, schema shapes,
136
+ * and handler contracts MAY change in minor releases until the feature graduates from
137
+ * experimental status.
138
+ */
139
+ export declare class DefaultMcpServerModule extends AbstractMcpServerModule {
140
+ static readonly DEFAULT_OPTIONS: McpServerDefaults;
141
+ constructor(overrides?: McpServerDefaults);
142
+ }
143
+ //# sourceMappingURL=mcp-server-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server-module.d.ts","sourceRoot":"","sources":["../../src/modules/mcp-server-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EACH,oBAAoB,EAEpB,aAAa,EACb,UAAU,EAIb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,W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A4BP;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,IAAI,aAAa,CAAC,iBAAiB,CAAC;IAInE,kGAAkG;IAClG,SAAS,CAAC,oBAAoB,IAAI,aAAa,CAAC,gBAAgB,CAAC;IAIjE;;;;OAIG;IACH,SAAS,CAAC,+BAA+B,IAAI,aAAa,CAAC,2BAA2B,CAAC;IAIvF,gFAAgF;IAChF,SAAS,CAAC,oBAAoB,IAAI,aAAa,CAAC,gBAAgB,CAAC;IAIjE;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,IAAI,aAAa,CAAC,iBAAiB,CAAC;IAInE;;;;OAIG;IACH,SAAS,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,CAAC;IAInD,gGAAgG;IAChG,SAAS,CAAC,uBAAuB,IAAI,aAAa,CAAC,mBAAmB,CAAC;IAIvE;;;OAGG;IACH,SAAS,CAAC,uBAAuB,IAAI,aAAa,CAAC,mBAAmB,CAAC;IAIvE;;;;OAIG;IACH,SAAS,CAAC,wBAAwB,IAAI,aAAa,CAAC,oBAAoB,CAAC;IAUzE;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,CAAC,cAAc,CAAC,GAAG,IAAI;IAKtF,oFAAoF;IACpF,SAAS,CAAC,yBAAyB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI;IAI/F;;;;;OAKG;IACH,SAAS,CAAC,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,GAAG,IAAI;CAI7F;AAED;;;;;;;;GAQG;AACH,qBAAa,sBAAuB,SAAQ,uBAAuB;IAC/D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAWhD;gBAEU,SAAS,GAAE,iBAAsB;CAGhD"}
@@ -0,0 +1,251 @@
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.DefaultMcpServerModule = exports.AbstractMcpServerModule = exports.McpHandlerMultiBinding = void 0;
19
+ const server_1 = require("@eclipse-glsp/server");
20
+ const describe_diagram_mcp_prompt_handler_1 = require("../prompts/handlers/describe-diagram-mcp-prompt-handler");
21
+ const suggest_improvements_mcp_prompt_handler_1 = require("../prompts/handlers/suggest-improvements-mcp-prompt-handler");
22
+ const element_types_mcp_tool_handler_1 = require("../tools/handlers/element-types-mcp-tool-handler");
23
+ const session_info_mcp_tool_handler_1 = require("../tools/handlers/session-info-mcp-tool-handler");
24
+ const glsp_mcp_server_1 = require("../server/glsp-mcp-server");
25
+ const mcp_diagram_handler_dispatcher_1 = require("../server/mcp-diagram-handler-dispatcher");
26
+ const mcp_log_level_registry_1 = require("../server/mcp-log-level-registry");
27
+ const lru_event_store_1 = require("../server/lru-event-store");
28
+ const mcp_http_transport_1 = require("../server/mcp-http-transport");
29
+ const mcp_logger_1 = require("../server/mcp-logger");
30
+ const mcp_options_1 = require("../server/mcp-options");
31
+ const mcp_progress_reporter_1 = require("../server/mcp-progress-reporter");
32
+ const mcp_prompt_handler_1 = require("../server/mcp-prompt-handler");
33
+ const mcp_resource_handler_1 = require("../server/mcp-resource-handler");
34
+ const mcp_server_launcher_1 = require("../server/mcp-server-launcher");
35
+ const mcp_tool_handler_1 = require("../server/mcp-tool-handler");
36
+ /**
37
+ * GLSP-generic default agent persona — adopters typically pass a product-specific persona to
38
+ * the {@link DefaultMcpServerModule} constructor (e.g. workflow-server might say "You are the
39
+ * Workflow Modeling Agent...").
40
+ *
41
+ * **Spec note.** This is wired to the MCP `instructions` field, which the spec describes as
42
+ * "concise instructions". This persona is intentionally verbose (~700 chars of behavior rules)
43
+ * — within the spec's "free-form server-supplied instructions" allowance and adopter-overridable
44
+ * via `mcpDefaults.agentPersona`. Don't trim on autopilot if a "concise" interpretation drifts
45
+ * back: the verbose form materially improves LLM tool-use compliance for graphical modelling.
46
+ */
47
+ const DEFAULT_AGENT_PERSONA = `
48
+ You are the GLSP Modeling Agent. Your primary goal is to assist in the creation and modification of graphical models using the
49
+ GLSP MCP server. You have to adhere to the following principles:
50
+ - MCP-Interaction: Any modeling related activity has to occur using the MCP server.
51
+ - Real Data: The diagram model is the ground truth regarding the existing graphical model. Always query it before modifying the diagram.
52
+ - Real Creation: Consult the available element types before creating elements.
53
+ - Visual Proof: An image of the graphical model can be created, if you deem it useful for calculating or verifying layout decisions.
54
+ - Precision: All IDs and types must be exact.
55
+ - Visualization: When creating nodes, suggest sensible default positions and avoid visual overlapping.
56
+ - Careful: Under no circumstances save the model without explicit instruction. If you deem it sensible, you may ask the user for permission.
57
+ The same goes for Undo/Redo operations.
58
+ - Layouting: If available, make use of automatic layouting when not given explicit custom layouting requirements.
59
+ - Human-friendly references: When mentioning an element in user-visible prose, prefer its label, then its element type
60
+ (the bare ids returned by the tools are internal aliases that mean nothing to the user). Append the alias in parentheses
61
+ so the user can correlate it with follow-up tools. Use the \`set-selection\` tool — or the \`set-view\` tool with
62
+ \`action: "center-on-elements"\` — to point the user at the elements you reference.
63
+ `;
64
+ /**
65
+ * Multi-binding helper for MCP handler classes. Singleton-scoped sibling of core's
66
+ * `MultiBinding<T>` — same `binding.add(...)` / `binding.rebind(old, new)` adopter shape, but
67
+ * core's plain `MultiBinding` binds in transient scope, while MCP handlers cache deferred
68
+ * resolvers (selection/PNG round-trips) and need singleton scope to keep their state.
69
+ */
70
+ class McpHandlerMultiBinding extends server_1.AbstractMultiBinding {
71
+ applyBindings(context) {
72
+ this.bindings.forEach(handlerClass => {
73
+ if (!context.isBound(handlerClass)) {
74
+ context.bind(handlerClass).toSelf().inSingletonScope();
75
+ }
76
+ context.bind(this.identifier).toService(handlerClass);
77
+ });
78
+ }
79
+ }
80
+ exports.McpHandlerMultiBinding = McpHandlerMultiBinding;
81
+ /**
82
+ * Server-scope DI module for the MCP server. Adopters subclass {@link DefaultMcpServerModule}
83
+ * and override the `bind*` hooks to swap single-instance services or the `configure*` hooks to
84
+ * add/replace handlers in the multi-bindings. Mirrors the `DiagramModule` pattern from core
85
+ * (`bindGModelSerializer()`, `configureActionHandlers(binding)`, etc.).
86
+ *
87
+ * Adopter-provided default option values flow through the constructor — pass a
88
+ * `Partial<McpServerOptions>` to override individual fields. The launcher then merges these
89
+ * defaults with init-time options from the GLSP `initialize` request (init-time wins per field).
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * // Drop-in: GLSP defaults.
94
+ * launcher.configure(serverModule, new DefaultMcpServerModule());
95
+ *
96
+ * // Drop-in with a product-specific override.
97
+ * launcher.configure(serverModule, new DefaultMcpServerModule({ dataMode: 'resources' }));
98
+ *
99
+ * // Subclass when handler customization is needed.
100
+ * class WorkflowMcpServerModule extends DefaultMcpServerModule {
101
+ * constructor() { super({ agentPersona: WORKFLOW_PERSONA }); }
102
+ * protected override configureToolHandlers(binding) {
103
+ * super.configureToolHandlers(binding);
104
+ * binding.add(WorkflowSpecificTool);
105
+ * }
106
+ * }
107
+ * ```
108
+ */
109
+ class AbstractMcpServerModule extends server_1.GLSPModule {
110
+ constructor(defaultOptions = {}) {
111
+ super();
112
+ this.defaultOptions = defaultOptions;
113
+ }
114
+ configure(bind, _unbind, isBound, rebind) {
115
+ this.bind = bind;
116
+ this.rebind = rebind;
117
+ const context = { bind, isBound };
118
+ (0, server_1.applyBindingTarget)(context, mcp_server_launcher_1.McpServerLauncher, this.bindMcpServerLauncher()).inSingletonScope();
119
+ // The launcher is bound under two additional service identifiers so core's existing
120
+ // multi-bindings pick it up alongside the rest of the server's contributions/listeners.
121
+ bind(server_1.GLSPServerInitializer).toService(mcp_server_launcher_1.McpServerLauncher);
122
+ bind(server_1.GLSPServerListener).toService(mcp_server_launcher_1.McpServerLauncher);
123
+ (0, server_1.applyBindingTarget)(context, mcp_http_transport_1.McpHttpTransport, this.bindMcpHttpTransport()).inSingletonScope();
124
+ (0, server_1.applyBindingTarget)(context, mcp_diagram_handler_dispatcher_1.McpDiagramHandlerDispatcher, this.bindMcpDiagramHandlerDispatcher()).inSingletonScope();
125
+ (0, server_1.applyBindingTarget)(context, mcp_options_1.McpServerOptions, this.bindMcpServerOptions()).inSingletonScope();
126
+ (0, server_1.applyBindingTarget)(context, mcp_options_1.McpServerDefaults, this.bindMcpServerDefaults());
127
+ (0, server_1.applyBindingTarget)(context, mcp_logger_1.McpLogger, this.bindMcpLogger()).inSingletonScope();
128
+ (0, server_1.applyBindingTarget)(context, mcp_log_level_registry_1.McpLogLevelRegistry, this.bindMcpLogLevelRegistry()).inSingletonScope();
129
+ (0, server_1.applyBindingTarget)(context, mcp_progress_reporter_1.McpProgressReporter, this.bindMcpProgressReporter()).inSingletonScope();
130
+ (0, server_1.applyBindingTarget)(context, glsp_mcp_server_1.GLSPMcpServerFactory, this.bindGLSPMcpServerFactory());
131
+ this.configureMultiBinding(new McpHandlerMultiBinding(mcp_tool_handler_1.McpToolHandler), binding => this.configureToolHandlers(binding));
132
+ this.configureMultiBinding(new McpHandlerMultiBinding(mcp_resource_handler_1.McpResourceHandler), binding => this.configureResourceHandlers(binding));
133
+ this.configureMultiBinding(new McpHandlerMultiBinding(mcp_prompt_handler_1.McpPromptHandler), binding => this.configurePromptHandlers(binding));
134
+ }
135
+ /**
136
+ * {@link McpServerLauncher} binding. Bound as a singleton AND aliased to
137
+ * `GLSPServerInitializer` + `GLSPServerListener` (the launcher implements both).
138
+ * Override to swap in a custom launcher impl.
139
+ */
140
+ bindMcpServerLauncher() {
141
+ return mcp_server_launcher_1.McpServerLauncher;
142
+ }
143
+ /** {@link McpHttpTransport} binding. Override to swap to a different transport implementation. */
144
+ bindMcpHttpTransport() {
145
+ return mcp_http_transport_1.McpHttpTransport;
146
+ }
147
+ /**
148
+ * {@link McpDiagramHandlerDispatcher} binding. Owns diagram-scope handler discovery,
149
+ * SDK registration, and per-call dispatch routing. Override (or `rebind` to a subclass)
150
+ * to customize registration without subclassing the launcher itself.
151
+ */
152
+ bindMcpDiagramHandlerDispatcher() {
153
+ return mcp_diagram_handler_dispatcher_1.DefaultMcpDiagramHandlerDispatcher;
154
+ }
155
+ /** {@link McpServerOptions} holder binding. Mutated at init by the launcher. */
156
+ bindMcpServerOptions() {
157
+ return mcp_options_1.McpServerOptions;
158
+ }
159
+ /**
160
+ * {@link McpServerDefaults} binding — adopter-supplied default option values flow through
161
+ * the constructor and land here as a constant. The launcher merges these defaults with
162
+ * init-time options at server init (init-time wins per field).
163
+ */
164
+ bindMcpServerDefaults() {
165
+ return { constantValue: this.defaultOptions };
166
+ }
167
+ /**
168
+ * {@link McpLogger} binding. Bound on the server container; per-session containers inherit
169
+ * it, so handlers at any scope can inject it; routes through the active MCP request via
170
+ * {@link mcpRequestContext}.
171
+ */
172
+ bindMcpLogger() {
173
+ return mcp_logger_1.McpLogger;
174
+ }
175
+ /** {@link McpProgressReporter} binding. Same scope/lifecycle story as {@link bindMcpLogger}. */
176
+ bindMcpProgressReporter() {
177
+ return mcp_progress_reporter_1.McpProgressReporter;
178
+ }
179
+ /**
180
+ * {@link McpLogLevelRegistry} binding — holds per-MCP-session `logging/setLevel` thresholds
181
+ * read by {@link McpLogger} when filtering `notifications/message`.
182
+ */
183
+ bindMcpLogLevelRegistry() {
184
+ return mcp_log_level_registry_1.DefaultMcpLogLevelRegistry;
185
+ }
186
+ /**
187
+ * {@link GLSPMcpServerFactory} binding — produces a fresh {@link DefaultGLSPMcpServer} per
188
+ * MCP-session-init call. Override to wrap the SDK `McpServer` differently (e.g. add custom
189
+ * middleware, swap the Proxy strategy).
190
+ */
191
+ bindGLSPMcpServerFactory() {
192
+ return {
193
+ dynamicValue: ctx => {
194
+ const logger = ctx.container.get(server_1.Logger);
195
+ return (mcpServer, options) => new glsp_mcp_server_1.DefaultGLSPMcpServer(mcpServer, options, logger);
196
+ }
197
+ };
198
+ }
199
+ /**
200
+ * Override to add or replace tool handlers. Adopters typically `super.configureToolHandlers(binding)`
201
+ * to keep the defaults, then `binding.add(MyTool)` for additions or
202
+ * `binding.rebind(StandardTool, MyTool)` for overrides.
203
+ */
204
+ configureToolHandlers(binding) {
205
+ binding.add(session_info_mcp_tool_handler_1.SessionInfoMcpToolHandler);
206
+ binding.add(element_types_mcp_tool_handler_1.ElementTypesMcpToolHandler);
207
+ }
208
+ /** See {@link configureToolHandlers}. No server-scope resources ship by default. */
209
+ configureResourceHandlers(_binding) {
210
+ // empty by default
211
+ }
212
+ /**
213
+ * See {@link configureToolHandlers}. Server-scope by default because the shipped prompts
214
+ * (`describe-diagram`, `suggest-improvements`) are diagram-type-agnostic and resolve their
215
+ * target session at invocation time — diagram-scope adopters add prompts via
216
+ * {@link DefaultMcpDiagramModule.configurePromptHandlers}.
217
+ */
218
+ configurePromptHandlers(binding) {
219
+ binding.add(describe_diagram_mcp_prompt_handler_1.DescribeDiagramMcpPromptHandler);
220
+ binding.add(suggest_improvements_mcp_prompt_handler_1.SuggestImprovementsMcpPromptHandler);
221
+ }
222
+ }
223
+ exports.AbstractMcpServerModule = AbstractMcpServerModule;
224
+ /**
225
+ * Default {@link AbstractMcpServerModule} entry point. Ships GLSP-default option values (see
226
+ * {@link DEFAULT_OPTIONS}) on top of the abstract module's hook defaults. Adopter-provided
227
+ * overrides via the constructor merge on top.
228
+ *
229
+ * @experimental The MCP integration is under active development. Option names, schema shapes,
230
+ * and handler contracts MAY change in minor releases until the feature graduates from
231
+ * experimental status.
232
+ */
233
+ class DefaultMcpServerModule extends AbstractMcpServerModule {
234
+ constructor(overrides = {}) {
235
+ super({ ...DefaultMcpServerModule.DEFAULT_OPTIONS, ...overrides });
236
+ }
237
+ }
238
+ exports.DefaultMcpServerModule = DefaultMcpServerModule;
239
+ DefaultMcpServerModule.DEFAULT_OPTIONS = {
240
+ host: '127.0.0.1',
241
+ allowedHosts: ['127.0.0.1', 'localhost'],
242
+ // `allowedOrigins` deliberately undefined: accept absent Origin (typical for desktop-IDE
243
+ // MCP clients) and rely on Host validation to gate DNS-rebinding. Adopters whose
244
+ // deployment is browser-fronted set this explicitly to their frontend's origin.
245
+ dataMode: 'tools',
246
+ agentPersona: DEFAULT_AGENT_PERSONA,
247
+ // 10K events per session is generous for typical workloads (a few MB) and large enough
248
+ // that disconnects within seconds recover via `Last-Event-ID` resumability.
249
+ eventStoreLimit: lru_event_store_1.LruEventStore.DEFAULT_LIMIT
250
+ };
251
+ //# sourceMappingURL=mcp-server-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server-module.js","sourceRoot":"","sources":["../../src/modules/mcp-server-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAIlF,iDAQ8B;AAG9B,iHAA0G;AAC1G,yHAAkH;AAClH,qGAA8F;AAC9F,mGAA4F;AAC5F,+DAAuF;AACvF,6FAA2H;AAC3H,6EAAmG;AACnG,+DAA0D;AAC1D,qEAAgE;AAChE,qDAAiD;AACjD,uDAA4E;AAC5E,2EAAsE;AACtE,qEAAgE;AAChE,yEAAoE;AACpE,uEAAkE;AAClE,iEAA4D;AAE5D;;;;;;;;;;GAUG;AACH,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;CAgB7B,CAAC;AAEF;;;;;GAKG;AACH,MAAa,sBAA0B,SAAQ,6BAA2C;IAC7E,aAAa,CAAC,OAAuB;QAC1C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YACjC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;gBACjC,OA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wDAiBC;AAhBmB,sCAAe,GAAsB;IACjD,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IACxC,yFAAyF;IACzF,iFAAiF;IACjF,gFAAgF;IAChF,QAAQ,EAAE,OAAO;IACjB,YAAY,EAAE,qBAAqB;IACnC,uFAAuF;IACvF,4EAA4E;IAC5E,eAAe,EAAE,+BAAa,CAAC,aAAa;CAC/C,CAAC"}
@@ -0,0 +1,44 @@
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 { ClientSessionManager } from '@eclipse-glsp/server';
17
+ import * as z from 'zod/v4';
18
+ import { McpPromptResult } from '../../server/mcp-handler-shared';
19
+ import { AbstractMcpPromptHandler } from '../../server/mcp-prompt-handler';
20
+ export declare const DescribeDiagramArgsSchema: z.ZodObject<{
21
+ sessionId: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ export type DescribeDiagramArgs = z.infer<typeof DescribeDiagramArgsSchema>;
24
+ /**
25
+ * Prompt template that instructs the agent to produce a structured description of a diagram.
26
+ * Pre-baked starting point invokable from the MCP-client UI; the agent then orchestrates the
27
+ * necessary tool calls on its own.
28
+ *
29
+ * Server-scope on purpose — the prompt itself has no per-session state, so we avoid forcing
30
+ * the user to type a sessionId in the common single-diagram case.
31
+ */
32
+ export declare class DescribeDiagramMcpPromptHandler extends AbstractMcpPromptHandler<DescribeDiagramArgs> {
33
+ static readonly NAME = "describe-diagram";
34
+ readonly name = "describe-diagram";
35
+ readonly title = "Describe Diagram";
36
+ readonly description: string;
37
+ readonly argsSchema: z.ZodObject<{
38
+ sessionId: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ protected clientSessionManager: ClientSessionManager;
41
+ referencedToolNames(): string[];
42
+ protected createResult(args: DescribeDiagramArgs): McpPromptResult;
43
+ }
44
+ //# sourceMappingURL=describe-diagram-mcp-prompt-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-diagram-mcp-prompt-handler.d.ts","sourceRoot":"","sources":["../../../src/prompts/handlers/describe-diagram-mcp-prompt-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAA0B,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAQ3E,eAAO,MAAM,yBAAyB;;iBAKpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,qBACa,+BAAgC,SAAQ,wBAAwB,CAAC,mBAAmB,CAAC;IAC9F,MAAM,CAAC,QAAQ,CAAC,IAAI,sBAAsB;IAC1C,QAAQ,CAAC,IAAI,sBAAwC;IACrD,SAAkB,KAAK,sBAAsB;IAC7C,QAAQ,CAAC,WAAW,SAK+C;IACnE,QAAQ,CAAC,UAAU;;sBAA6B;IAElB,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAE1E,mBAAmB,IAAI,MAAM,EAAE;IAWxC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe;CAiBrE"}
@@ -0,0 +1,102 @@
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
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var DescribeDiagramMcpPromptHandler_1;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.DescribeDiagramMcpPromptHandler = exports.DescribeDiagramArgsSchema = void 0;
29
+ const server_1 = require("@eclipse-glsp/server");
30
+ const inversify_1 = require("inversify");
31
+ const z = require("zod/v4");
32
+ const mcp_handler_shared_1 = require("../../server/mcp-handler-shared");
33
+ const mcp_prompt_handler_1 = require("../../server/mcp-prompt-handler");
34
+ const count_elements_mcp_tool_handler_1 = require("../../tools/handlers/count-elements-mcp-tool-handler");
35
+ const diagram_model_mcp_tool_handler_1 = require("../../tools/handlers/diagram-model-mcp-tool-handler");
36
+ const element_types_mcp_tool_handler_1 = require("../../tools/handlers/element-types-mcp-tool-handler");
37
+ const query_elements_mcp_tool_handler_1 = require("../../tools/handlers/query-elements-mcp-tool-handler");
38
+ const set_selection_mcp_tool_handler_1 = require("../../tools/handlers/set-selection-mcp-tool-handler");
39
+ const set_view_mcp_tool_handler_1 = require("../../tools/handlers/set-view-mcp-tool-handler");
40
+ exports.DescribeDiagramArgsSchema = z.object({
41
+ sessionId: z
42
+ .string()
43
+ .optional()
44
+ .describe('GLSP client session id (open diagram). Defaults to the only open session; required when multiple are open.')
45
+ });
46
+ /**
47
+ * Prompt template that instructs the agent to produce a structured description of a diagram.
48
+ * Pre-baked starting point invokable from the MCP-client UI; the agent then orchestrates the
49
+ * necessary tool calls on its own.
50
+ *
51
+ * Server-scope on purpose — the prompt itself has no per-session state, so we avoid forcing
52
+ * the user to type a sessionId in the common single-diagram case.
53
+ */
54
+ let DescribeDiagramMcpPromptHandler = DescribeDiagramMcpPromptHandler_1 = class DescribeDiagramMcpPromptHandler extends mcp_prompt_handler_1.AbstractMcpPromptHandler {
55
+ constructor() {
56
+ super(...arguments);
57
+ this.name = DescribeDiagramMcpPromptHandler_1.NAME;
58
+ this.title = 'Describe Diagram';
59
+ this.description = 'Produce a structured, skim-friendly description of an open diagram. ' +
60
+ 'The agent picks the right tools to gather data (overview, element-type breakdown, structure, notable elements) ' +
61
+ 'and writes the description in its own words. ' +
62
+ 'Use this as a starting point when the user asks "what does this diagram show?" or wants a documentation-style summary. ' +
63
+ '`sessionId` is optional — defaults to the only open session.';
64
+ this.argsSchema = exports.DescribeDiagramArgsSchema;
65
+ }
66
+ referencedToolNames() {
67
+ return [
68
+ count_elements_mcp_tool_handler_1.CountElementsMcpToolHandler.NAME,
69
+ element_types_mcp_tool_handler_1.ElementTypesMcpToolHandler.NAME,
70
+ diagram_model_mcp_tool_handler_1.DiagramModelMcpToolHandler.NAME,
71
+ query_elements_mcp_tool_handler_1.QueryElementsMcpToolHandler.NAME,
72
+ set_selection_mcp_tool_handler_1.SetSelectionMcpToolHandler.NAME,
73
+ set_view_mcp_tool_handler_1.SetViewMcpToolHandler.NAME
74
+ ];
75
+ }
76
+ createResult(args) {
77
+ const sessionId = (0, mcp_handler_shared_1.resolveActiveSessionId)(this.clientSessionManager, args.sessionId);
78
+ const text = `Describe the diagram for session \`${sessionId}\`. Include:\n\n` +
79
+ `1. **Overview** — diagram type and total element count (use \`${count_elements_mcp_tool_handler_1.CountElementsMcpToolHandler.NAME}\`).\n` +
80
+ `2. **Element-type breakdown** — what kinds of elements are present and how many of each ` +
81
+ `(use \`${element_types_mcp_tool_handler_1.ElementTypesMcpToolHandler.NAME}\` and \`${count_elements_mcp_tool_handler_1.CountElementsMcpToolHandler.NAME}\`).\n` +
82
+ `3. **Structure** — load the model with \`${diagram_model_mcp_tool_handler_1.DiagramModelMcpToolHandler.NAME}\` and summarize the ` +
83
+ `hierarchy and major connections.\n` +
84
+ `4. **Notable elements** — call out anything that stands out (unconnected nodes, deeply ` +
85
+ `nested groups, missing labels). Use \`${query_elements_mcp_tool_handler_1.QueryElementsMcpToolHandler.NAME}\` to locate specific cases.\n\n` +
86
+ `Keep the description concise and skim-friendly. ` +
87
+ `When mentioning an element, prefer its label or type, with the alias appended in parens — e.g. ` +
88
+ `"the 'Brew' task (#7)" or "the decision node (#9)" — never the bare alias alone, since aliases mean nothing to the user. ` +
89
+ `Use \`${set_selection_mcp_tool_handler_1.SetSelectionMcpToolHandler.NAME}\` or \`${set_view_mcp_tool_handler_1.SetViewMcpToolHandler.NAME} → 'center-on-elements'\` to draw the user's attention.`;
90
+ return { messages: [{ role: 'user', content: { type: 'text', text } }] };
91
+ }
92
+ };
93
+ exports.DescribeDiagramMcpPromptHandler = DescribeDiagramMcpPromptHandler;
94
+ DescribeDiagramMcpPromptHandler.NAME = 'describe-diagram';
95
+ __decorate([
96
+ (0, inversify_1.inject)(server_1.ClientSessionManager),
97
+ __metadata("design:type", Object)
98
+ ], DescribeDiagramMcpPromptHandler.prototype, "clientSessionManager", void 0);
99
+ exports.DescribeDiagramMcpPromptHandler = DescribeDiagramMcpPromptHandler = DescribeDiagramMcpPromptHandler_1 = __decorate([
100
+ (0, inversify_1.injectable)()
101
+ ], DescribeDiagramMcpPromptHandler);
102
+ //# sourceMappingURL=describe-diagram-mcp-prompt-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-diagram-mcp-prompt-handler.js","sourceRoot":"","sources":["../../../src/prompts/handlers/describe-diagram-mcp-prompt-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;AAElF,iDAA4D;AAC5D,yCAA+C;AAC/C,4BAA4B;AAC5B,wEAA0F;AAC1F,wEAA2E;AAC3E,0GAAmG;AACnG,wGAAiG;AACjG,wGAAiG;AACjG,0GAAmG;AACnG,wGAAiG;AACjG,8FAAuF;AAE1E,QAAA,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,4GAA4G,CAAC;CAC9H,CAAC,CAAC;AAGH;;;;;;;GAOG;AAEI,IAAM,+BAA+B,uCAArC,MAAM,+BAAgC,SAAQ,6CAA6C;IAA3F;;QAEM,SAAI,GAAG,iCAA+B,CAAC,IAAI,CAAC;QACnC,UAAK,GAAG,kBAAkB,CAAC;QACpC,gBAAW,GAChB,sEAAsE;YACtE,iHAAiH;YACjH,+CAA+C;YAC/C,yHAAyH;YACzH,8DAA8D,CAAC;QAC1D,eAAU,GAAG,iCAAyB,CAAC;IAgCpD,CAAC;IA5BY,mBAAmB;QACxB,OAAO;YACH,6DAA2B,CAAC,IAAI;YAChC,2DAA0B,CAAC,IAAI;YAC/B,2DAA0B,CAAC,IAAI;YAC/B,6DAA2B,CAAC,IAAI;YAChC,2DAA0B,CAAC,IAAI;YAC/B,iDAAqB,CAAC,IAAI;SAC7B,CAAC;IACN,CAAC;IAES,YAAY,CAAC,IAAyB;QAC5C,MAAM,SAAS,GAAG,IAAA,2CAAsB,EAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACpF,MAAM,IAAI,GACN,sCAAsC,SAAS,kBAAkB;YACjE,iEAAiE,6DAA2B,CAAC,IAAI,QAAQ;YACzG,0FAA0F;YAC1F,UAAU,2DAA0B,CAAC,IAAI,YAAY,6DAA2B,CAAC,IAAI,QAAQ;YAC7F,4CAA4C,2DAA0B,CAAC,IAAI,uBAAuB;YAClG,oCAAoC;YACpC,yFAAyF;YACzF,yCAAyC,6DAA2B,CAAC,IAAI,kCAAkC;YAC3G,kDAAkD;YAClD,iGAAiG;YACjG,2HAA2H;YAC3H,SAAS,2DAA0B,CAAC,IAAI,WAAW,iDAAqB,CAAC,IAAI,yDAAyD,CAAC;QAC3I,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;IAC7E,CAAC;;AAzCQ,0EAA+B;AACxB,oCAAI,GAAG,kBAAkB,AAArB,CAAsB;AAWF;IAAvC,IAAA,kBAAM,EAAC,6BAAoB,CAAC;;6EAAsD;0CAZ1E,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CA0C3C"}
@@ -0,0 +1,44 @@
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 { ClientSessionManager } from '@eclipse-glsp/server';
17
+ import * as z from 'zod/v4';
18
+ import { McpPromptResult } from '../../server/mcp-handler-shared';
19
+ import { AbstractMcpPromptHandler } from '../../server/mcp-prompt-handler';
20
+ export declare const SuggestImprovementsArgsSchema: z.ZodObject<{
21
+ sessionId: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ export type SuggestImprovementsArgs = z.infer<typeof SuggestImprovementsArgsSchema>;
24
+ /**
25
+ * Prompt template that asks the agent to review the diagram and propose concrete improvements
26
+ * (validation issues, structural smells, missing labels, etc.). The agent orchestrates the
27
+ * tool calls; this prompt only frames the task.
28
+ *
29
+ * Server-scope on purpose — the prompt itself has no per-session state, so we avoid forcing
30
+ * the user to type a sessionId in the common single-diagram case.
31
+ */
32
+ export declare class SuggestImprovementsMcpPromptHandler extends AbstractMcpPromptHandler<SuggestImprovementsArgs> {
33
+ static readonly NAME = "suggest-improvements";
34
+ readonly name = "suggest-improvements";
35
+ readonly title = "Suggest Diagram Improvements";
36
+ readonly description: string;
37
+ readonly argsSchema: z.ZodObject<{
38
+ sessionId: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ protected clientSessionManager: ClientSessionManager;
41
+ referencedToolNames(): string[];
42
+ protected createResult(args: SuggestImprovementsArgs): McpPromptResult;
43
+ }
44
+ //# sourceMappingURL=suggest-improvements-mcp-prompt-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggest-improvements-mcp-prompt-handler.d.ts","sourceRoot":"","sources":["../../../src/prompts/handlers/suggest-improvements-mcp-prompt-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAA0B,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAM3E,eAAO,MAAM,6BAA6B;;iBAKxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;;;;;;GAOG;AACH,qBACa,mCAAoC,SAAQ,wBAAwB,CAAC,uBAAuB,CAAC;IACtG,MAAM,CAAC,QAAQ,CAAC,IAAI,0BAA0B;IAC9C,QAAQ,CAAC,IAAI,0BAA4C;IACzD,SAAkB,KAAK,kCAAkC;IACzD,QAAQ,CAAC,WAAW,SAK+C;IACnE,QAAQ,CAAC,UAAU;;sBAAiC;IAEtB,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAE1E,mBAAmB,IAAI,MAAM,EAAE;IASxC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,uBAAuB,GAAG,eAAe;CAkBzE"}