@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.
Files changed (303) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +57 -0
  3. package/lib/index.d.ts +23 -0
  4. package/lib/index.d.ts.map +1 -0
  5. package/lib/index.js +41 -0
  6. package/lib/index.js.map +1 -0
  7. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts +43 -0
  8. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts.map +1 -0
  9. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js +96 -0
  10. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js.map +1 -0
  11. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts +43 -0
  12. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts.map +1 -0
  13. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js +95 -0
  14. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js.map +1 -0
  15. package/lib/prompts/index.d.ts +18 -0
  16. package/lib/prompts/index.d.ts.map +1 -0
  17. package/lib/prompts/index.js +34 -0
  18. package/lib/prompts/index.js.map +1 -0
  19. package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts +81 -0
  20. package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts.map +1 -0
  21. package/lib/resources/handlers/diagram-png-mcp-resource-handler.js +174 -0
  22. package/lib/resources/handlers/diagram-png-mcp-resource-handler.js.map +1 -0
  23. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts +52 -0
  24. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts.map +1 -0
  25. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js +96 -0
  26. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js.map +1 -0
  27. package/lib/resources/index.d.ts +20 -0
  28. package/lib/resources/index.d.ts.map +1 -0
  29. package/lib/resources/index.js +36 -0
  30. package/lib/resources/index.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/index.d.ts +37 -0
  44. package/lib/server/index.d.ts.map +1 -0
  45. package/lib/server/index.js +57 -0
  46. package/lib/server/index.js.map +1 -0
  47. package/lib/server/lru-event-store.d.ts +53 -0
  48. package/lib/server/lru-event-store.d.ts.map +1 -0
  49. package/lib/server/lru-event-store.js +100 -0
  50. package/lib/server/lru-event-store.js.map +1 -0
  51. package/lib/server/mcp-diagram-handler-dispatcher.d.ts +144 -0
  52. package/lib/server/mcp-diagram-handler-dispatcher.d.ts.map +1 -0
  53. package/lib/server/mcp-diagram-handler-dispatcher.js +382 -0
  54. package/lib/server/mcp-diagram-handler-dispatcher.js.map +1 -0
  55. package/lib/server/mcp-diagram-module.d.ts +123 -0
  56. package/lib/server/mcp-diagram-module.d.ts.map +1 -0
  57. package/lib/server/mcp-diagram-module.js +186 -0
  58. package/lib/server/mcp-diagram-module.js.map +1 -0
  59. package/lib/server/mcp-diagram-prompt-handler-registry.d.ts +33 -0
  60. package/lib/server/mcp-diagram-prompt-handler-registry.d.ts.map +1 -0
  61. package/lib/server/mcp-diagram-prompt-handler-registry.js +76 -0
  62. package/lib/server/mcp-diagram-prompt-handler-registry.js.map +1 -0
  63. package/lib/server/mcp-diagram-resource-handler-registry.d.ts +35 -0
  64. package/lib/server/mcp-diagram-resource-handler-registry.d.ts.map +1 -0
  65. package/lib/server/mcp-diagram-resource-handler-registry.js +94 -0
  66. package/lib/server/mcp-diagram-resource-handler-registry.js.map +1 -0
  67. package/lib/server/mcp-diagram-tool-handler-registry.d.ts +57 -0
  68. package/lib/server/mcp-diagram-tool-handler-registry.d.ts.map +1 -0
  69. package/lib/server/mcp-diagram-tool-handler-registry.js +111 -0
  70. package/lib/server/mcp-diagram-tool-handler-registry.js.map +1 -0
  71. package/lib/server/mcp-handler-shared.d.ts +142 -0
  72. package/lib/server/mcp-handler-shared.d.ts.map +1 -0
  73. package/lib/server/mcp-handler-shared.js +199 -0
  74. package/lib/server/mcp-handler-shared.js.map +1 -0
  75. package/lib/server/mcp-http-transport.d.ts +93 -0
  76. package/lib/server/mcp-http-transport.d.ts.map +1 -0
  77. package/lib/server/mcp-http-transport.js +350 -0
  78. package/lib/server/mcp-http-transport.js.map +1 -0
  79. package/lib/server/mcp-id-alias-service.d.ts +70 -0
  80. package/lib/server/mcp-id-alias-service.d.ts.map +1 -0
  81. package/lib/server/mcp-id-alias-service.js +85 -0
  82. package/lib/server/mcp-id-alias-service.js.map +1 -0
  83. package/lib/server/mcp-input-schemas.d.ts +73 -0
  84. package/lib/server/mcp-input-schemas.d.ts.map +1 -0
  85. package/lib/server/mcp-input-schemas.js +67 -0
  86. package/lib/server/mcp-input-schemas.js.map +1 -0
  87. package/lib/server/mcp-label-provider.d.ts +45 -0
  88. package/lib/server/mcp-label-provider.d.ts.map +1 -0
  89. package/lib/server/mcp-label-provider.js +42 -0
  90. package/lib/server/mcp-label-provider.js.map +1 -0
  91. package/lib/server/mcp-log-level-registry.d.ts +54 -0
  92. package/lib/server/mcp-log-level-registry.d.ts.map +1 -0
  93. package/lib/server/mcp-log-level-registry.js +80 -0
  94. package/lib/server/mcp-log-level-registry.js.map +1 -0
  95. package/lib/server/mcp-logger.d.ts +59 -0
  96. package/lib/server/mcp-logger.d.ts.map +1 -0
  97. package/lib/server/mcp-logger.js +104 -0
  98. package/lib/server/mcp-logger.js.map +1 -0
  99. package/lib/server/mcp-mime-types.d.ts +28 -0
  100. package/lib/server/mcp-mime-types.d.ts.map +1 -0
  101. package/lib/server/mcp-mime-types.js +18 -0
  102. package/lib/server/mcp-mime-types.js.map +1 -0
  103. package/lib/server/mcp-options.d.ts +39 -0
  104. package/lib/server/mcp-options.d.ts.map +1 -0
  105. package/lib/server/mcp-options.js +53 -0
  106. package/lib/server/mcp-options.js.map +1 -0
  107. package/lib/server/mcp-progress-reporter.d.ts +48 -0
  108. package/lib/server/mcp-progress-reporter.d.ts.map +1 -0
  109. package/lib/server/mcp-progress-reporter.js +66 -0
  110. package/lib/server/mcp-progress-reporter.js.map +1 -0
  111. package/lib/server/mcp-prompt-handler.d.ts +120 -0
  112. package/lib/server/mcp-prompt-handler.d.ts.map +1 -0
  113. package/lib/server/mcp-prompt-handler.js +131 -0
  114. package/lib/server/mcp-prompt-handler.js.map +1 -0
  115. package/lib/server/mcp-request-context.d.ts +37 -0
  116. package/lib/server/mcp-request-context.d.ts.map +1 -0
  117. package/lib/server/mcp-request-context.js +37 -0
  118. package/lib/server/mcp-request-context.js.map +1 -0
  119. package/lib/server/mcp-resource-handler.d.ts +212 -0
  120. package/lib/server/mcp-resource-handler.d.ts.map +1 -0
  121. package/lib/server/mcp-resource-handler.js +298 -0
  122. package/lib/server/mcp-resource-handler.js.map +1 -0
  123. package/lib/server/mcp-server-launcher.d.ts +143 -0
  124. package/lib/server/mcp-server-launcher.d.ts.map +1 -0
  125. package/lib/server/mcp-server-launcher.js +355 -0
  126. package/lib/server/mcp-server-launcher.js.map +1 -0
  127. package/lib/server/mcp-server-module.d.ts +143 -0
  128. package/lib/server/mcp-server-module.d.ts.map +1 -0
  129. package/lib/server/mcp-server-module.js +249 -0
  130. package/lib/server/mcp-server-module.js.map +1 -0
  131. package/lib/server/mcp-session.d.ts +44 -0
  132. package/lib/server/mcp-session.d.ts.map +1 -0
  133. package/lib/server/mcp-session.js +18 -0
  134. package/lib/server/mcp-session.js.map +1 -0
  135. package/lib/server/mcp-tool-handler.d.ts +259 -0
  136. package/lib/server/mcp-tool-handler.d.ts.map +1 -0
  137. package/lib/server/mcp-tool-handler.js +355 -0
  138. package/lib/server/mcp-tool-handler.js.map +1 -0
  139. package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts +46 -0
  140. package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts.map +1 -0
  141. package/lib/tools/handlers/count-elements-mcp-tool-handler.js +76 -0
  142. package/lib/tools/handlers/count-elements-mcp-tool-handler.js.map +1 -0
  143. package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts +112 -0
  144. package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts.map +1 -0
  145. package/lib/tools/handlers/create-edges-mcp-tool-handler.js +190 -0
  146. package/lib/tools/handlers/create-edges-mcp-tool-handler.js.map +1 -0
  147. package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts +81 -0
  148. package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts.map +1 -0
  149. package/lib/tools/handlers/create-nodes-mcp-tool-handler.js +123 -0
  150. package/lib/tools/handlers/create-nodes-mcp-tool-handler.js.map +1 -0
  151. package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts +52 -0
  152. package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts.map +1 -0
  153. package/lib/tools/handlers/delete-elements-mcp-tool-handler.js +73 -0
  154. package/lib/tools/handlers/delete-elements-mcp-tool-handler.js.map +1 -0
  155. package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts +59 -0
  156. package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts.map +1 -0
  157. package/lib/tools/handlers/diagram-model-mcp-tool-handler.js +78 -0
  158. package/lib/tools/handlers/diagram-model-mcp-tool-handler.js.map +1 -0
  159. package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts +97 -0
  160. package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts.map +1 -0
  161. package/lib/tools/handlers/element-types-mcp-tool-handler.js +155 -0
  162. package/lib/tools/handlers/element-types-mcp-tool-handler.js.map +1 -0
  163. package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts +43 -0
  164. package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts.map +1 -0
  165. package/lib/tools/handlers/get-selection-mcp-tool-handler.js +68 -0
  166. package/lib/tools/handlers/get-selection-mcp-tool-handler.js.map +1 -0
  167. package/lib/tools/handlers/layout-mcp-tool-handler.d.ts +43 -0
  168. package/lib/tools/handlers/layout-mcp-tool-handler.d.ts.map +1 -0
  169. package/lib/tools/handlers/layout-mcp-tool-handler.js +71 -0
  170. package/lib/tools/handlers/layout-mcp-tool-handler.js.map +1 -0
  171. package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts +78 -0
  172. package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts.map +1 -0
  173. package/lib/tools/handlers/modify-edges-mcp-tool-handler.js +136 -0
  174. package/lib/tools/handlers/modify-edges-mcp-tool-handler.js.map +1 -0
  175. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts +92 -0
  176. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts.map +1 -0
  177. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js +125 -0
  178. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js.map +1 -0
  179. package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts +102 -0
  180. package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts.map +1 -0
  181. package/lib/tools/handlers/query-elements-mcp-tool-handler.js +158 -0
  182. package/lib/tools/handlers/query-elements-mcp-tool-handler.js.map +1 -0
  183. package/lib/tools/handlers/redo-mcp-tool-handler.d.ts +45 -0
  184. package/lib/tools/handlers/redo-mcp-tool-handler.d.ts.map +1 -0
  185. package/lib/tools/handlers/redo-mcp-tool-handler.js +73 -0
  186. package/lib/tools/handlers/redo-mcp-tool-handler.js.map +1 -0
  187. package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts +55 -0
  188. package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts.map +1 -0
  189. package/lib/tools/handlers/save-model-mcp-tool-handler.js +91 -0
  190. package/lib/tools/handlers/save-model-mcp-tool-handler.js.map +1 -0
  191. package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts +65 -0
  192. package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts.map +1 -0
  193. package/lib/tools/handlers/session-info-mcp-tool-handler.js +108 -0
  194. package/lib/tools/handlers/session-info-mcp-tool-handler.js.map +1 -0
  195. package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts +60 -0
  196. package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts.map +1 -0
  197. package/lib/tools/handlers/set-selection-mcp-tool-handler.js +103 -0
  198. package/lib/tools/handlers/set-selection-mcp-tool-handler.js.map +1 -0
  199. package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts +110 -0
  200. package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts.map +1 -0
  201. package/lib/tools/handlers/set-view-mcp-tool-handler.js +142 -0
  202. package/lib/tools/handlers/set-view-mcp-tool-handler.js.map +1 -0
  203. package/lib/tools/handlers/undo-mcp-tool-handler.d.ts +45 -0
  204. package/lib/tools/handlers/undo-mcp-tool-handler.d.ts.map +1 -0
  205. package/lib/tools/handlers/undo-mcp-tool-handler.js +74 -0
  206. package/lib/tools/handlers/undo-mcp-tool-handler.js.map +1 -0
  207. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts +66 -0
  208. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts.map +1 -0
  209. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js +0 -0
  210. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js.map +1 -0
  211. package/lib/tools/index.d.ts +34 -0
  212. package/lib/tools/index.d.ts.map +1 -0
  213. package/lib/tools/index.js +50 -0
  214. package/lib/tools/index.js.map +1 -0
  215. package/lib/util/index.d.ts +18 -0
  216. package/lib/util/index.d.ts.map +1 -0
  217. package/lib/util/index.js +34 -0
  218. package/lib/util/index.js.map +1 -0
  219. package/lib/util/markdown-util.d.ts +20 -0
  220. package/lib/util/markdown-util.d.ts.map +1 -0
  221. package/lib/util/markdown-util.js +45 -0
  222. package/lib/util/markdown-util.js.map +1 -0
  223. package/lib/util/mcp-util.d.ts +22 -0
  224. package/lib/util/mcp-util.d.ts.map +1 -0
  225. package/lib/util/mcp-util.js +29 -0
  226. package/lib/util/mcp-util.js.map +1 -0
  227. package/package.json +63 -0
  228. package/src/index.ts +24 -0
  229. package/src/prompts/handlers/describe-diagram-mcp-prompt-handler.ts +89 -0
  230. package/src/prompts/handlers/suggest-improvements-mcp-prompt-handler.ts +86 -0
  231. package/src/prompts/index.ts +18 -0
  232. package/src/resources/handlers/diagram-png-mcp-resource-handler.ts +181 -0
  233. package/src/resources/handlers/diagram-svg-mcp-resource-handler.ts +89 -0
  234. package/src/resources/index.ts +20 -0
  235. package/src/resources/services/element-types-provider.ts +105 -0
  236. package/src/resources/services/mcp-model-serializer.ts +211 -0
  237. package/src/server/glsp-mcp-server.spec.ts +73 -0
  238. package/src/server/glsp-mcp-server.ts +196 -0
  239. package/src/server/index.ts +42 -0
  240. package/src/server/lru-event-store.spec.ts +121 -0
  241. package/src/server/lru-event-store.ts +112 -0
  242. package/src/server/mcp-diagram-handler-dispatcher.spec.ts +231 -0
  243. package/src/server/mcp-diagram-handler-dispatcher.ts +459 -0
  244. package/src/server/mcp-diagram-module.ts +248 -0
  245. package/src/server/mcp-diagram-prompt-handler-registry.ts +59 -0
  246. package/src/server/mcp-diagram-resource-handler-registry.ts +73 -0
  247. package/src/server/mcp-diagram-tool-handler-registry.ts +97 -0
  248. package/src/server/mcp-handler-shared.spec.ts +53 -0
  249. package/src/server/mcp-handler-shared.ts +247 -0
  250. package/src/server/mcp-http-transport-e2e.spec.ts +151 -0
  251. package/src/server/mcp-http-transport.spec.ts +385 -0
  252. package/src/server/mcp-http-transport.ts +368 -0
  253. package/src/server/mcp-id-alias-service.spec.ts +106 -0
  254. package/src/server/mcp-id-alias-service.ts +104 -0
  255. package/src/server/mcp-input-schemas.ts +82 -0
  256. package/src/server/mcp-label-provider.ts +52 -0
  257. package/src/server/mcp-log-level-registry.spec.ts +75 -0
  258. package/src/server/mcp-log-level-registry.ts +90 -0
  259. package/src/server/mcp-logger.spec.ts +227 -0
  260. package/src/server/mcp-logger.ts +91 -0
  261. package/src/server/mcp-mime-types.ts +31 -0
  262. package/src/server/mcp-options.ts +43 -0
  263. package/src/server/mcp-progress-reporter.spec.ts +93 -0
  264. package/src/server/mcp-progress-reporter.ts +67 -0
  265. package/src/server/mcp-prompt-handler.ts +157 -0
  266. package/src/server/mcp-request-context.ts +39 -0
  267. package/src/server/mcp-resource-handler.ts +389 -0
  268. package/src/server/mcp-server-launcher.spec.ts +173 -0
  269. package/src/server/mcp-server-launcher.ts +369 -0
  270. package/src/server/mcp-server-module.ts +287 -0
  271. package/src/server/mcp-session.ts +45 -0
  272. package/src/server/mcp-tool-handler.spec.ts +182 -0
  273. package/src/server/mcp-tool-handler.ts +431 -0
  274. package/src/server/raw-http.spec.ts +59 -0
  275. package/src/tools/handlers/count-elements-mcp-tool-handler.spec.ts +99 -0
  276. package/src/tools/handlers/count-elements-mcp-tool-handler.ts +66 -0
  277. package/src/tools/handlers/create-edges-mcp-tool-handler.spec.ts +196 -0
  278. package/src/tools/handlers/create-edges-mcp-tool-handler.ts +205 -0
  279. package/src/tools/handlers/create-nodes-mcp-tool-handler.spec.ts +197 -0
  280. package/src/tools/handlers/create-nodes-mcp-tool-handler.ts +131 -0
  281. package/src/tools/handlers/delete-elements-mcp-tool-handler.ts +73 -0
  282. package/src/tools/handlers/diagram-model-mcp-tool-handler.ts +66 -0
  283. package/src/tools/handlers/element-types-mcp-tool-handler.ts +151 -0
  284. package/src/tools/handlers/get-selection-mcp-tool-handler.ts +54 -0
  285. package/src/tools/handlers/layout-mcp-tool-handler.ts +56 -0
  286. package/src/tools/handlers/modify-edges-mcp-tool-handler.ts +148 -0
  287. package/src/tools/handlers/modify-nodes-mcp-tool-handler.ts +140 -0
  288. package/src/tools/handlers/query-elements-mcp-tool-handler.spec.ts +210 -0
  289. package/src/tools/handlers/query-elements-mcp-tool-handler.ts +161 -0
  290. package/src/tools/handlers/redo-mcp-tool-handler.ts +62 -0
  291. package/src/tools/handlers/save-model-mcp-tool-handler.ts +71 -0
  292. package/src/tools/handlers/session-info-mcp-tool-handler.spec.ts +152 -0
  293. package/src/tools/handlers/session-info-mcp-tool-handler.ts +97 -0
  294. package/src/tools/handlers/set-selection-mcp-tool-handler.spec.ts +118 -0
  295. package/src/tools/handlers/set-selection-mcp-tool-handler.ts +90 -0
  296. package/src/tools/handlers/set-view-mcp-tool-handler.ts +162 -0
  297. package/src/tools/handlers/undo-mcp-tool-handler.ts +61 -0
  298. package/src/tools/handlers/validate-diagram-mcp-tool-handler.ts +0 -0
  299. package/src/tools/index.ts +34 -0
  300. package/src/tools/tool-annotations.spec.ts +141 -0
  301. package/src/util/index.ts +18 -0
  302. package/src/util/markdown-util.ts +44 -0
  303. package/src/util/mcp-util.ts +25 -0
@@ -0,0 +1,78 @@
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 { GModelElement } from '@eclipse-glsp/graph';
17
+ import { GModelSerializer, Logger } from '@eclipse-glsp/server';
18
+ import { McpStructuredContent } from '../../server/mcp-handler-shared';
19
+ import { McpIdAliasService } from '../../server/mcp-id-alias-service';
20
+ export declare const McpModelSerializer: unique symbol;
21
+ /** Loose JSON-object shape mirroring `GModelSerializer.createSchema` output — open-keyed because
22
+ * GModel attributes vary per element type. Reads must narrow before use. */
23
+ export interface SerializedElement {
24
+ [key: string]: unknown;
25
+ }
26
+ /**
27
+ * Transforms a graphical model into a representation suitable for LLM consumption. Markdown and
28
+ * JSON are both reasonable formats; the default impl ({@link MarkdownMcpModelSerializer}) emits
29
+ * Markdown for {@link serialize}/{@link serializeArray} and an object payload for
30
+ * {@link serializeStructured} (the dual-emit `structuredContent` counterpart). Aliasing of element
31
+ * ids happens internally via the per-session {@link McpIdAliasService}.
32
+ *
33
+ * @experimental
34
+ */
35
+ export interface McpModelSerializer {
36
+ /** Serializes a single element (and its descendants). */
37
+ serialize(element: GModelElement): string;
38
+ /** Serializes an array of elements; duplicates introduced by hierarchy are removed. */
39
+ serializeArray(elements: GModelElement[]): string;
40
+ /**
41
+ * Structured-content counterpart of {@link serialize} for dual-emit
42
+ * (`CallToolResult.structuredContent`). The shape is intentionally open: `{ elements: [...] }`
43
+ * with each entry carrying `id` + `type` + adopter-specific attrs (passthrough).
44
+ */
45
+ serializeStructured(element: GModelElement): McpStructuredContent;
46
+ /** Structured-content counterpart of {@link serializeArray}. */
47
+ serializeStructuredArray(elements: GModelElement[]): McpStructuredContent;
48
+ }
49
+ /**
50
+ * Default {@link McpModelSerializer} — emits Markdown with one H1 section per element type
51
+ * followed by a table of all elements of that type. Flattens the GModel tree, drops keys with
52
+ * no LLM value (`cssClasses`, `revision`, `layout`, etc., see {@link keysToRemove}), truncates
53
+ * position+size to integers and derives a `bounds` rectangle so the LLM doesn't redo arithmetic.
54
+ *
55
+ * Generic: no control over element order or per-type attribute order, since no specific GLSP
56
+ * adopter is known. Adopters override (see workflow's `WorkflowMcpModelSerializer`) when
57
+ * semantic ordering matters.
58
+ */
59
+ export declare class MarkdownMcpModelSerializer implements McpModelSerializer {
60
+ protected gModelSerializer: GModelSerializer;
61
+ protected aliasService: McpIdAliasService;
62
+ protected logger: Logger;
63
+ protected keysToRemove: string[];
64
+ /** Warn once per binding when the bare default is used — subclasses suppress via the constructor check. */
65
+ protected warnIfGenericDefault(): void;
66
+ serialize(element: GModelElement): string;
67
+ serializeArray(elements: GModelElement[]): string;
68
+ serializeStructured(element: GModelElement): McpStructuredContent;
69
+ serializeStructuredArray(elements: GModelElement[]): McpStructuredContent;
70
+ /** Common pipeline: prepare, dedupe by id, group by type, alias ids — used by both renders. */
71
+ protected buildAliasedTypeBuckets(elements: GModelElement[]): Record<string, SerializedElement[]>;
72
+ protected applyAlias(element: SerializedElement): SerializedElement;
73
+ protected prepareElement(element: GModelElement): Record<string, SerializedElement[]>;
74
+ protected flattenStructure(element: SerializedElement, parentId?: string): SerializedElement[];
75
+ protected removeKeys(element: SerializedElement): void;
76
+ protected combinePositionAndSize(element: SerializedElement): void;
77
+ }
78
+ //# sourceMappingURL=mcp-model-serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-model-serializer.d.ts","sourceRoot":"","sources":["../../../src/resources/services/mcp-model-serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAa,gBAAgB,EAAE,MAAM,EAAS,MAAM,sBAAsB,CAAC;AAElF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAGtE,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D;4EAC4E;AAC5E,MAAM,WAAW,iBAAiB;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;;;;;;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G,iBAAiB,EAAE;IAc9F,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAQtD,SAAS,CAAC,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;CA8BrE"}
@@ -0,0 +1,188 @@
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 MarkdownMcpModelSerializer_1;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.MarkdownMcpModelSerializer = exports.McpModelSerializer = void 0;
29
+ const server_1 = require("@eclipse-glsp/server");
30
+ const inversify_1 = require("inversify");
31
+ const mcp_id_alias_service_1 = require("../../server/mcp-id-alias-service");
32
+ const util_1 = require("../../util");
33
+ exports.McpModelSerializer = Symbol('McpModelSerializer');
34
+ /**
35
+ * Default {@link McpModelSerializer} — emits Markdown with one H1 section per element type
36
+ * followed by a table of all elements of that type. Flattens the GModel tree, drops keys with
37
+ * no LLM value (`cssClasses`, `revision`, `layout`, etc., see {@link keysToRemove}), truncates
38
+ * position+size to integers and derives a `bounds` rectangle so the LLM doesn't redo arithmetic.
39
+ *
40
+ * Generic: no control over element order or per-type attribute order, since no specific GLSP
41
+ * adopter is known. Adopters override (see workflow's `WorkflowMcpModelSerializer`) when
42
+ * semantic ordering matters.
43
+ */
44
+ let MarkdownMcpModelSerializer = MarkdownMcpModelSerializer_1 = class MarkdownMcpModelSerializer {
45
+ constructor() {
46
+ this.keysToRemove = [
47
+ 'cssClasses',
48
+ 'revision',
49
+ 'layout',
50
+ 'args',
51
+ 'layoutOptions',
52
+ 'alignment',
53
+ 'children',
54
+ 'routingPoints',
55
+ 'resizeLocations',
56
+ 'parent'
57
+ ];
58
+ }
59
+ /** Warn once per binding when the bare default is used — subclasses suppress via the constructor check. */
60
+ warnIfGenericDefault() {
61
+ if (this.constructor === MarkdownMcpModelSerializer_1) {
62
+ this.logger.warn('Using generic MarkdownMcpModelSerializer; bind a diagram-specific subclass via ' +
63
+ 'DefaultMcpDiagramModule.bindModelSerializer() for richer LLM output.');
64
+ }
65
+ }
66
+ serialize(element) {
67
+ return this.serializeArray([element]);
68
+ }
69
+ serializeArray(elements) {
70
+ return Object.entries(this.buildAliasedTypeBuckets(elements))
71
+ .filter(([, bucket]) => bucket.length > 0)
72
+ .flatMap(([type, bucket]) => [`# ${type}`, (0, util_1.objectArrayToMarkdownTable)(bucket)])
73
+ .join('\n');
74
+ }
75
+ serializeStructured(element) {
76
+ return this.serializeStructuredArray([element]);
77
+ }
78
+ serializeStructuredArray(elements) {
79
+ return {
80
+ elements: Object.values(this.buildAliasedTypeBuckets(elements))
81
+ .filter(bucket => bucket.length > 0)
82
+ .flat()
83
+ };
84
+ }
85
+ /** Common pipeline: prepare, dedupe by id, group by type, alias ids — used by both renders. */
86
+ buildAliasedTypeBuckets(elements) {
87
+ const elementsByTypeArray = elements.map(element => this.prepareElement(element));
88
+ const result = {};
89
+ const allKeys = new Set(elementsByTypeArray.flatMap(obj => Object.keys(obj)));
90
+ allKeys.forEach(key => {
91
+ const combined = elementsByTypeArray.flatMap(obj => { var _a; return (_a = obj[key]) !== null && _a !== void 0 ? _a : []; });
92
+ result[key] = Array.from(new Map(combined.map(item => [item.id, item])).values()).map(item => this.applyAlias(item));
93
+ });
94
+ return result;
95
+ }
96
+ applyAlias(element) {
97
+ for (const field of ['id', 'sourceId', 'targetId', 'parentId']) {
98
+ const value = element[field];
99
+ if (typeof value === 'string') {
100
+ element[field] = this.aliasService.alias(value);
101
+ }
102
+ }
103
+ return element;
104
+ }
105
+ prepareElement(element) {
106
+ var _a;
107
+ const schema = this.gModelSerializer.createSchema(element);
108
+ const elements = this.flattenStructure(schema, (_a = element.parent) === null || _a === void 0 ? void 0 : _a.id);
109
+ const result = {};
110
+ elements.forEach(elem => {
111
+ var _a;
112
+ this.removeKeys(elem);
113
+ this.combinePositionAndSize(elem);
114
+ const type = typeof elem.type === 'string' ? elem.type : 'unknown';
115
+ ((_a = result[type]) !== null && _a !== void 0 ? _a : (result[type] = [])).push(elem);
116
+ });
117
+ return result;
118
+ }
119
+ flattenStructure(element, parentId) {
120
+ const newElement = { ...element };
121
+ const result = [newElement];
122
+ const children = newElement.children;
123
+ if (Array.isArray(children)) {
124
+ const ownId = typeof newElement.id === 'string' ? newElement.id : undefined;
125
+ children.forEach(child => this.flattenStructure(child, ownId).forEach(descendant => result.push(descendant)));
126
+ }
127
+ newElement.parentId = parentId;
128
+ return result;
129
+ }
130
+ removeKeys(element) {
131
+ for (const key of Object.keys(element)) {
132
+ if (this.keysToRemove.includes(key)) {
133
+ delete element[key];
134
+ }
135
+ }
136
+ }
137
+ combinePositionAndSize(element) {
138
+ const position = element.position;
139
+ if (!server_1.Point.is(position)) {
140
+ return;
141
+ }
142
+ const x = Math.trunc(position.x);
143
+ const y = Math.trunc(position.y);
144
+ element.position = { x, y };
145
+ // Omit `size` and `bounds` when an element has no explicit geometry yet (e.g., a freshly
146
+ // created node whose `.size()` has not been applied). Emitting `{width: 0, height: 0}`
147
+ // would mislead an LLM consumer into "fixing" placeholder bounds. Visual rendering on
148
+ // the GLSP/sprotty client is unaffected — those nodes are laid out via CSS regardless.
149
+ const size = element.size;
150
+ if (!server_1.Dimension.is(size) || (Math.trunc(size.width) === 0 && Math.trunc(size.height) === 0)) {
151
+ delete element.size;
152
+ delete element.bounds;
153
+ return;
154
+ }
155
+ const width = Math.trunc(size.width);
156
+ const height = Math.trunc(size.height);
157
+ element.size = { width, height };
158
+ element.bounds = {
159
+ left: x,
160
+ right: x + width,
161
+ top: y,
162
+ bottom: y + height
163
+ };
164
+ }
165
+ };
166
+ exports.MarkdownMcpModelSerializer = MarkdownMcpModelSerializer;
167
+ __decorate([
168
+ (0, inversify_1.inject)(server_1.GModelSerializer),
169
+ __metadata("design:type", Object)
170
+ ], MarkdownMcpModelSerializer.prototype, "gModelSerializer", void 0);
171
+ __decorate([
172
+ (0, inversify_1.inject)(mcp_id_alias_service_1.McpIdAliasService),
173
+ __metadata("design:type", Object)
174
+ ], MarkdownMcpModelSerializer.prototype, "aliasService", void 0);
175
+ __decorate([
176
+ (0, inversify_1.inject)(server_1.Logger),
177
+ __metadata("design:type", server_1.Logger)
178
+ ], MarkdownMcpModelSerializer.prototype, "logger", void 0);
179
+ __decorate([
180
+ (0, inversify_1.postConstruct)(),
181
+ __metadata("design:type", Function),
182
+ __metadata("design:paramtypes", []),
183
+ __metadata("design:returntype", void 0)
184
+ ], MarkdownMcpModelSerializer.prototype, "warnIfGenericDefault", null);
185
+ exports.MarkdownMcpModelSerializer = MarkdownMcpModelSerializer = MarkdownMcpModelSerializer_1 = __decorate([
186
+ (0, inversify_1.injectable)()
187
+ ], MarkdownMcpModelSerializer);
188
+ //# sourceMappingURL=mcp-model-serializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-model-serializer.js","sourceRoot":"","sources":["../../../src/resources/services/mcp-model-serializer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;AAGlF,iDAAkF;AAClF,yCAA8D;AAE9D,4EAAsE;AACtE,qCAAwD;AAE3C,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAmC/D;;;;;;;;;GASG;AAEI,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAAhC;QAKO,iBAAY,GAAa;YAC/B,YAAY;YACZ,UAAU;YACV,QAAQ;YACR,MAAM;YACN,eAAe;YACf,WAAW;YACX,UAAU;YACV,eAAe;YACf,iBAAiB;YACjB,QAAQ;SACX,CAAC;IA6HN,CAAC;IA3HG,2GAA2G;IAEjG,oBAAoB;QAC1B,IAAI,IAAI,CAAC,WAAW,KAAK,4BAA0B,EAAE,CAAC;YAClD,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,iFAAiF;gBAC7E,sEAAsE,CAC7E,CAAC;QACN,CAAC;IACL,CAAC;IAED,SAAS,CAAC,OAAsB;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,cAAc,CAAC,QAAyB;QACpC,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;aACxD,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;aACzC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,IAAA,iCAA0B,EAAC,MAAM,CAAC,CAAC,CAAC;aAC9E,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,mBAAm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sFAAsF;QACtF,uFAAuF;QACvF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,kBAAS,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACzF,OAAO,OAAO,CAAC,IAAI,CAAC;YACpB,OAAO,OAAO,CAAC,MAAM,CAAC;YACtB,OAAO;QACX,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QACjC,OAAO,CAAC,MAAM,GAAG;YACb,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC,GAAG,KAAK;YAChB,GAAG,EAAE,CAAC;YACN,MAAM,EAAE,CAAC,GAAG,MAAM;SACrB,CAAC;IACN,CAAC;CACJ,CAAA;AA7IY,gEAA0B;AACC;IAAnC,IAAA,kBAAM,EAAC,yBAAgB,CAAC;;oEAA8C;AAClC;IAApC,IAAA,kBAAM,EAAC,wCAAiB,CAAC;;gEAA2C;AAC3C;IAAzB,IAAA,kBAAM,EAAC,eAAM,CAAC;8BAAmB,eAAM;0DAAC;AAiB/B;IADT,IAAA,yBAAa,GAAE;;;;sEAQf;qCA3BQ,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CA6ItC"}
@@ -0,0 +1,82 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Disposable, Logger, McpServerOptions } from '@eclipse-glsp/server';
17
+ import { McpServer, RegisteredPrompt, RegisteredResource, RegisteredResourceTemplate, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
18
+ export declare const GLSPMcpServer: unique symbol;
19
+ /** Either a static resource or a templated resource registration. */
20
+ export type GLSPMcpResource = RegisteredResource | RegisteredResourceTemplate;
21
+ /**
22
+ * Curated, per-session view onto the underlying MCP server. Handlers see this during
23
+ * registration; the launcher disposes it on session-close and on server shutdown.
24
+ */
25
+ export interface GLSPMcpServer extends Pick<McpServer, 'registerPrompt' | 'registerResource' | 'registerTool' | 'sendLoggingMessage' | 'isConnected' | 'connect'>, Disposable {
26
+ readonly options: McpServerOptions;
27
+ /** Register a tool. Wraps the SDK's {@link McpServer.registerTool} and updates the local log. */
28
+ readonly registerTool: McpServer['registerTool'];
29
+ /** Register a resource. Wraps the SDK's {@link McpServer.registerResource} and updates the local log. */
30
+ readonly registerResource: McpServer['registerResource'];
31
+ /** Register a prompt. Wraps the SDK's {@link McpServer.registerPrompt} and updates the local log. */
32
+ readonly registerPrompt: McpServer['registerPrompt'];
33
+ /** Send an LLM-facing log message via the MCP `logging/message` notification. */
34
+ sendLoggingMessage: McpServer['sendLoggingMessage'];
35
+ /** True iff a transport is currently connected. */
36
+ isConnected: McpServer['isConnected'];
37
+ /** Attach the supplied transport. */
38
+ connect: McpServer['connect'];
39
+ listTools(): RegisteredTool[];
40
+ /** True iff a tool with this exact `name` has been registered on this server instance. */
41
+ hasTool(name: string): boolean;
42
+ listResources(): GLSPMcpResource[];
43
+ listPrompts(): RegisteredPrompt[];
44
+ /** Sends an MCP `ping` and resolves on empty result, rejects on transport timeout. */
45
+ ping(): Promise<void>;
46
+ /**
47
+ * Escape hatch to the underlying SDK `McpServer` for advanced APIs not covered by the
48
+ * stable surface. The returned value is the SDK type, not a stable GLSP surface.
49
+ */
50
+ getRawServer(): McpServer;
51
+ }
52
+ export declare const GLSPMcpServerFactory: unique symbol;
53
+ /**
54
+ * Factory that produces a {@link GLSPMcpServer} per MCP client session.
55
+ * Bound to {@link DefaultGLSPMcpServer} by default; rebind to swap the
56
+ * implementation across all sessions.
57
+ */
58
+ export type GLSPMcpServerFactory = (mcpServer: McpServer, options: McpServerOptions) => GLSPMcpServer;
59
+ export declare class DefaultGLSPMcpServer implements GLSPMcpServer {
60
+ protected readonly mcpServer: McpServer;
61
+ readonly options: McpServerOptions;
62
+ protected readonly logger: Logger;
63
+ protected readonly tools: Map<string, RegisteredTool>;
64
+ protected readonly resources: Map<string, GLSPMcpResource>;
65
+ protected readonly prompts: Map<string, RegisteredPrompt>;
66
+ protected keepAliveTimer?: NodeJS.Timeout;
67
+ readonly registerTool: McpServer['registerTool'];
68
+ readonly registerResource: McpServer['registerResource'];
69
+ readonly registerPrompt: McpServer['registerPrompt'];
70
+ constructor(mcpServer: McpServer, options: McpServerOptions, logger: Logger);
71
+ sendLoggingMessage(...args: Parameters<McpServer['sendLoggingMessage']>): ReturnType<McpServer['sendLoggingMessage']>;
72
+ connect(...args: Parameters<McpServer['connect']>): ReturnType<McpServer['connect']>;
73
+ isConnected(): boolean;
74
+ ping(): Promise<void>;
75
+ listTools(): RegisteredTool[];
76
+ hasTool(name: string): boolean;
77
+ listResources(): GLSPMcpResource[];
78
+ listPrompts(): RegisteredPrompt[];
79
+ getRawServer(): McpServer;
80
+ dispose(): void;
81
+ }
82
+ //# sourceMappingURL=glsp-mcp-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-mcp-server.d.ts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EAAE;IAI7B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B,aAAa,IAAI,eAAe,EAAE;IAIlC,WAAW,IAAI,gBAAgB,EAAE;IAIjC,YAAY,IAAI,SAAS;IAIzB,OAAO,IAAI,IAAI;CAOlB"}
@@ -0,0 +1,140 @@
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 __param = (this && this.__param) || function (paramIndex, decorator) {
27
+ return function (target, key) { decorator(target, key, paramIndex); }
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.DefaultGLSPMcpServer = exports.GLSPMcpServerFactory = exports.GLSPMcpServer = void 0;
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
+ exports.GLSPMcpServer = Symbol('GLSPMcpServer');
36
+ /**
37
+ * Cadence for server-initiated `ping` requests on the standalone SSE GET stream. Shorter than
38
+ * typical client-side SSE read timeouts (e.g. undici's 5-min `bodyTimeout`) so the stream stays
39
+ * alive across chat-idle periods.
40
+ */
41
+ const KEEP_ALIVE_INTERVAL_MS = 30000;
42
+ /** Per-ping timeout — short, since a ping with no SSE GET stream open will never resolve. */
43
+ const KEEP_ALIVE_PING_TIMEOUT_MS = 5000;
44
+ exports.GLSPMcpServerFactory = Symbol('GLSPMcpServerFactory');
45
+ let DefaultGLSPMcpServer = class DefaultGLSPMcpServer {
46
+ constructor(mcpServer, options, logger) {
47
+ this.mcpServer = mcpServer;
48
+ this.options = options;
49
+ this.logger = logger;
50
+ this.tools = new Map();
51
+ this.resources = new Map();
52
+ this.prompts = new Map();
53
+ // `register*` need an interception layer so the local registration log stays in
54
+ // sync; the Proxy preserves the SDK's generic signatures (which a wrapped method
55
+ // using `Parameters<>` would collapse, breaking adopter autocomplete on
56
+ // `inputSchema → handler arg shape`).
57
+ const { tools, resources, prompts } = this;
58
+ this.registerTool = new Proxy(mcpServer.registerTool.bind(mcpServer), {
59
+ apply(target, thisArg, args) {
60
+ const registered = Reflect.apply(target, thisArg, args);
61
+ if (typeof args[0] === 'string') {
62
+ tools.set(args[0], registered);
63
+ }
64
+ return registered;
65
+ }
66
+ });
67
+ this.registerResource = new Proxy(mcpServer.registerResource.bind(mcpServer), {
68
+ apply(target, thisArg, args) {
69
+ const registered = Reflect.apply(target, thisArg, args);
70
+ if (typeof args[0] === 'string') {
71
+ resources.set(args[0], registered);
72
+ }
73
+ return registered;
74
+ }
75
+ });
76
+ this.registerPrompt = new Proxy(mcpServer.registerPrompt.bind(mcpServer), {
77
+ apply(target, thisArg, args) {
78
+ const registered = Reflect.apply(target, thisArg, args);
79
+ if (typeof args[0] === 'string') {
80
+ prompts.set(args[0], registered);
81
+ }
82
+ return registered;
83
+ }
84
+ });
85
+ }
86
+ sendLoggingMessage(...args) {
87
+ return this.mcpServer.sendLoggingMessage(...args);
88
+ }
89
+ async connect(...args) {
90
+ await this.mcpServer.connect(...args);
91
+ // Suppress the expected `RequestTimeout` when no SSE GET stream is open; surface other
92
+ // failures via debug. `unref` so a forgotten timer can't pin the process.
93
+ this.keepAliveTimer = setInterval(() => this.ping().catch(err => {
94
+ if (!(err instanceof types_js_1.McpError) || err.code !== types_js_1.ErrorCode.RequestTimeout) {
95
+ this.logger.debug('MCP keep-alive ping failed:', err);
96
+ }
97
+ }), KEEP_ALIVE_INTERVAL_MS);
98
+ this.keepAliveTimer.unref();
99
+ }
100
+ isConnected() {
101
+ return this.mcpServer.isConnected();
102
+ }
103
+ async ping() {
104
+ // Bypass `Server.ping()` to pass a per-request timeout; SDK's no-arg wrapper uses the
105
+ // 60s default, which leaves keep-alive pings dangling for a full minute when no SSE GET
106
+ // stream is open.
107
+ await this.mcpServer.server.request({ method: 'ping' }, types_js_1.EmptyResultSchema, { timeout: KEEP_ALIVE_PING_TIMEOUT_MS });
108
+ }
109
+ listTools() {
110
+ return [...this.tools.values()];
111
+ }
112
+ hasTool(name) {
113
+ return this.tools.has(name);
114
+ }
115
+ listResources() {
116
+ return [...this.resources.values()];
117
+ }
118
+ listPrompts() {
119
+ return [...this.prompts.values()];
120
+ }
121
+ getRawServer() {
122
+ return this.mcpServer;
123
+ }
124
+ dispose() {
125
+ if (this.keepAliveTimer) {
126
+ clearInterval(this.keepAliveTimer);
127
+ this.keepAliveTimer = undefined;
128
+ }
129
+ this.mcpServer.close();
130
+ }
131
+ };
132
+ exports.DefaultGLSPMcpServer = DefaultGLSPMcpServer;
133
+ exports.DefaultGLSPMcpServer = DefaultGLSPMcpServer = __decorate([
134
+ (0, inversify_1.injectable)(),
135
+ __param(0, (0, inversify_1.unmanaged)()),
136
+ __param(1, (0, inversify_1.unmanaged)()),
137
+ __param(2, (0, inversify_1.unmanaged)()),
138
+ __metadata("design:paramtypes", [mcp_js_1.McpServer, Object, server_1.Logger])
139
+ ], DefaultGLSPMcpServer);
140
+ //# sourceMappingURL=glsp-mcp-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-mcp-server.js","sourceRoot":"","sources":["../../src/server/glsp-mcp-server.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;AAElF,iDAA4E;AAC5E,oEAMiD;AACjD,iEAA4F;AAC5F,yCAAkD;AAErC,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAKrD;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,KAAM,CAAC;AAEtC,6FAA6F;AAC7F,MAAM,0BAA0B,GAAG,IAAK,CAAC;AAsC5B,QAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAU5D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAU7B,YACiB,SAAuC,EACvC,OAAkC,EAClC,MAAiC;QAFd,cAAS,GAAT,SAAS,CAAW;QAC9B,YAAO,GAAP,OAAO,CAAkB;QACf,WAAM,GAAN,MAAM,CAAQ;QAZ/B,UAAK,GAAG,IAAI,GAAG,EAA0B,CAAC;QAC1C,cAAS,GAAG,IAAI,GAAG,EAA2B,CAAC;QAC/C,YAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;QAY7D,gFAAgF;QAChF,iFAAiF;QACjF,wEAAwE;QACxE,sCAAsC;QACtC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YAClE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI;gBACvB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AC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,WAAW;QACP,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,OAAO;QACH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACnC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACJ,CAAA;AA3GY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,sBAAU,GAAE;IAYJ,WAAA,IAAA,qBAAS,GAAE,CAAA;IACX,WAAA,IAAA,qBAAS,GAAE,CAAA;IACX,WAAA,IAAA,qBAAS,GAAE,CAAA;qCAF+B,kBAAS,UAEZ,eAAM;GAbzC,oBAAoB,CA2GhC"}
@@ -0,0 +1,37 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ export * from './glsp-mcp-server';
17
+ export * from './mcp-diagram-handler-dispatcher';
18
+ export * from './mcp-diagram-prompt-handler-registry';
19
+ export * from './mcp-diagram-resource-handler-registry';
20
+ export * from './mcp-diagram-tool-handler-registry';
21
+ export * from './mcp-handler-shared';
22
+ export * from './mcp-http-transport';
23
+ export * from './mcp-id-alias-service';
24
+ export * from './mcp-input-schemas';
25
+ export * from './mcp-label-provider';
26
+ export * from './mcp-log-level-registry';
27
+ export * from './mcp-logger';
28
+ export * from './mcp-mime-types';
29
+ export * from './mcp-options';
30
+ export * from './mcp-progress-reporter';
31
+ export * from './mcp-prompt-handler';
32
+ export * from './mcp-request-context';
33
+ export * from './mcp-resource-handler';
34
+ export * from './mcp-server-launcher';
35
+ export * from './mcp-session';
36
+ export * from './mcp-tool-handler';
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,57 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ __exportStar(require("./glsp-mcp-server"), exports);
33
+ __exportStar(require("./mcp-diagram-handler-dispatcher"), exports);
34
+ __exportStar(require("./mcp-diagram-prompt-handler-registry"), exports);
35
+ __exportStar(require("./mcp-diagram-resource-handler-registry"), exports);
36
+ __exportStar(require("./mcp-diagram-tool-handler-registry"), exports);
37
+ __exportStar(require("./mcp-handler-shared"), exports);
38
+ __exportStar(require("./mcp-http-transport"), exports);
39
+ __exportStar(require("./mcp-id-alias-service"), exports);
40
+ __exportStar(require("./mcp-input-schemas"), exports);
41
+ __exportStar(require("./mcp-label-provider"), exports);
42
+ __exportStar(require("./mcp-log-level-registry"), exports);
43
+ __exportStar(require("./mcp-logger"), exports);
44
+ __exportStar(require("./mcp-mime-types"), exports);
45
+ __exportStar(require("./mcp-options"), exports);
46
+ __exportStar(require("./mcp-progress-reporter"), exports);
47
+ __exportStar(require("./mcp-prompt-handler"), exports);
48
+ __exportStar(require("./mcp-request-context"), exports);
49
+ __exportStar(require("./mcp-resource-handler"), exports);
50
+ __exportStar(require("./mcp-server-launcher"), exports);
51
+ __exportStar(require("./mcp-session"), exports);
52
+ __exportStar(require("./mcp-tool-handler"), exports);
53
+ // `mcp-diagram-module` and `mcp-server-module` are intentionally not re-exported here —
54
+ // they import handler classes from `../resources` / `../tools`, which would create a circular
55
+ // import chain through this barrel. They are re-exported from the package root (`src/index.ts`)
56
+ // after the handler barrels finish initializing.
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,oDAAkC;AAClC,mEAAiD;AACjD,wEAAsD;AACtD,0EAAwD;AACxD,sEAAoD;AACpD,uDAAqC;AACrC,uDAAqC;AACrC,yDAAuC;AACvC,sDAAoC;AACpC,uDAAqC;AACrC,2DAAyC;AACzC,+CAA6B;AAC7B,mDAAiC;AACjC,gDAA8B;AAC9B,0DAAwC;AACxC,uDAAqC;AACrC,wDAAsC;AACtC,yDAAuC;AACvC,wDAAsC;AACtC,gDAA8B;AAC9B,qDAAmC;AAEnC,wFAAwF;AACxF,8FAA8F;AAC9F,gGAAgG;AAChG,iDAAiD"}