drawio-mcp-server 1.8.0 → 2.0.4
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.
- package/README.md +9 -5
- package/build/emitter_bus.js +2 -3
- package/build/index.js +243 -341
- package/build/multi-transport.test.js +160 -0
- package/build/plugin/mcp-plugin.js +853 -60
- package/build/prefetch-assets.js +11 -0
- package/build/real-environment/add-cell-of-shape.test.js +51 -0
- package/build/real-environment/add-edge.test.js +86 -0
- package/build/real-environment/assertions.js +18 -0
- package/build/real-environment/delete-cell-by-id.test.js +45 -0
- package/build/real-environment/edge-editing.test.js +70 -0
- package/build/real-environment/edit-cell.test.js +64 -0
- package/build/real-environment/export-diagram.test.js +473 -0
- package/build/real-environment/harness.js +176 -0
- package/build/real-environment/import-export.test.js +82 -0
- package/build/real-environment/layers-and-selection.test.js +70 -0
- package/build/real-environment/logger.js +25 -0
- package/build/real-environment/screenshot.js +46 -0
- package/build/real-environment/set-cell-parent.test.js +64 -0
- package/build/real-environment/shapes.test.js +153 -0
- package/build/real-environment/test-helpers.js +10 -0
- package/build/real-environment/tools.js +22 -0
- package/build/real-environment/types.js +1 -0
- package/build/tool.js +46 -0
- package/build/tools/add-cell-of-shape.js +42 -0
- package/build/tools/add-edge.js +33 -0
- package/build/tools/add-rectangle.js +41 -0
- package/build/tools/create-layer.js +8 -0
- package/build/tools/delete-cell-by-id.js +10 -0
- package/build/tools/edit-cell.js +28 -0
- package/build/tools/edit-edge.js +30 -0
- package/build/tools/export-diagram.js +96 -0
- package/build/tools/get-active-layer.js +5 -0
- package/build/tools/get-selected-cell.js +5 -0
- package/build/tools/get-shape-by-name.js +10 -0
- package/build/tools/get-shape-categories.js +5 -0
- package/build/tools/get-shapes-in-category.js +10 -0
- package/build/tools/import-diagram.js +22 -0
- package/build/tools/index.js +49 -0
- package/build/tools/list-layers.js +5 -0
- package/build/tools/list-paged-model.js +41 -0
- package/build/tools/move-cell-to-layer.js +11 -0
- package/build/tools/set-active-layer.js +8 -0
- package/build/tools/set-cell-data.js +14 -0
- package/build/tools/set-cell-parent.js +9 -0
- package/build/tools/set-cell-shape.js +13 -0
- package/build/tools/shared.js +7 -0
- package/build/tools/types.js +1 -0
- package/package.json +35 -33
package/README.md
CHANGED
|
@@ -3,16 +3,20 @@
|
|
|
3
3
|
Let's do some Vibe Diagramming with the most wide-spread diagramming tool called Draw.io (Diagrams.net).
|
|
4
4
|
|
|
5
5
|
[](https://discord.gg/dM4PWdf42q)
|
|
6
|
-
[](https://github.com/lgazo/drawio-mcp-server/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/lgazo/drawio-mcp-server/actions/workflows/server-ci.yml)
|
|
7
7
|
[](https://mseep.ai/app/5fc2b7fe-8ceb-4683-97bd-6d31e07b5888)
|
|
8
8
|
[](https://npmjs.com/package/drawio-mcp-server)
|
|
9
9
|
|
|
10
10
|
## Key Highlights
|
|
11
11
|
|
|
12
|
+
- Import and export diagrams from/to XML, SVG (with embedded XML), or PNG (with embedded XML) 
|
|
13
|
+
- Edge geometry control with waypoints and automatic self-connector routing 
|
|
14
|
+
- Parent-child relationships for nested shapes and grouping 
|
|
15
|
+
- Unified Server and Extension in the same mono-repo 
|
|
12
16
|
- Built-in Draw.io editor - no browser extension required 
|
|
13
17
|
- MCP server that lets AI agents control Draw.io diagrams
|
|
14
18
|
- Programmatic diagram creation, inspection, and modification via MCP tools
|
|
15
|
-
- Layer management for complex diagrams
|
|
19
|
+
- Layer management for complex diagrams
|
|
16
20
|
- Works with any MCP client (Claude Desktop, Claude Code, Zed, Codex, etc.)
|
|
17
21
|
|
|
18
22
|
## Introduction
|
|
@@ -32,7 +36,7 @@ Two ways to use:
|
|
|
32
36
|
No additional requirements - runs out of the box with `--editor` flag.
|
|
33
37
|
|
|
34
38
|
### For Browser Extension
|
|
35
|
-
- **Browser extension** - [drawio-mcp-extension](
|
|
39
|
+
- **Browser extension** - [drawio-mcp-extension](./packages/drawio-mcp-extension/README.md)
|
|
36
40
|
- Draw.io open in your browser
|
|
37
41
|
|
|
38
42
|
### Optional
|
|
@@ -152,7 +156,7 @@ The server runs as part of your MCP host. Detailed configuration for all support
|
|
|
152
156
|
|
|
153
157
|
## Alternative: Browser Extension
|
|
154
158
|
|
|
155
|
-
Instead of the built-in editor, you can use the [browser extension](
|
|
159
|
+
Instead of the built-in editor, you can use the [browser extension](./packages/drawio-mcp-extension/README.md) to connect to Draw.io running in your browser. This works with or without the `--editor` flag.
|
|
156
160
|
|
|
157
161
|
1. Open [Draw.io in your browser](https://app.diagrams.net/)
|
|
158
162
|
2. Install the Draw.io MCP Browser Extension:
|
|
@@ -173,7 +177,7 @@ Configuration without `--editor`:
|
|
|
173
177
|
}
|
|
174
178
|
```
|
|
175
179
|
|
|
176
|
-
See the [extension documentation](
|
|
180
|
+
See the [extension documentation](./packages/drawio-mcp-extension/README.md) for more details.
|
|
177
181
|
|
|
178
182
|
## Related Resources
|
|
179
183
|
|
package/build/emitter_bus.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { bus_reply_stream, bus_request_stream
|
|
1
|
+
import { bus_reply_stream, bus_request_stream } from "./types.js";
|
|
2
2
|
export function create_bus(log) {
|
|
3
3
|
return function (emitter) {
|
|
4
|
-
const listeners = [];
|
|
5
4
|
const bus = {
|
|
6
5
|
send_to_extension: (request) => {
|
|
7
6
|
log.debug(`[bus] sending to Extension`, request);
|
|
@@ -11,11 +10,11 @@ export function create_bus(log) {
|
|
|
11
10
|
const listener = (emitter_data) => {
|
|
12
11
|
log.debug(`[bus] received from Extension`, emitter_data);
|
|
13
12
|
if (emitter_data && emitter_data.__event === event_name) {
|
|
13
|
+
emitter.off(bus_reply_stream, listener);
|
|
14
14
|
reply(emitter_data);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
emitter.on(bus_reply_stream, listener);
|
|
18
|
-
listeners.push(reply);
|
|
19
18
|
},
|
|
20
19
|
};
|
|
21
20
|
return bus;
|