Skip to content

Commit e8e54a1

Browse files
Make MCP server browser-portable with a Web-standard handler
Replace the Hono-only Node handler with a Fetch-API handler that runs on Node, Bun, Deno, Cloudflare Workers, and in-page Web Workers. Restructure @eclipse-glsp/server-mcp into a browser/common/node split mirroring @eclipse-glsp/server. - New browser entry point with a Web Worker integration helper. - VS Code web-extension bundle no longer transitively pulls Node-only deps. - Mutating tools report dispatched-command counts for cross-call undo / redo. - Port-agnostic Host-header validation — matches the SDK's older Express middleware that the Fetch transport regressed. - Workflow example ships an end-to-end browser demo of the portable handler. - Non-loopback auth and shared session state remain adopter responsibility. - ARCHITECTURE.md refreshed for the portable handler and for the IDE integrations that now register the GLSP MCP server with the host IDE. Part of eclipse-glsp/glsp#1546
1 parent bed0bb0 commit e8e54a1

110 files changed

Lines changed: 4238 additions & 1561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ wf-glsp-server-node.js
1919
wf-glsp-server-node.js.map
2020
wf-glsp-server-webworker.js
2121
wf-glsp-server-webworker.js.map
22+
examples/workflow-server-bundled-web/mcp-service-worker.js
23+
examples/workflow-server-bundled-web/index.bundle.js
24+
examples/workflow-server-bundled-web/index.bundle.js.map
2225

2326
.claude/settings.local.json
2427
CLAUDE.local.md

examples/workflow-server-bundled-web/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,32 @@ See [our project website](https://www.eclipse.org/glsp/documentation/#workflowov
1414

1515
<https://user-images.githubusercontent.com/588090/154459938-849ca684-11b3-472c-8a59-98ea6cb0b4c1.mp4>
1616

17+
## MCP demo page
18+
19+
`index.html` is a self-contained dev demo for the `@eclipse-glsp/server-mcp` portable Fetch
20+
handler. The page acts as a minimal GLSP JSON-RPC client opening a workflow session in the
21+
in-page Web Worker, and as an MCP client whose `fetch('/mcp', ...)` calls are intercepted by
22+
`mcp-service-worker.js` (shipped by `@eclipse-glsp/server-mcp/static/`, emitted next to the
23+
Worker bundle at build time) and proxied via `MessageChannel` to the same Worker. The Worker
24+
hosts `BrowserMcpServerModule`, and the launcher's `handleRequest(req)` services the proxied
25+
request — the same path adopters use when wiring the handler into their own Service Worker or
26+
edge runtime.
27+
28+
Build (worker bundle), then serve over HTTP (Service Workers don't load from `file://`):
29+
30+
```bash
31+
yarn workspace @eclipse-glsp-examples/workflow-server build
32+
yarn workspace @eclipse-glsp-examples/workflow-server-bundled-web start
33+
```
34+
35+
Open `http://localhost:8000/` in Chromium. The page auto-renders the loaded workflow. Step
36+
through the buttons to exercise MCP tools against the live session; **Create task** /
37+
**Move last task** / **Delete last task** mutate the diagram via MCP, which auto-re-renders.
38+
39+
The on-page SVG is a minimal schematic renderer — it is **not** the GLSP client and does not
40+
exercise Sprotty. Its only purpose is to make the MCP handlers' output visible so the demo can
41+
be eyeballed end-to-end.
42+
1743
## More information
1844

1945
For more information, please visit the [Eclipse GLSP Umbrella repository](https://github.com/eclipse-glsp/glsp) and the [Eclipse GLSP Website](https://www.eclipse.org/glsp/).

0 commit comments

Comments
 (0)