From 48c7e43521bc3afbd007b11455cb5ae850372763 Mon Sep 17 00:00:00 2001 From: "dayuan.jiang" Date: Sun, 11 Oct 2026 12:11:22 +0900 Subject: [PATCH] docs: review fixes for the draw.io version pointer and the preview's embedding - The offline deployment guides point at packages/mcp-server/src/ drawio-version.json for the draw.war version; scripts/fetch-drawio.mjs no longer names it. - The MCP README says what the bundled draw.io copy includes, and that the preview page cannot be shown inside an editor's built-in browser since it is served with frame-ancestors 'self'. --- docs/cn/offline-deployment.md | 2 +- docs/en/offline-deployment.md | 2 +- docs/ja/offline-deployment.md | 2 +- packages/mcp-server/README.md | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/cn/offline-deployment.md b/docs/cn/offline-deployment.md index a802b44b..2d671e12 100644 --- a/docs/cn/offline-deployment.md +++ b/docs/cn/offline-deployment.md @@ -14,7 +14,7 @@ Next AI Draw.io 自带一份 draw.io。`npm run build`(包括 Docker 构建) 构建会从 [draw.io 发布页](https://github.com/jgraph/drawio/releases) 下载 `draw.war`(约 50 MB)。如果构建机器访问不了 GitHub: -- 在另一台机器上下载 `scripts/fetch-drawio.mjs` 里写明的那个版本的 `draw.war`,解压到 `public/drawio`(删掉 `WEB-INF` 和 `META-INF`),再把版本号(例如 `v32.0.2`)写进 `public/drawio/.version`。构建时就会使用这份副本。 +- 在另一台机器上下载 `packages/mcp-server/src/drawio-version.json` 里写明的那个版本的 `draw.war`,解压到 `public/drawio`(删掉 `WEB-INF` 和 `META-INF`),再把版本号(例如 `v32.0.2`)写进 `public/drawio/.version`。构建时就会使用这份副本。 - 或者在能联网的机器上构建镜像,再拷到离线网络里。 ## 来自其他网站的图片 diff --git a/docs/en/offline-deployment.md b/docs/en/offline-deployment.md index 63b9f0fe..0a3e8221 100644 --- a/docs/en/offline-deployment.md +++ b/docs/en/offline-deployment.md @@ -14,7 +14,7 @@ No separate draw.io container is needed. The build downloads `draw.war` (about 50 MB) from the [draw.io releases](https://github.com/jgraph/drawio/releases). If the build machine cannot reach GitHub: -- On another machine, download `draw.war` for the version in `scripts/fetch-drawio.mjs`, unzip it into `public/drawio` (delete `WEB-INF` and `META-INF`), and write the version, for example `v32.0.2`, into `public/drawio/.version`. The build then uses this copy. +- On another machine, download `draw.war` for the version in `packages/mcp-server/src/drawio-version.json`, unzip it into `public/drawio` (delete `WEB-INF` and `META-INF`), and write the version, for example `v32.0.2`, into `public/drawio/.version`. The build then uses this copy. - Or build the image on a machine with internet access and transfer it to the offline network. ## Images From Other Websites diff --git a/docs/ja/offline-deployment.md b/docs/ja/offline-deployment.md index 8fe1d905..b7926bce 100644 --- a/docs/ja/offline-deployment.md +++ b/docs/ja/offline-deployment.md @@ -14,7 +14,7 @@ draw.io 用の別コンテナは不要です。 ビルドは [draw.io のリリース](https://github.com/jgraph/drawio/releases) から `draw.war`(約 50 MB)をダウンロードします。ビルド環境から GitHub にアクセスできない場合は、次のどちらかを行ってください。 -- 別のマシンで `scripts/fetch-drawio.mjs` に書かれたバージョンの `draw.war` をダウンロードし、`public/drawio` に展開します(`WEB-INF` と `META-INF` は削除)。さらにバージョン(例:`v32.0.2`)を `public/drawio/.version` に書き込みます。ビルドはこのコピーを使います。 +- 別のマシンで `packages/mcp-server/src/drawio-version.json` に書かれたバージョンの `draw.war` をダウンロードし、`public/drawio` に展開します(`WEB-INF` と `META-INF` は削除)。さらにバージョン(例:`v32.0.2`)を `public/drawio/.version` に書き込みます。ビルドはこのコピーを使います。 - インターネットに接続できるマシンでイメージをビルドし、オフライン環境に転送します。 ## ほかのサイトの画像 diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md index 5c2e2a84..9101f307 100644 --- a/packages/mcp-server/README.md +++ b/packages/mcp-server/README.md @@ -217,6 +217,8 @@ docker run -d -p 8080:8080 jgraph/drawio Then set `DRAWIO_BASE_URL=http://localhost:8080` (or your server's URL). The preview page loads nothing else from the internet, so with a local draw.io it works offline. One exception: shapes from the Material Design library show icons from `fonts.gstatic.com`. +Without `DRAWIO_BASE_URL` the preview uses the trimmed draw.io copy bundled with this package. It has the editor, the shape libraries, the templates and PlantUML; features that load more code when used (Mermaid, for example) are not included. Set `DRAWIO_BASE_URL` to a full draw.io if you need them. + ## Troubleshooting ### Port already in use @@ -248,6 +250,10 @@ Check that the browser URL has the `?mcp=` query parameter. The MCP session ID c PNG and SVG files are rendered by draw.io in the preview tab. Browsers slow down tabs that stay in the background, so the tab may not answer in time. Bring the preview tab to the front and try again. +### Preview is blank inside VS Code Simple Browser + +The preview page refuses to be embedded in other pages (it sends `Content-Security-Policy: frame-ancestors 'self'`), so in-editor browsers such as VS Code Simple Browser, Cursor's built-in browser or a port forward's "Preview in Editor" show a blank page. Open the Browser URL from the `start_session` result in a regular browser (Chrome, Edge, Firefox, Safari) instead. + ## License Apache-2.0