drawio-mcp-server 1.5.0 → 1.6.0
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 +60 -26
- package/build/index.js +20 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
|
|
1
2
|
# Draw.io MCP server
|
|
2
3
|
|
|
3
4
|
Let's do some Vibe Diagramming with the most wide-spread diagramming tool called Draw.io (Diagrams.net).
|
|
4
5
|
|
|
5
|
-
[](https://discord.gg/dM4PWdf42q) [](https://github.com/lgazo/drawio-mcp-server/actions/workflows/ci.yml)
|
|
6
|
+
[](https://discord.gg/dM4PWdf42q) [](https://github.com/lgazo/drawio-mcp-server/actions/workflows/ci.yml) [](https://mseep.ai/app/5fc2b7fe-8ceb-4683-97bd-6d31e07b5888)
|
|
6
7
|
|
|
7
8
|
## Introduction
|
|
8
9
|
|
|
@@ -246,14 +247,15 @@ To use a custom extension port (e.g., 8080), add `"--extension-port", "8080"` to
|
|
|
246
247
|
{
|
|
247
248
|
/// The name of your MCP server
|
|
248
249
|
"drawio": {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
250
|
+
/// The path to the executable
|
|
251
|
+
"command": "npx",
|
|
252
|
+
/// The arguments to pass to the executable
|
|
253
|
+
"args": [
|
|
254
|
+
"-y",
|
|
255
|
+
"drawio-mcp-server"
|
|
256
|
+
],
|
|
257
|
+
/// The environment variables to set for the executable
|
|
258
|
+
"env": {}
|
|
257
259
|
}
|
|
258
260
|
}
|
|
259
261
|
```
|
|
@@ -266,14 +268,15 @@ To use a custom extension port (e.g., 8080), add `"--extension-port", "8080"` to
|
|
|
266
268
|
{
|
|
267
269
|
/// The name of your MCP server
|
|
268
270
|
"drawio": {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
271
|
+
/// The path to the executable
|
|
272
|
+
"command": "pnpm",
|
|
273
|
+
/// The arguments to pass to the executable
|
|
274
|
+
"args": [
|
|
275
|
+
"dlx",
|
|
276
|
+
"drawio-mcp-server"
|
|
277
|
+
],
|
|
278
|
+
/// The environment variables to set for the executable
|
|
279
|
+
"env": {}
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
282
|
```
|
|
@@ -283,16 +286,15 @@ To use a custom extension port (e.g., 8080), add `"--extension-port", "8080"` to
|
|
|
283
286
|
|
|
284
287
|
```json
|
|
285
288
|
{
|
|
286
|
-
/// The name of your MCP server
|
|
287
289
|
"drawio": {
|
|
288
|
-
"command":
|
|
289
|
-
|
|
290
|
-
"
|
|
291
|
-
|
|
292
|
-
"
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
290
|
+
"command": "npx",
|
|
291
|
+
"args": [
|
|
292
|
+
"-y",
|
|
293
|
+
"drawio-mcp-server",
|
|
294
|
+
"--extension-port",
|
|
295
|
+
"8080"
|
|
296
|
+
],
|
|
297
|
+
"env": {}
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
```
|
|
@@ -482,6 +484,34 @@ The Draw.io MCP server provides the following tools for programmatic diagram int
|
|
|
482
484
|
- `source_id`, `target_id`: Optional IDs of new source/target cells
|
|
483
485
|
- `style`: Optional replacement style string
|
|
484
486
|
|
|
487
|
+
### Layer Management Tools
|
|
488
|
+
- **`list-layers`**
|
|
489
|
+
Lists all available layers in the diagram with their IDs and names
|
|
490
|
+
*Returns*: Array of layer objects with properties (ID, name, visibility, locked status)
|
|
491
|
+
|
|
492
|
+
- **`set-active-layer`**
|
|
493
|
+
Sets the active layer for creating new elements. All subsequent element creation will happen in this layer
|
|
494
|
+
*Parameters*:
|
|
495
|
+
- `layer_id`: ID of the layer to set as active
|
|
496
|
+
*Returns*: Information about the newly active layer
|
|
497
|
+
|
|
498
|
+
- **`move-cell-to-layer`**
|
|
499
|
+
Moves a cell from its current layer to a target layer
|
|
500
|
+
*Parameters*:
|
|
501
|
+
- `cell_id`: ID of the cell to move
|
|
502
|
+
- `target_layer_id`: ID of the target layer where the cell will be moved
|
|
503
|
+
*Returns*: Confirmation of the move operation
|
|
504
|
+
|
|
505
|
+
- **`get-active-layer`**
|
|
506
|
+
Gets the currently active layer information
|
|
507
|
+
*Returns*: Information about the current active layer (ID and name)
|
|
508
|
+
|
|
509
|
+
- **`create-layer`**
|
|
510
|
+
Creates a new layer in the diagram
|
|
511
|
+
*Parameters*:
|
|
512
|
+
- `name`: Name for the new layer
|
|
513
|
+
*Returns*: Information about the newly created layer
|
|
514
|
+
|
|
485
515
|
## Related Resources
|
|
486
516
|
|
|
487
517
|
[Troubleshooting](./TROUBLESHOOTING.md)
|
|
@@ -503,3 +533,7 @@ The Draw.io MCP server provides the following tools for programmatic diagram int
|
|
|
503
533
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=lgazo/drawio-mcp-server&type=Date" />
|
|
504
534
|
</picture>
|
|
505
535
|
</a>
|
|
536
|
+
|
|
537
|
+
## Assessments
|
|
538
|
+
|
|
539
|
+
[](https://mseep.ai/app/lgazo-drawio-mcp-server)
|
package/build/index.js
CHANGED
|
@@ -122,7 +122,7 @@ if (logger_type === "mcp_server") {
|
|
|
122
122
|
// Create server instance
|
|
123
123
|
const server = new McpServer({
|
|
124
124
|
name: "drawio-mcp-server",
|
|
125
|
-
version: "1.
|
|
125
|
+
version: "1.6.0",
|
|
126
126
|
}, {
|
|
127
127
|
capabilities,
|
|
128
128
|
});
|
|
@@ -338,6 +338,25 @@ server.tool(TOOL_list_paged_model, "Retrieves a paginated view of all cells (ver
|
|
|
338
338
|
.describe("Optional filter criteria to apply to cells before pagination")
|
|
339
339
|
.default({}),
|
|
340
340
|
}, default_tool(TOOL_list_paged_model, context));
|
|
341
|
+
const TOOL_list_layers = "list-layers";
|
|
342
|
+
server.tool(TOOL_list_layers, "Lists all available layers in the diagram with their IDs and names.", {}, default_tool(TOOL_list_layers, context));
|
|
343
|
+
const TOOL_set_active_layer = "set-active-layer";
|
|
344
|
+
server.tool(TOOL_set_active_layer, "Sets the active layer for creating new elements. All subsequent element creation will happen in this layer.", {
|
|
345
|
+
layer_id: z.string().describe("ID of the layer to set as active"),
|
|
346
|
+
}, default_tool(TOOL_set_active_layer, context));
|
|
347
|
+
const TOOL_move_cell_to_layer = "move-cell-to-layer";
|
|
348
|
+
server.tool(TOOL_move_cell_to_layer, "Moves a cell from its current layer to a target layer.", {
|
|
349
|
+
cell_id: z.string().describe("ID of the cell to move"),
|
|
350
|
+
target_layer_id: z
|
|
351
|
+
.string()
|
|
352
|
+
.describe("ID of the target layer where the cell will be moved"),
|
|
353
|
+
}, default_tool(TOOL_move_cell_to_layer, context));
|
|
354
|
+
const TOOL_get_active_layer = "get-active-layer";
|
|
355
|
+
server.tool(TOOL_get_active_layer, "Gets the currently active layer information.", {}, default_tool(TOOL_get_active_layer, context));
|
|
356
|
+
const TOOL_create_layer = "create-layer";
|
|
357
|
+
server.tool(TOOL_create_layer, "Creates a new layer in the diagram.", {
|
|
358
|
+
name: z.string().describe("Name for the new layer"),
|
|
359
|
+
}, default_tool(TOOL_create_layer, context));
|
|
341
360
|
async function start_stdio_transport() {
|
|
342
361
|
const transport = new StdioServerTransport();
|
|
343
362
|
await server.connect(transport);
|