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

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 (443) hide show
  1. package/README.md +17 -3
  2. package/browser.d.ts +16 -0
  3. package/browser.js +18 -0
  4. package/common.d.ts +16 -0
  5. package/common.js +18 -0
  6. package/lib/browser/index.d.ts +21 -0
  7. package/lib/browser/index.d.ts.map +1 -0
  8. package/lib/browser/index.js +37 -0
  9. package/lib/browser/index.js.map +1 -0
  10. package/lib/browser/modules/browser-mcp-server-module.d.ts +42 -0
  11. package/lib/browser/modules/browser-mcp-server-module.d.ts.map +1 -0
  12. package/lib/browser/modules/browser-mcp-server-module.js +50 -0
  13. package/lib/browser/modules/browser-mcp-server-module.js.map +1 -0
  14. package/lib/browser/reexport.d.ts +17 -0
  15. package/lib/browser/reexport.d.ts.map +1 -0
  16. package/lib/browser/reexport.js +33 -0
  17. package/lib/browser/reexport.js.map +1 -0
  18. package/lib/browser/server/browser-mcp-request-context.d.ts +27 -0
  19. package/lib/browser/server/browser-mcp-request-context.d.ts.map +1 -0
  20. package/lib/browser/server/browser-mcp-request-context.js +67 -0
  21. package/lib/browser/server/browser-mcp-request-context.js.map +1 -0
  22. package/lib/browser/server/mcp-worker-bridge.d.ts +81 -0
  23. package/lib/browser/server/mcp-worker-bridge.d.ts.map +1 -0
  24. package/lib/browser/server/mcp-worker-bridge.js +159 -0
  25. package/lib/browser/server/mcp-worker-bridge.js.map +1 -0
  26. package/lib/browser/server/web-mcp-server-launcher.d.ts +34 -0
  27. package/lib/browser/server/web-mcp-server-launcher.d.ts.map +1 -0
  28. package/lib/browser/server/web-mcp-server-launcher.js +50 -0
  29. package/lib/browser/server/web-mcp-server-launcher.js.map +1 -0
  30. package/lib/{index.d.ts → common/index.d.ts} +3 -4
  31. package/lib/common/index.d.ts.map +1 -0
  32. package/lib/{index.js → common/index.js} +17 -18
  33. package/lib/common/index.js.map +1 -0
  34. package/lib/{modules/mcp-server-module.d.ts → common/modules/abstract-mcp-server-module.d.ts} +46 -37
  35. package/lib/common/modules/abstract-mcp-server-module.d.ts.map +1 -0
  36. package/lib/{modules/mcp-server-module.js → common/modules/abstract-mcp-server-module.js} +43 -66
  37. package/lib/common/modules/abstract-mcp-server-module.js.map +1 -0
  38. package/lib/common/modules/mcp-diagram-module.d.ts.map +1 -0
  39. package/lib/common/modules/mcp-diagram-module.js.map +1 -0
  40. package/lib/common/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts.map +1 -0
  41. package/lib/common/prompts/handlers/describe-diagram-mcp-prompt-handler.js.map +1 -0
  42. package/lib/common/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts.map +1 -0
  43. package/lib/common/prompts/handlers/suggest-improvements-mcp-prompt-handler.js.map +1 -0
  44. package/lib/common/resources/handlers/diagram-png-mcp-resource-handler.d.ts.map +1 -0
  45. package/lib/common/resources/handlers/diagram-png-mcp-resource-handler.js.map +1 -0
  46. package/lib/common/resources/handlers/diagram-svg-mcp-resource-handler.d.ts.map +1 -0
  47. package/lib/common/resources/handlers/diagram-svg-mcp-resource-handler.js.map +1 -0
  48. package/lib/common/resources/services/element-types-provider.d.ts.map +1 -0
  49. package/lib/common/resources/services/element-types-provider.js.map +1 -0
  50. package/lib/common/resources/services/mcp-model-serializer.d.ts.map +1 -0
  51. package/lib/common/resources/services/mcp-model-serializer.js.map +1 -0
  52. package/lib/common/server/abstract-mcp-server-launcher.d.ts +168 -0
  53. package/lib/common/server/abstract-mcp-server-launcher.d.ts.map +1 -0
  54. package/lib/{server/mcp-server-launcher.js → common/server/abstract-mcp-server-launcher.js} +235 -121
  55. package/lib/common/server/abstract-mcp-server-launcher.js.map +1 -0
  56. package/lib/{server → common/server}/glsp-mcp-server.d.ts +1 -1
  57. package/lib/common/server/glsp-mcp-server.d.ts.map +1 -0
  58. package/lib/{server → common/server}/glsp-mcp-server.js +6 -1
  59. package/lib/common/server/glsp-mcp-server.js.map +1 -0
  60. package/lib/{server → common/server}/lru-event-store.d.ts +1 -1
  61. package/lib/common/server/lru-event-store.d.ts.map +1 -0
  62. package/lib/common/server/lru-event-store.js.map +1 -0
  63. package/lib/{server → common/server}/mcp-diagram-handler-dispatcher.d.ts +3 -1
  64. package/lib/common/server/mcp-diagram-handler-dispatcher.d.ts.map +1 -0
  65. package/lib/{server → common/server}/mcp-diagram-handler-dispatcher.js +12 -6
  66. package/lib/common/server/mcp-diagram-handler-dispatcher.js.map +1 -0
  67. package/lib/common/server/mcp-diagram-prompt-handler-registry.d.ts.map +1 -0
  68. package/lib/common/server/mcp-diagram-prompt-handler-registry.js.map +1 -0
  69. package/lib/common/server/mcp-diagram-resource-handler-registry.d.ts.map +1 -0
  70. package/lib/{server → common/server}/mcp-diagram-resource-handler-registry.js +4 -1
  71. package/lib/common/server/mcp-diagram-resource-handler-registry.js.map +1 -0
  72. package/lib/common/server/mcp-diagram-tool-handler-registry.d.ts.map +1 -0
  73. package/lib/{server → common/server}/mcp-diagram-tool-handler-registry.js +3 -1
  74. package/lib/common/server/mcp-diagram-tool-handler-registry.js.map +1 -0
  75. package/lib/common/server/mcp-handler-shared.d.ts.map +1 -0
  76. package/lib/common/server/mcp-handler-shared.js.map +1 -0
  77. package/lib/common/server/mcp-id-alias-service.d.ts.map +1 -0
  78. package/lib/common/server/mcp-id-alias-service.js.map +1 -0
  79. package/lib/{server → common/server}/mcp-input-schemas.d.ts +8 -0
  80. package/lib/common/server/mcp-input-schemas.d.ts.map +1 -0
  81. package/lib/{server → common/server}/mcp-input-schemas.js +13 -1
  82. package/lib/common/server/mcp-input-schemas.js.map +1 -0
  83. package/lib/common/server/mcp-label-provider.d.ts.map +1 -0
  84. package/lib/common/server/mcp-label-provider.js.map +1 -0
  85. package/lib/{server → common/server}/mcp-log-level-registry.d.ts +1 -1
  86. package/lib/common/server/mcp-log-level-registry.d.ts.map +1 -0
  87. package/lib/common/server/mcp-log-level-registry.js.map +1 -0
  88. package/lib/{server → common/server}/mcp-logger.d.ts +4 -2
  89. package/lib/common/server/mcp-logger.d.ts.map +1 -0
  90. package/lib/{server → common/server}/mcp-logger.js +11 -3
  91. package/lib/common/server/mcp-logger.js.map +1 -0
  92. package/lib/common/server/mcp-mime-types.d.ts.map +1 -0
  93. package/lib/common/server/mcp-mime-types.js.map +1 -0
  94. package/lib/{server → common/server}/mcp-options.d.ts +1 -1
  95. package/lib/common/server/mcp-options.d.ts.map +1 -0
  96. package/lib/{server → common/server}/mcp-options.js +1 -1
  97. package/lib/common/server/mcp-options.js.map +1 -0
  98. package/lib/{server → common/server}/mcp-progress-reporter.d.ts +4 -2
  99. package/lib/common/server/mcp-progress-reporter.d.ts.map +1 -0
  100. package/lib/{server → common/server}/mcp-progress-reporter.js +14 -3
  101. package/lib/common/server/mcp-progress-reporter.js.map +1 -0
  102. package/lib/{server → common/server}/mcp-prompt-handler.d.ts +3 -1
  103. package/lib/common/server/mcp-prompt-handler.d.ts.map +1 -0
  104. package/lib/{server → common/server}/mcp-prompt-handler.js +10 -2
  105. package/lib/common/server/mcp-prompt-handler.js.map +1 -0
  106. package/lib/common/server/mcp-request-context.d.ts +35 -0
  107. package/lib/common/server/mcp-request-context.d.ts.map +1 -0
  108. package/lib/common/server/mcp-request-context.js +30 -0
  109. package/lib/common/server/mcp-request-context.js.map +1 -0
  110. package/lib/{server → common/server}/mcp-resource-handler.d.ts +3 -1
  111. package/lib/common/server/mcp-resource-handler.d.ts.map +1 -0
  112. package/lib/{server → common/server}/mcp-resource-handler.js +13 -5
  113. package/lib/common/server/mcp-resource-handler.js.map +1 -0
  114. package/lib/common/server/mcp-session.d.ts.map +1 -0
  115. package/lib/common/server/mcp-session.js.map +1 -0
  116. package/lib/{server → common/server}/mcp-tool-handler.d.ts +3 -1
  117. package/lib/common/server/mcp-tool-handler.d.ts.map +1 -0
  118. package/lib/{server → common/server}/mcp-tool-handler.js +7 -1
  119. package/lib/{server → common/server}/mcp-tool-handler.js.map +1 -1
  120. package/lib/common/tools/handlers/count-elements-mcp-tool-handler.d.ts.map +1 -0
  121. package/lib/common/tools/handlers/count-elements-mcp-tool-handler.js.map +1 -0
  122. package/lib/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.d.ts +2 -0
  123. package/lib/common/tools/handlers/create-edges-mcp-tool-handler.d.ts.map +1 -0
  124. package/lib/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.js +2 -1
  125. package/lib/common/tools/handlers/create-edges-mcp-tool-handler.js.map +1 -0
  126. package/lib/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.d.ts +2 -0
  127. package/lib/common/tools/handlers/create-nodes-mcp-tool-handler.d.ts.map +1 -0
  128. package/lib/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.js +2 -1
  129. package/lib/common/tools/handlers/create-nodes-mcp-tool-handler.js.map +1 -0
  130. package/lib/{tools → common/tools}/handlers/delete-elements-mcp-tool-handler.d.ts +2 -0
  131. package/lib/common/tools/handlers/delete-elements-mcp-tool-handler.d.ts.map +1 -0
  132. package/lib/{tools → common/tools}/handlers/delete-elements-mcp-tool-handler.js +4 -2
  133. package/lib/common/tools/handlers/delete-elements-mcp-tool-handler.js.map +1 -0
  134. package/lib/common/tools/handlers/diagram-model-mcp-tool-handler.d.ts.map +1 -0
  135. package/lib/common/tools/handlers/diagram-model-mcp-tool-handler.js.map +1 -0
  136. package/lib/common/tools/handlers/element-types-mcp-tool-handler.d.ts.map +1 -0
  137. package/lib/common/tools/handlers/element-types-mcp-tool-handler.js.map +1 -0
  138. package/lib/common/tools/handlers/get-selection-mcp-tool-handler.d.ts.map +1 -0
  139. package/lib/common/tools/handlers/get-selection-mcp-tool-handler.js.map +1 -0
  140. package/lib/{tools → common/tools}/handlers/layout-mcp-tool-handler.d.ts +2 -0
  141. package/lib/common/tools/handlers/layout-mcp-tool-handler.d.ts.map +1 -0
  142. package/lib/{tools → common/tools}/handlers/layout-mcp-tool-handler.js +3 -2
  143. package/lib/common/tools/handlers/layout-mcp-tool-handler.js.map +1 -0
  144. package/lib/common/tools/handlers/modify-edges-mcp-tool-handler.d.ts.map +1 -0
  145. package/lib/{tools → common/tools}/handlers/modify-edges-mcp-tool-handler.js +1 -1
  146. package/lib/common/tools/handlers/modify-edges-mcp-tool-handler.js.map +1 -0
  147. package/lib/common/tools/handlers/modify-nodes-mcp-tool-handler.d.ts.map +1 -0
  148. package/lib/{tools → common/tools}/handlers/modify-nodes-mcp-tool-handler.js +1 -1
  149. package/lib/common/tools/handlers/modify-nodes-mcp-tool-handler.js.map +1 -0
  150. package/lib/common/tools/handlers/query-elements-mcp-tool-handler.d.ts.map +1 -0
  151. package/lib/common/tools/handlers/query-elements-mcp-tool-handler.js.map +1 -0
  152. package/lib/common/tools/handlers/redo-mcp-tool-handler.d.ts.map +1 -0
  153. package/lib/common/tools/handlers/redo-mcp-tool-handler.js.map +1 -0
  154. package/lib/common/tools/handlers/save-model-mcp-tool-handler.d.ts.map +1 -0
  155. package/lib/common/tools/handlers/save-model-mcp-tool-handler.js.map +1 -0
  156. package/lib/common/tools/handlers/session-info-mcp-tool-handler.d.ts.map +1 -0
  157. package/lib/common/tools/handlers/session-info-mcp-tool-handler.js.map +1 -0
  158. package/lib/common/tools/handlers/set-selection-mcp-tool-handler.d.ts.map +1 -0
  159. package/lib/common/tools/handlers/set-selection-mcp-tool-handler.js.map +1 -0
  160. package/lib/common/tools/handlers/set-view-mcp-tool-handler.d.ts.map +1 -0
  161. package/lib/common/tools/handlers/set-view-mcp-tool-handler.js.map +1 -0
  162. package/lib/common/tools/handlers/undo-mcp-tool-handler.d.ts.map +1 -0
  163. package/lib/common/tools/handlers/undo-mcp-tool-handler.js.map +1 -0
  164. package/lib/common/tools/handlers/validate-diagram-mcp-tool-handler.d.ts.map +1 -0
  165. package/lib/common/tools/handlers/validate-diagram-mcp-tool-handler.js.map +1 -0
  166. package/lib/common/util/markdown-util.d.ts.map +1 -0
  167. package/lib/common/util/markdown-util.js.map +1 -0
  168. package/lib/common/util/mcp-util.d.ts.map +1 -0
  169. package/lib/common/util/mcp-util.js.map +1 -0
  170. package/lib/node/index.d.ts +20 -0
  171. package/lib/node/index.d.ts.map +1 -0
  172. package/lib/node/index.js +36 -0
  173. package/lib/node/index.js.map +1 -0
  174. package/lib/node/modules/node-mcp-server-module.d.ts +37 -0
  175. package/lib/node/modules/node-mcp-server-module.d.ts.map +1 -0
  176. package/lib/node/modules/node-mcp-server-module.js +52 -0
  177. package/lib/node/modules/node-mcp-server-module.js.map +1 -0
  178. package/lib/node/reexport.d.ts +17 -0
  179. package/lib/node/reexport.d.ts.map +1 -0
  180. package/lib/node/reexport.js +33 -0
  181. package/lib/node/reexport.js.map +1 -0
  182. package/lib/node/server/node-mcp-request-context.d.ts +24 -0
  183. package/lib/node/server/node-mcp-request-context.d.ts.map +1 -0
  184. package/lib/node/server/node-mcp-request-context.js +43 -0
  185. package/lib/node/server/node-mcp-request-context.js.map +1 -0
  186. package/lib/node/server/node-mcp-server-launcher.d.ts +55 -0
  187. package/lib/node/server/node-mcp-server-launcher.d.ts.map +1 -0
  188. package/lib/node/server/node-mcp-server-launcher.js +123 -0
  189. package/lib/node/server/node-mcp-server-launcher.js.map +1 -0
  190. package/node.d.ts +16 -0
  191. package/node.js +18 -0
  192. package/package.json +19 -13
  193. package/src/browser/index.ts +21 -0
  194. package/src/browser/modules/browser-mcp-server-module.ts +54 -0
  195. package/src/browser/reexport.ts +16 -0
  196. package/src/browser/server/browser-mcp-request-context.ts +59 -0
  197. package/src/browser/server/mcp-worker-bridge.ts +200 -0
  198. package/src/browser/server/web-mcp-server-launcher.ts +39 -0
  199. package/src/{index.ts → common/index.ts} +4 -4
  200. package/src/{modules/mcp-server-module.ts → common/modules/abstract-mcp-server-module.ts} +54 -68
  201. package/src/common/server/abstract-mcp-server-launcher.spec.ts +458 -0
  202. package/src/common/server/abstract-mcp-server-launcher.ts +524 -0
  203. package/src/{server → common/server}/glsp-mcp-server.ts +7 -2
  204. package/src/{server → common/server}/lru-event-store.ts +1 -1
  205. package/src/{server → common/server}/mcp-diagram-handler-dispatcher.ts +13 -9
  206. package/src/{server → common/server}/mcp-diagram-resource-handler-registry.ts +4 -1
  207. package/src/{server → common/server}/mcp-diagram-tool-handler-registry.ts +3 -1
  208. package/src/{server → common/server}/mcp-input-schemas.ts +13 -0
  209. package/src/{server → common/server}/mcp-log-level-registry.ts +1 -1
  210. package/src/{server → common/server}/mcp-logger.spec.ts +26 -18
  211. package/src/{server → common/server}/mcp-logger.ts +9 -5
  212. package/src/{server → common/server}/mcp-options.ts +1 -1
  213. package/src/{server → common/server}/mcp-progress-reporter.spec.ts +19 -9
  214. package/src/{server → common/server}/mcp-progress-reporter.ts +9 -5
  215. package/src/{server → common/server}/mcp-prompt-handler.ts +8 -4
  216. package/src/{server → common/server}/mcp-request-context.ts +20 -16
  217. package/src/{server → common/server}/mcp-resource-handler.ts +11 -7
  218. package/src/{server → common/server}/mcp-tool-handler.spec.ts +4 -4
  219. package/src/{server → common/server}/mcp-tool-handler.ts +8 -4
  220. package/src/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.ts +9 -2
  221. package/src/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.ts +9 -2
  222. package/src/{tools → common/tools}/handlers/delete-elements-mcp-tool-handler.ts +5 -3
  223. package/src/{tools → common/tools}/handlers/layout-mcp-tool-handler.ts +4 -3
  224. package/src/{tools → common/tools}/handlers/modify-edges-mcp-tool-handler.ts +8 -2
  225. package/src/{tools → common/tools}/handlers/modify-nodes-mcp-tool-handler.ts +8 -2
  226. package/src/node/index.ts +20 -0
  227. package/src/node/modules/node-mcp-server-module.ts +56 -0
  228. package/src/node/reexport.ts +16 -0
  229. package/src/node/server/mcp-http-transport-e2e.spec.ts +297 -0
  230. package/src/node/server/node-mcp-request-context.ts +33 -0
  231. package/src/{server/mcp-server-launcher.spec.ts → node/server/node-mcp-server-launcher.spec.ts} +19 -8
  232. package/src/node/server/node-mcp-server-launcher.ts +130 -0
  233. package/lib/index.d.ts.map +0 -1
  234. package/lib/index.js.map +0 -1
  235. package/lib/modules/mcp-diagram-module.d.ts.map +0 -1
  236. package/lib/modules/mcp-diagram-module.js.map +0 -1
  237. package/lib/modules/mcp-server-module.d.ts.map +0 -1
  238. package/lib/modules/mcp-server-module.js.map +0 -1
  239. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.d.ts.map +0 -1
  240. package/lib/prompts/handlers/describe-diagram-mcp-prompt-handler.js.map +0 -1
  241. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.d.ts.map +0 -1
  242. package/lib/prompts/handlers/suggest-improvements-mcp-prompt-handler.js.map +0 -1
  243. package/lib/resources/handlers/diagram-png-mcp-resource-handler.d.ts.map +0 -1
  244. package/lib/resources/handlers/diagram-png-mcp-resource-handler.js.map +0 -1
  245. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.d.ts.map +0 -1
  246. package/lib/resources/handlers/diagram-svg-mcp-resource-handler.js.map +0 -1
  247. package/lib/resources/services/element-types-provider.d.ts.map +0 -1
  248. package/lib/resources/services/element-types-provider.js.map +0 -1
  249. package/lib/resources/services/mcp-model-serializer.d.ts.map +0 -1
  250. package/lib/resources/services/mcp-model-serializer.js.map +0 -1
  251. package/lib/server/glsp-mcp-server.d.ts.map +0 -1
  252. package/lib/server/glsp-mcp-server.js.map +0 -1
  253. package/lib/server/lru-event-store.d.ts.map +0 -1
  254. package/lib/server/lru-event-store.js.map +0 -1
  255. package/lib/server/mcp-diagram-handler-dispatcher.d.ts.map +0 -1
  256. package/lib/server/mcp-diagram-handler-dispatcher.js.map +0 -1
  257. package/lib/server/mcp-diagram-prompt-handler-registry.d.ts.map +0 -1
  258. package/lib/server/mcp-diagram-prompt-handler-registry.js.map +0 -1
  259. package/lib/server/mcp-diagram-resource-handler-registry.d.ts.map +0 -1
  260. package/lib/server/mcp-diagram-resource-handler-registry.js.map +0 -1
  261. package/lib/server/mcp-diagram-tool-handler-registry.d.ts.map +0 -1
  262. package/lib/server/mcp-diagram-tool-handler-registry.js.map +0 -1
  263. package/lib/server/mcp-handler-shared.d.ts.map +0 -1
  264. package/lib/server/mcp-handler-shared.js.map +0 -1
  265. package/lib/server/mcp-http-transport.d.ts +0 -93
  266. package/lib/server/mcp-http-transport.d.ts.map +0 -1
  267. package/lib/server/mcp-http-transport.js +0 -350
  268. package/lib/server/mcp-http-transport.js.map +0 -1
  269. package/lib/server/mcp-id-alias-service.d.ts.map +0 -1
  270. package/lib/server/mcp-id-alias-service.js.map +0 -1
  271. package/lib/server/mcp-input-schemas.d.ts.map +0 -1
  272. package/lib/server/mcp-input-schemas.js.map +0 -1
  273. package/lib/server/mcp-label-provider.d.ts.map +0 -1
  274. package/lib/server/mcp-label-provider.js.map +0 -1
  275. package/lib/server/mcp-log-level-registry.d.ts.map +0 -1
  276. package/lib/server/mcp-log-level-registry.js.map +0 -1
  277. package/lib/server/mcp-logger.d.ts.map +0 -1
  278. package/lib/server/mcp-logger.js.map +0 -1
  279. package/lib/server/mcp-mime-types.d.ts.map +0 -1
  280. package/lib/server/mcp-mime-types.js.map +0 -1
  281. package/lib/server/mcp-options.d.ts.map +0 -1
  282. package/lib/server/mcp-options.js.map +0 -1
  283. package/lib/server/mcp-progress-reporter.d.ts.map +0 -1
  284. package/lib/server/mcp-progress-reporter.js.map +0 -1
  285. package/lib/server/mcp-prompt-handler.d.ts.map +0 -1
  286. package/lib/server/mcp-prompt-handler.js.map +0 -1
  287. package/lib/server/mcp-request-context.d.ts +0 -37
  288. package/lib/server/mcp-request-context.d.ts.map +0 -1
  289. package/lib/server/mcp-request-context.js +0 -37
  290. package/lib/server/mcp-request-context.js.map +0 -1
  291. package/lib/server/mcp-resource-handler.d.ts.map +0 -1
  292. package/lib/server/mcp-resource-handler.js.map +0 -1
  293. package/lib/server/mcp-server-launcher.d.ts +0 -143
  294. package/lib/server/mcp-server-launcher.d.ts.map +0 -1
  295. package/lib/server/mcp-server-launcher.js.map +0 -1
  296. package/lib/server/mcp-session.d.ts.map +0 -1
  297. package/lib/server/mcp-session.js.map +0 -1
  298. package/lib/server/mcp-tool-handler.d.ts.map +0 -1
  299. package/lib/tools/handlers/count-elements-mcp-tool-handler.d.ts.map +0 -1
  300. package/lib/tools/handlers/count-elements-mcp-tool-handler.js.map +0 -1
  301. package/lib/tools/handlers/create-edges-mcp-tool-handler.d.ts.map +0 -1
  302. package/lib/tools/handlers/create-edges-mcp-tool-handler.js.map +0 -1
  303. package/lib/tools/handlers/create-nodes-mcp-tool-handler.d.ts.map +0 -1
  304. package/lib/tools/handlers/create-nodes-mcp-tool-handler.js.map +0 -1
  305. package/lib/tools/handlers/delete-elements-mcp-tool-handler.d.ts.map +0 -1
  306. package/lib/tools/handlers/delete-elements-mcp-tool-handler.js.map +0 -1
  307. package/lib/tools/handlers/diagram-model-mcp-tool-handler.d.ts.map +0 -1
  308. package/lib/tools/handlers/diagram-model-mcp-tool-handler.js.map +0 -1
  309. package/lib/tools/handlers/element-types-mcp-tool-handler.d.ts.map +0 -1
  310. package/lib/tools/handlers/element-types-mcp-tool-handler.js.map +0 -1
  311. package/lib/tools/handlers/get-selection-mcp-tool-handler.d.ts.map +0 -1
  312. package/lib/tools/handlers/get-selection-mcp-tool-handler.js.map +0 -1
  313. package/lib/tools/handlers/layout-mcp-tool-handler.d.ts.map +0 -1
  314. package/lib/tools/handlers/layout-mcp-tool-handler.js.map +0 -1
  315. package/lib/tools/handlers/modify-edges-mcp-tool-handler.d.ts.map +0 -1
  316. package/lib/tools/handlers/modify-edges-mcp-tool-handler.js.map +0 -1
  317. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.d.ts.map +0 -1
  318. package/lib/tools/handlers/modify-nodes-mcp-tool-handler.js.map +0 -1
  319. package/lib/tools/handlers/query-elements-mcp-tool-handler.d.ts.map +0 -1
  320. package/lib/tools/handlers/query-elements-mcp-tool-handler.js.map +0 -1
  321. package/lib/tools/handlers/redo-mcp-tool-handler.d.ts.map +0 -1
  322. package/lib/tools/handlers/redo-mcp-tool-handler.js.map +0 -1
  323. package/lib/tools/handlers/save-model-mcp-tool-handler.d.ts.map +0 -1
  324. package/lib/tools/handlers/save-model-mcp-tool-handler.js.map +0 -1
  325. package/lib/tools/handlers/session-info-mcp-tool-handler.d.ts.map +0 -1
  326. package/lib/tools/handlers/session-info-mcp-tool-handler.js.map +0 -1
  327. package/lib/tools/handlers/set-selection-mcp-tool-handler.d.ts.map +0 -1
  328. package/lib/tools/handlers/set-selection-mcp-tool-handler.js.map +0 -1
  329. package/lib/tools/handlers/set-view-mcp-tool-handler.d.ts.map +0 -1
  330. package/lib/tools/handlers/set-view-mcp-tool-handler.js.map +0 -1
  331. package/lib/tools/handlers/undo-mcp-tool-handler.d.ts.map +0 -1
  332. package/lib/tools/handlers/undo-mcp-tool-handler.js.map +0 -1
  333. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.d.ts.map +0 -1
  334. package/lib/tools/handlers/validate-diagram-mcp-tool-handler.js.map +0 -1
  335. package/lib/util/markdown-util.d.ts.map +0 -1
  336. package/lib/util/markdown-util.js.map +0 -1
  337. package/lib/util/mcp-util.d.ts.map +0 -1
  338. package/lib/util/mcp-util.js.map +0 -1
  339. package/src/server/mcp-http-transport-e2e.spec.ts +0 -151
  340. package/src/server/mcp-http-transport.spec.ts +0 -385
  341. package/src/server/mcp-http-transport.ts +0 -368
  342. package/src/server/mcp-server-launcher.ts +0 -369
  343. /package/lib/{modules → common/modules}/mcp-diagram-module.d.ts +0 -0
  344. /package/lib/{modules → common/modules}/mcp-diagram-module.js +0 -0
  345. /package/lib/{prompts → common/prompts}/handlers/describe-diagram-mcp-prompt-handler.d.ts +0 -0
  346. /package/lib/{prompts → common/prompts}/handlers/describe-diagram-mcp-prompt-handler.js +0 -0
  347. /package/lib/{prompts → common/prompts}/handlers/suggest-improvements-mcp-prompt-handler.d.ts +0 -0
  348. /package/lib/{prompts → common/prompts}/handlers/suggest-improvements-mcp-prompt-handler.js +0 -0
  349. /package/lib/{resources → common/resources}/handlers/diagram-png-mcp-resource-handler.d.ts +0 -0
  350. /package/lib/{resources → common/resources}/handlers/diagram-png-mcp-resource-handler.js +0 -0
  351. /package/lib/{resources → common/resources}/handlers/diagram-svg-mcp-resource-handler.d.ts +0 -0
  352. /package/lib/{resources → common/resources}/handlers/diagram-svg-mcp-resource-handler.js +0 -0
  353. /package/lib/{resources → common/resources}/services/element-types-provider.d.ts +0 -0
  354. /package/lib/{resources → common/resources}/services/element-types-provider.js +0 -0
  355. /package/lib/{resources → common/resources}/services/mcp-model-serializer.d.ts +0 -0
  356. /package/lib/{resources → common/resources}/services/mcp-model-serializer.js +0 -0
  357. /package/lib/{server → common/server}/lru-event-store.js +0 -0
  358. /package/lib/{server → common/server}/mcp-diagram-prompt-handler-registry.d.ts +0 -0
  359. /package/lib/{server → common/server}/mcp-diagram-prompt-handler-registry.js +0 -0
  360. /package/lib/{server → common/server}/mcp-diagram-resource-handler-registry.d.ts +0 -0
  361. /package/lib/{server → common/server}/mcp-diagram-tool-handler-registry.d.ts +0 -0
  362. /package/lib/{server → common/server}/mcp-handler-shared.d.ts +0 -0
  363. /package/lib/{server → common/server}/mcp-handler-shared.js +0 -0
  364. /package/lib/{server → common/server}/mcp-id-alias-service.d.ts +0 -0
  365. /package/lib/{server → common/server}/mcp-id-alias-service.js +0 -0
  366. /package/lib/{server → common/server}/mcp-label-provider.d.ts +0 -0
  367. /package/lib/{server → common/server}/mcp-label-provider.js +0 -0
  368. /package/lib/{server → common/server}/mcp-log-level-registry.js +0 -0
  369. /package/lib/{server → common/server}/mcp-mime-types.d.ts +0 -0
  370. /package/lib/{server → common/server}/mcp-mime-types.js +0 -0
  371. /package/lib/{server → common/server}/mcp-session.d.ts +0 -0
  372. /package/lib/{server → common/server}/mcp-session.js +0 -0
  373. /package/lib/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.d.ts +0 -0
  374. /package/lib/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.js +0 -0
  375. /package/lib/{tools → common/tools}/handlers/diagram-model-mcp-tool-handler.d.ts +0 -0
  376. /package/lib/{tools → common/tools}/handlers/diagram-model-mcp-tool-handler.js +0 -0
  377. /package/lib/{tools → common/tools}/handlers/element-types-mcp-tool-handler.d.ts +0 -0
  378. /package/lib/{tools → common/tools}/handlers/element-types-mcp-tool-handler.js +0 -0
  379. /package/lib/{tools → common/tools}/handlers/get-selection-mcp-tool-handler.d.ts +0 -0
  380. /package/lib/{tools → common/tools}/handlers/get-selection-mcp-tool-handler.js +0 -0
  381. /package/lib/{tools → common/tools}/handlers/modify-edges-mcp-tool-handler.d.ts +0 -0
  382. /package/lib/{tools → common/tools}/handlers/modify-nodes-mcp-tool-handler.d.ts +0 -0
  383. /package/lib/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.d.ts +0 -0
  384. /package/lib/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.js +0 -0
  385. /package/lib/{tools → common/tools}/handlers/redo-mcp-tool-handler.d.ts +0 -0
  386. /package/lib/{tools → common/tools}/handlers/redo-mcp-tool-handler.js +0 -0
  387. /package/lib/{tools → common/tools}/handlers/save-model-mcp-tool-handler.d.ts +0 -0
  388. /package/lib/{tools → common/tools}/handlers/save-model-mcp-tool-handler.js +0 -0
  389. /package/lib/{tools → common/tools}/handlers/session-info-mcp-tool-handler.d.ts +0 -0
  390. /package/lib/{tools → common/tools}/handlers/session-info-mcp-tool-handler.js +0 -0
  391. /package/lib/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.d.ts +0 -0
  392. /package/lib/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.js +0 -0
  393. /package/lib/{tools → common/tools}/handlers/set-view-mcp-tool-handler.d.ts +0 -0
  394. /package/lib/{tools → common/tools}/handlers/set-view-mcp-tool-handler.js +0 -0
  395. /package/lib/{tools → common/tools}/handlers/undo-mcp-tool-handler.d.ts +0 -0
  396. /package/lib/{tools → common/tools}/handlers/undo-mcp-tool-handler.js +0 -0
  397. /package/lib/{tools → common/tools}/handlers/validate-diagram-mcp-tool-handler.d.ts +0 -0
  398. /package/lib/{tools → common/tools}/handlers/validate-diagram-mcp-tool-handler.js +0 -0
  399. /package/lib/{util → common/util}/markdown-util.d.ts +0 -0
  400. /package/lib/{util → common/util}/markdown-util.js +0 -0
  401. /package/lib/{util → common/util}/mcp-util.d.ts +0 -0
  402. /package/lib/{util → common/util}/mcp-util.js +0 -0
  403. /package/src/{modules → common/modules}/mcp-diagram-module.ts +0 -0
  404. /package/src/{prompts → common/prompts}/handlers/describe-diagram-mcp-prompt-handler.ts +0 -0
  405. /package/src/{prompts → common/prompts}/handlers/suggest-improvements-mcp-prompt-handler.ts +0 -0
  406. /package/src/{resources → common/resources}/handlers/diagram-png-mcp-resource-handler.ts +0 -0
  407. /package/src/{resources → common/resources}/handlers/diagram-svg-mcp-resource-handler.ts +0 -0
  408. /package/src/{resources → common/resources}/services/element-types-provider.ts +0 -0
  409. /package/src/{resources → common/resources}/services/mcp-model-serializer.ts +0 -0
  410. /package/src/{server → common/server}/glsp-mcp-server.spec.ts +0 -0
  411. /package/src/{server → common/server}/lru-event-store.spec.ts +0 -0
  412. /package/src/{server → common/server}/mcp-diagram-handler-dispatcher.spec.ts +0 -0
  413. /package/src/{server → common/server}/mcp-diagram-prompt-handler-registry.ts +0 -0
  414. /package/src/{server → common/server}/mcp-handler-shared.spec.ts +0 -0
  415. /package/src/{server → common/server}/mcp-handler-shared.ts +0 -0
  416. /package/src/{server → common/server}/mcp-id-alias-service.spec.ts +0 -0
  417. /package/src/{server → common/server}/mcp-id-alias-service.ts +0 -0
  418. /package/src/{server → common/server}/mcp-label-provider.ts +0 -0
  419. /package/src/{server → common/server}/mcp-log-level-registry.spec.ts +0 -0
  420. /package/src/{server → common/server}/mcp-mime-types.ts +0 -0
  421. /package/src/{server → common/server}/mcp-session.ts +0 -0
  422. /package/src/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.spec.ts +0 -0
  423. /package/src/{tools → common/tools}/handlers/count-elements-mcp-tool-handler.ts +0 -0
  424. /package/src/{tools → common/tools}/handlers/create-edges-mcp-tool-handler.spec.ts +0 -0
  425. /package/src/{tools → common/tools}/handlers/create-nodes-mcp-tool-handler.spec.ts +0 -0
  426. /package/src/{tools → common/tools}/handlers/diagram-model-mcp-tool-handler.ts +0 -0
  427. /package/src/{tools → common/tools}/handlers/element-types-mcp-tool-handler.ts +0 -0
  428. /package/src/{tools → common/tools}/handlers/get-selection-mcp-tool-handler.ts +0 -0
  429. /package/src/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.spec.ts +0 -0
  430. /package/src/{tools → common/tools}/handlers/query-elements-mcp-tool-handler.ts +0 -0
  431. /package/src/{tools → common/tools}/handlers/redo-mcp-tool-handler.ts +0 -0
  432. /package/src/{tools → common/tools}/handlers/save-model-mcp-tool-handler.ts +0 -0
  433. /package/src/{tools → common/tools}/handlers/session-info-mcp-tool-handler.spec.ts +0 -0
  434. /package/src/{tools → common/tools}/handlers/session-info-mcp-tool-handler.ts +0 -0
  435. /package/src/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.spec.ts +0 -0
  436. /package/src/{tools → common/tools}/handlers/set-selection-mcp-tool-handler.ts +0 -0
  437. /package/src/{tools → common/tools}/handlers/set-view-mcp-tool-handler.ts +0 -0
  438. /package/src/{tools → common/tools}/handlers/undo-mcp-tool-handler.ts +0 -0
  439. /package/src/{tools → common/tools}/handlers/validate-diagram-mcp-tool-handler.ts +0 -0
  440. /package/src/{tools → common/tools}/tool-annotations.spec.ts +0 -0
  441. /package/src/{util → common/util}/markdown-util.ts +0 -0
  442. /package/src/{util → common/util}/mcp-util.ts +0 -0
  443. /package/src/{server → node/server}/raw-http.spec.ts +0 -0
package/README.md CHANGED
@@ -27,7 +27,8 @@ Load the MCP container modules in your GLSP server's DI configuration:
27
27
  ```typescript
28
28
  import { GModelStorage, WebSocketServerLauncher, createAppModule } from '@eclipse-glsp/server/node';
29
29
  import { Container } from 'inversify';
30
- import { DefaultMcpDiagramModule, DefaultMcpServerModule } from '@eclipse-glsp/server-mcp';
30
+ import { DefaultMcpDiagramModule } from '@eclipse-glsp/server-mcp';
31
+ import { NodeMcpServerModule } from '@eclipse-glsp/server-mcp/node';
31
32
 
32
33
  const appContainer = new Container();
33
34
  appContainer.load(createAppModule(options));
@@ -38,16 +39,29 @@ const serverModule = new MyServerModule().configureDiagramModule(new MyDiagramMo
38
39
 
39
40
  const launcher = appContainer.resolve(WebSocketServerLauncher);
40
41
  // Launcher-level bindings — must not be part of `configureDiagramModule`.
41
- launcher.configure(serverModule, new DefaultMcpServerModule());
42
+ launcher.configure(serverModule, new NodeMcpServerModule());
42
43
  ```
43
44
 
44
45
  The two modules are deliberately separate because they bind into different container scopes:
45
46
 
46
47
  - `DefaultMcpDiagramModule` is mounted inside `configureDiagramModule`, so each `ClientSession.container` gets its own per-session services (`McpIdAliasService`, `McpModelSerializer`, the diagram-scope handler registries).
47
- - `DefaultMcpServerModule` is mounted at the launcher container, so the MCP HTTP server, the option holder, and the server-scope tool/resource handlers live as launcher singletons.
48
+ - `NodeMcpServerModule` is mounted at the launcher container, so the MCP HTTP server, the option holder, and the server-scope tool/resource handlers live as launcher singletons.
48
49
 
49
50
  The MCP server itself is started lazily on the first GLSP `InitializeAction` that carries an `mcpServer` configuration.
50
51
 
52
+ ### Browser / Web Worker target
53
+
54
+ For browser, Bun, Deno, Cloudflare Workers, or any Fetch-shaped runtime, use the `browser` subpath. `McpWorkerBridge` wires `postMessage` traffic into the launcher for the common Service-Worker → Web-Worker setup:
55
+
56
+ ```typescript
57
+ import { McpWorkerBridge } from '@eclipse-glsp/server-mcp/browser';
58
+
59
+ const bridge = new McpWorkerBridge();
60
+ launcher.configure(serverModule, bridge.createServerModule());
61
+ ```
62
+
63
+ The page-side proxy — a Service Worker that intercepts `fetch('/mcp', …)` and forwards each `Request` to the bridge over a `MessageChannel` — is host-side scaffolding that adopters own. See `examples/workflow-server-mcp-demo/mcp-service-worker.js` for a working reference implementation that the workflow browser demo uses end-to-end.
64
+
51
65
  ## Further reading
52
66
 
53
67
  See [ARCHITECTURE.md](./ARCHITECTURE.md) for the architecture, security model, configuration surface, deployment guidance, and the extension cookbook. The workflow example (`examples/workflow-server`) is the canonical reference for adopter wiring; each shipped handler carries an LLM-facing `description` field that doubles as developer-facing documentation.
package/browser.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ export * from './lib/browser/index';
package/browser.js ADDED
@@ -0,0 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ 'use strict';
17
+
18
+ module.exports = require('./lib/browser/index');
package/common.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ export * from './lib/common/index';
package/common.js ADDED
@@ -0,0 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ 'use strict';
17
+
18
+ module.exports = require('./lib/common/index');
@@ -0,0 +1,21 @@
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 './modules/browser-mcp-server-module';
17
+ export * from './reexport';
18
+ export * from './server/browser-mcp-request-context';
19
+ export * from './server/mcp-worker-bridge';
20
+ export * from './server/web-mcp-server-launcher';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,qCAAqC,CAAC;AACpD,cAAc,YAAY,CAAC;AAC3B,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC"}
@@ -0,0 +1,37 @@
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("./modules/browser-mcp-server-module"), exports);
33
+ __exportStar(require("./reexport"), exports);
34
+ __exportStar(require("./server/browser-mcp-request-context"), exports);
35
+ __exportStar(require("./server/mcp-worker-bridge"), exports);
36
+ __exportStar(require("./server/web-mcp-server-launcher"), exports);
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,sEAAoD;AACpD,6CAA2B;AAC3B,uEAAqD;AACrD,6DAA2C;AAC3C,mEAAiD"}
@@ -0,0 +1,42 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { BindingTarget } from '@eclipse-glsp/server';
17
+ import { AbstractMcpServerModule } from '../../common/modules/abstract-mcp-server-module';
18
+ import { AbstractMcpServerLauncher } from '../../common/server/abstract-mcp-server-launcher';
19
+ import { McpServerDefaults } from '../../common/server/mcp-options';
20
+ import { McpRequestContext } from '../../common/server/mcp-request-context';
21
+ /**
22
+ * Default {@link AbstractMcpServerModule} entry point for browser/web hosts (Bun, Deno, Cloudflare
23
+ * Worker, Service Worker, in-page Worker). Ships GLSP-default option values (see
24
+ * {@link BrowserMcpServerModule.DEFAULT_OPTIONS}) on top of the abstract module's hook defaults,
25
+ * and binds the web {@link WebMcpServerLauncher} + {@link BrowserMcpRequestContext}. Adopter-provided
26
+ * overrides via the constructor merge on top.
27
+ *
28
+ * Node-only deploy-side fields (`host`, `allowedHosts`, `allowedOrigins`, `acknowledgedNoAuth`)
29
+ * are intentionally omitted from defaults — adopters set these for their deployment, or run their
30
+ * own auth middleware around {@link AbstractMcpServerLauncher.getRequestHandler}.
31
+ *
32
+ * @experimental The MCP integration is under active development. Option names, schema shapes,
33
+ * and handler contracts MAY change in minor releases until the feature graduates from
34
+ * experimental status.
35
+ */
36
+ export declare class BrowserMcpServerModule extends AbstractMcpServerModule {
37
+ static readonly DEFAULT_OPTIONS: McpServerDefaults;
38
+ constructor(overrides?: McpServerDefaults);
39
+ protected bindMcpServerLauncher(): BindingTarget<AbstractMcpServerLauncher>;
40
+ protected bindMcpRequestContext(): BindingTarget<McpRequestContext>;
41
+ }
42
+ //# sourceMappingURL=browser-mcp-server-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-mcp-server-module.d.ts","sourceRoot":"","sources":["../../../src/browser/modules/browser-mcp-server-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAuB,MAAM,iDAAiD,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAI5E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,SAAQ,uBAAuB;IAC/D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAA8B;gBAEpE,SAAS,GAAE,iBAAsB;cAI1B,qBAAqB,IAAI,aAAa,CAAC,yBAAyB,CAAC;cAIjE,qBAAqB,IAAI,aAAa,CAAC,iBAAiB,CAAC;CAG/E"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.BrowserMcpServerModule = void 0;
19
+ const abstract_mcp_server_module_1 = require("../../common/modules/abstract-mcp-server-module");
20
+ const browser_mcp_request_context_1 = require("../server/browser-mcp-request-context");
21
+ const web_mcp_server_launcher_1 = require("../server/web-mcp-server-launcher");
22
+ /**
23
+ * Default {@link AbstractMcpServerModule} entry point for browser/web hosts (Bun, Deno, Cloudflare
24
+ * Worker, Service Worker, in-page Worker). Ships GLSP-default option values (see
25
+ * {@link BrowserMcpServerModule.DEFAULT_OPTIONS}) on top of the abstract module's hook defaults,
26
+ * and binds the web {@link WebMcpServerLauncher} + {@link BrowserMcpRequestContext}. Adopter-provided
27
+ * overrides via the constructor merge on top.
28
+ *
29
+ * Node-only deploy-side fields (`host`, `allowedHosts`, `allowedOrigins`, `acknowledgedNoAuth`)
30
+ * are intentionally omitted from defaults — adopters set these for their deployment, or run their
31
+ * own auth middleware around {@link AbstractMcpServerLauncher.getRequestHandler}.
32
+ *
33
+ * @experimental The MCP integration is under active development. Option names, schema shapes,
34
+ * and handler contracts MAY change in minor releases until the feature graduates from
35
+ * experimental status.
36
+ */
37
+ class BrowserMcpServerModule extends abstract_mcp_server_module_1.AbstractMcpServerModule {
38
+ constructor(overrides = {}) {
39
+ super({ ...BrowserMcpServerModule.DEFAULT_OPTIONS, ...overrides });
40
+ }
41
+ bindMcpServerLauncher() {
42
+ return web_mcp_server_launcher_1.WebMcpServerLauncher;
43
+ }
44
+ bindMcpRequestContext() {
45
+ return browser_mcp_request_context_1.BrowserMcpRequestContext;
46
+ }
47
+ }
48
+ exports.BrowserMcpServerModule = BrowserMcpServerModule;
49
+ BrowserMcpServerModule.DEFAULT_OPTIONS = { ...abstract_mcp_server_module_1.DEFAULT_MCP_OPTIONS };
50
+ //# sourceMappingURL=browser-mcp-server-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-mcp-server-module.js","sourceRoot":"","sources":["../../../src/browser/modules/browser-mcp-server-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,gGAA+G;AAI/G,uFAAiF;AACjF,+EAAyE;AAEzE;;;;;;;;;;;;;;GAcG;AACH,MAAa,sBAAuB,SAAQ,oDAAuB;IAG/D,YAAY,YAA+B,EAAE;QACzC,KAAK,CAAC,EAAE,GAAG,sBAAsB,CAAC,eAAe,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACvE,CAAC;IAEkB,qBAAqB;QACpC,OAAO,8CAAoB,CAAC;IAChC,CAAC;IAEkB,qBAAqB;QACpC,OAAO,sDAAwB,CAAC;IACpC,CAAC;;AAbL,wDAcC;AAbmB,sCAAe,GAAsB,EAAE,GAAG,gDAAmB,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ export * from '../common';
17
+ //# sourceMappingURL=reexport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reexport.d.ts","sourceRoot":"","sources":["../../src/browser/reexport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,WAAW,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /********************************************************************************
18
+ * Copyright (c) 2026 EclipseSource and others.
19
+ *
20
+ * This program and the accompanying materials are made available under the
21
+ * terms of the Eclipse Public License v. 2.0 which is available at
22
+ * http://www.eclipse.org/legal/epl-2.0.
23
+ *
24
+ * This Source Code may also be made available under the following Secondary
25
+ * Licenses when the conditions for such availability set forth in the Eclipse
26
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
27
+ * with the GNU Classpath Exception which is available at
28
+ * https://www.gnu.org/software/classpath/license.html.
29
+ *
30
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
31
+ ********************************************************************************/
32
+ __exportStar(require("../common"), exports);
33
+ //# sourceMappingURL=reexport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reexport.js","sourceRoot":"","sources":["../../src/browser/reexport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4CAA0B"}
@@ -0,0 +1,27 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { McpRequestContext, McpRequestExtra } from '../../common/server/mcp-request-context';
17
+ /**
18
+ * Browser-compatible {@link McpRequestContext} that holds one request context at a time.
19
+ * Hosts must serialise dispatches so they don't overwrite each other (e.g. via {@link McpWorkerBridge}).
20
+ */
21
+ export declare class BrowserMcpRequestContext implements McpRequestContext {
22
+ protected current: McpRequestExtra | undefined;
23
+ protected concurrencyWarned: boolean;
24
+ run<R>(extra: McpRequestExtra, callback: () => R): R;
25
+ getStore(): McpRequestExtra | undefined;
26
+ }
27
+ //# sourceMappingURL=browser-mcp-request-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-mcp-request-context.d.ts","sourceRoot":"","sources":["../../../src/browser/server/browser-mcp-request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE7F;;;GAGG;AACH,qBACa,wBAAyB,YAAW,iBAAiB;IAC9D,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IAC/C,SAAS,CAAC,iBAAiB,UAAS;IAEpC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IA2BpD,QAAQ,IAAI,eAAe,GAAG,SAAS;CAG1C"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.BrowserMcpRequestContext = void 0;
25
+ const inversify_1 = require("inversify");
26
+ /**
27
+ * Browser-compatible {@link McpRequestContext} that holds one request context at a time.
28
+ * Hosts must serialise dispatches so they don't overwrite each other (e.g. via {@link McpWorkerBridge}).
29
+ */
30
+ let BrowserMcpRequestContext = class BrowserMcpRequestContext {
31
+ constructor() {
32
+ this.concurrencyWarned = false;
33
+ }
34
+ run(extra, callback) {
35
+ // Warn once if an adopter forgot to serialise dispatches — silent context corruption would be hard to debug.
36
+ if (this.current !== undefined && !this.concurrencyWarned) {
37
+ this.concurrencyWarned = true;
38
+ console.warn('BrowserMcpRequestContext: concurrent run() detected — request contexts will overwrite each other. ' +
39
+ 'Serialise MCP dispatches (e.g. via McpWorkerBridge or an adopter-side queue around launcher.handleRequest).');
40
+ }
41
+ const prior = this.current;
42
+ this.current = extra;
43
+ let result;
44
+ try {
45
+ result = callback();
46
+ }
47
+ catch (error) {
48
+ this.current = prior;
49
+ throw error;
50
+ }
51
+ if (result instanceof Promise) {
52
+ return result.finally(() => {
53
+ this.current = prior;
54
+ });
55
+ }
56
+ this.current = prior;
57
+ return result;
58
+ }
59
+ getStore() {
60
+ return this.current;
61
+ }
62
+ };
63
+ exports.BrowserMcpRequestContext = BrowserMcpRequestContext;
64
+ exports.BrowserMcpRequestContext = BrowserMcpRequestContext = __decorate([
65
+ (0, inversify_1.injectable)()
66
+ ], BrowserMcpRequestContext);
67
+ //# sourceMappingURL=browser-mcp-request-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-mcp-request-context.js","sourceRoot":"","sources":["../../../src/browser/server/browser-mcp-request-context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,yCAAuC;AAGvC;;;GAGG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QAEO,sBAAiB,GAAG,KAAK,CAAC;IAgCxC,CAAC;IA9BG,GAAG,CAAI,KAAsB,EAAE,QAAiB;QAC5C,6GAA6G;QAC7G,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACxD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,OAAO,CAAC,IAAI,CACR,oGAAoG;gBAChG,6GAA6G,CACpH,CAAC;QACN,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,MAAS,CAAC;QACd,IAAI,CAAC;YACD,MAAM,GAAG,QAAQ,EAAE,CAAC;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,MAAM,KAAK,CAAC;QAChB,CAAC;QACD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;YAC5B,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,CAAC,CAAiB,CAAC;QACvB,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ,CAAA;AAlCY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAkCpC"}
@@ -0,0 +1,81 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Disposable } from '@eclipse-glsp/server';
17
+ import { AbstractMcpServerLauncher } from '../../common/server/abstract-mcp-server-launcher';
18
+ import { McpServerDefaults } from '../../common/server/mcp-options';
19
+ import { BrowserMcpServerModule } from '../modules/browser-mcp-server-module';
20
+ export declare const MCP_REQUEST_MESSAGE_TYPE = "mcp-request";
21
+ export declare const MCP_RESPONSE_MESSAGE_TYPE = "mcp-response";
22
+ export declare const MCP_INIT_PORT_MESSAGE_TYPE = "mcp-init-port";
23
+ export interface McpRequestMessage {
24
+ type: typeof MCP_REQUEST_MESSAGE_TYPE;
25
+ id: string;
26
+ url: string;
27
+ method: string;
28
+ headers: Record<string, string>;
29
+ body?: string;
30
+ }
31
+ export interface McpResponseMessage {
32
+ type: typeof MCP_RESPONSE_MESSAGE_TYPE;
33
+ id: string;
34
+ status: number;
35
+ statusText: string;
36
+ headers: Record<string, string>;
37
+ /** `ReadableStream` on Chromium (streams SSE); buffered `ArrayBuffer` on browsers without transferable streams. */
38
+ body: ReadableStream<Uint8Array> | ArrayBuffer | null;
39
+ }
40
+ /** Carries the SW↔Worker `MessagePort` transfer that wires MCP traffic over a dedicated channel. */
41
+ export interface McpInitPortMessage {
42
+ type: typeof MCP_INIT_PORT_MESSAGE_TYPE;
43
+ }
44
+ export declare function isMcpRequestMessage(value: unknown): value is McpRequestMessage;
45
+ export declare function isMcpInitPortMessage(value: unknown): value is McpInitPortMessage;
46
+ /** Probes whether the current realm can transfer `ReadableStream` via `postMessage` (Chromium yes; Firefox / Safari no). */
47
+ export declare function canTransferReadableStream(): boolean;
48
+ /** Minimal Worker scope contract — defined locally so the package compiles without the `webworker` lib. */
49
+ export interface McpBridgeScope {
50
+ addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
51
+ removeEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
52
+ postMessage(message: unknown, transfer?: Transferable[]): void;
53
+ }
54
+ /**
55
+ * Bridges `postMessage` traffic to an {@link AbstractMcpServerLauncher} for browser / Web Worker
56
+ * adopters that proxy MCP requests via Service-Worker → Web-Worker plumbing.
57
+ * See `ARCHITECTURE.md` (Portable handler) for the message protocol and queueing semantics.
58
+ */
59
+ export declare class McpWorkerBridge implements Disposable {
60
+ protected readonly scope: McpBridgeScope;
61
+ protected resolveLauncher: (launcher: AbstractMcpServerLauncher) => void;
62
+ protected readonly launcherReady: Promise<AbstractMcpServerLauncher>;
63
+ protected readonly listener: (event: MessageEvent) => void;
64
+ /** Serialise dispatches — `BrowserMcpRequestContext` is a single-slot store, not concurrency-safe. */
65
+ protected dispatchChain: Promise<void>;
66
+ protected readonly streamTransferable: boolean;
67
+ protected bufferingWarned: boolean;
68
+ constructor(scope?: McpBridgeScope);
69
+ dispose(): void;
70
+ /** Returns a {@link BrowserMcpServerModule} that registers its launcher with this bridge on DI activation. */
71
+ createServerModule(overrides?: McpServerDefaults): BrowserMcpServerModule;
72
+ /** First call binds; subsequent calls are no-ops. */
73
+ bindLauncher(launcher: AbstractMcpServerLauncher): void;
74
+ protected onMessage(event: MessageEvent): void;
75
+ protected enqueueDispatch(request: McpRequestMessage, port: MessagePort | undefined): void;
76
+ protected dispatch(request: McpRequestMessage, port: MessagePort | undefined): Promise<void>;
77
+ /** Stream on Chromium; buffer to `ArrayBuffer` (still transferable) on browsers without transferable streams. */
78
+ protected encodeBody(response: Response): Promise<ReadableStream<Uint8Array> | ArrayBuffer | null>;
79
+ protected reply(port: MessagePort | undefined, message: McpResponseMessage): void;
80
+ }
81
+ //# sourceMappingURL=mcp-worker-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-worker-bridge.d.ts","sourceRoot":"","sources":["../../../src/browser/server/mcp-worker-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AACtD,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,OAAO,wBAAwB,CAAC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,OAAO,yBAAyB,CAAC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,mHAAmH;IACnH,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC;CACzD;AAED,oGAAoG;AACpG,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,OAAO,0BAA0B,CAAC;CAC3C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAEhF;AAED,4HAA4H;AAC5H,wBAAgB,yBAAyB,IAAI,OAAO,CAQnD;AAED,2GAA2G;AAC3G,MAAM,WAAW,cAAc;IAC3B,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IACjF,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IACpF,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;CAClE;AAED;;;;GAIG;AACH,qBAAa,eAAgB,YAAW,UAAU;IASlC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc;IARpD,SAAS,CAAC,eAAe,EAAG,CAAC,QAAQ,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAC1E,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACrE,SAAS,CAAC,QAAQ,CAAC,QAAQ,GAAI,OAAO,YAAY,KAAG,IAAI,CAA0B;IACnF,sGAAsG;IACtG,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAAqB;IAC3D,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAA+B;IAC7E,SAAS,CAAC,eAAe,UAAS;gBAEH,KAAK,GAAE,cAAkD;IAOxF,OAAO,IAAI,IAAI;IAIf,8GAA8G;IAC9G,kBAAkB,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,sBAAsB;IAUzE,qDAAqD;IACrD,YAAY,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAIvD,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAqB9C,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;cAM1E,QAAQ,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAiClG,iHAAiH;cACjG,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC;IAcxG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI;CAQpF"}