drawio-mcp-server 1.6.0 → 1.7.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/LICENSE.md +21 -0
- package/build/index.js +16 -3
- package/package.json +22 -16
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ladislav Gazo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/build/index.js
CHANGED
|
@@ -16,12 +16,13 @@ import { default_tool } from "./tool.js";
|
|
|
16
16
|
import { nanoid_id_generator } from "./nanoid_id_generator.js";
|
|
17
17
|
import { create_logger as create_console_logger } from "./mcp_console_logger.js";
|
|
18
18
|
import { create_logger as create_server_logger, validLogLevels, } from "./mcp_server_logger.js";
|
|
19
|
+
const VERSION = "1.7.0";
|
|
19
20
|
/**
|
|
20
21
|
* Display help message and exit
|
|
21
22
|
*/
|
|
22
23
|
function showHelp() {
|
|
23
24
|
console.log(`
|
|
24
|
-
Draw.io MCP Server
|
|
25
|
+
Draw.io MCP Server (${VERSION})
|
|
25
26
|
|
|
26
27
|
Usage: drawio-mcp-server [options]
|
|
27
28
|
|
|
@@ -66,7 +67,7 @@ const bus_to_ws_forwarder_listener = (event) => {
|
|
|
66
67
|
};
|
|
67
68
|
emitter.on(bus_request_stream, bus_to_ws_forwarder_listener);
|
|
68
69
|
async function start_websocket_server(extensionPort) {
|
|
69
|
-
log.debug(`Draw.io MCP Server starting (WebSocket extension port: ${extensionPort})`);
|
|
70
|
+
log.debug(`Draw.io MCP Server (${VERSION}) starting (WebSocket extension port: ${extensionPort})`);
|
|
70
71
|
const isPortAvailable = await checkPortAvailable(extensionPort);
|
|
71
72
|
if (!isPortAvailable) {
|
|
72
73
|
console.error(`[start_websocket_server] Error: Port ${extensionPort} is already in use. Please stop the process using this port and try again.`);
|
|
@@ -122,7 +123,7 @@ if (logger_type === "mcp_server") {
|
|
|
122
123
|
// Create server instance
|
|
123
124
|
const server = new McpServer({
|
|
124
125
|
name: "drawio-mcp-server",
|
|
125
|
-
version:
|
|
126
|
+
version: VERSION,
|
|
126
127
|
}, {
|
|
127
128
|
capabilities,
|
|
128
129
|
});
|
|
@@ -332,6 +333,18 @@ server.tool(TOOL_list_paged_model, "Retrieves a paginated view of all cells (ver
|
|
|
332
333
|
.enum(["edge", "vertex", "object", "layer", "group"])
|
|
333
334
|
.optional()
|
|
334
335
|
.describe("Filter by cell type: 'edge' for connection lines, 'vertex' for vertices/shapes, 'object' for any cell type, 'layer' for layer cells, 'group' for grouped cells"),
|
|
336
|
+
parent_ids: z
|
|
337
|
+
.array(z.string())
|
|
338
|
+
.optional()
|
|
339
|
+
.describe("Filter cells to only those whose parent is one of the specified parent IDs."),
|
|
340
|
+
layer_ids: z
|
|
341
|
+
.array(z.string())
|
|
342
|
+
.optional()
|
|
343
|
+
.describe("Filter cells to only those whose parent is one of the specified layer IDs. Alias for parent_ids."),
|
|
344
|
+
ids: z
|
|
345
|
+
.array(z.string())
|
|
346
|
+
.optional()
|
|
347
|
+
.describe("Filter cells to only those whose ID is one of the specified IDs."),
|
|
335
348
|
attributes: Attributes.optional().describe('Boolean logic array expressions for filtering cell attributes. Format: ["and" | "or", ...expressions] or ["equal", key, value]. Matches against cell attributes and parsed style properties.'),
|
|
336
349
|
})
|
|
337
350
|
.optional()
|
package/package.json
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drawio-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Provides Draw.io services to MCP Clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"drawio-mcp-server": "./build/index.js"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"ci": "pnpm install --frozen-lockfile",
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"inspect": "HOST=0.0.0.0 pnpx @modelcontextprotocol/inspector --config ./inspector.json --server drawio",
|
|
15
|
+
"prepublishOnly": "pnpm run build",
|
|
16
|
+
"lint": "tsc --noEmit",
|
|
17
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
18
|
+
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
19
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
20
|
+
"test:watch": "jest --watch",
|
|
21
|
+
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
|
22
|
+
"clean": "rimraf build coverage .eslintcache",
|
|
23
|
+
"prebuild": "pnpm run clean"
|
|
24
|
+
},
|
|
10
25
|
"engines": {
|
|
11
26
|
"node": ">=20.0.0"
|
|
12
27
|
},
|
|
@@ -26,6 +41,11 @@
|
|
|
26
41
|
],
|
|
27
42
|
"author": "Ladislav Gazo",
|
|
28
43
|
"license": "MIT",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://github.com/lgazo/drawio-mcp-server"
|
|
47
|
+
},
|
|
48
|
+
"packageManager": "pnpm@10.8.1",
|
|
29
49
|
"dependencies": {
|
|
30
50
|
"@hono/node-server": "1.19.7",
|
|
31
51
|
"@modelcontextprotocol/sdk": "1.25.1",
|
|
@@ -46,19 +66,5 @@
|
|
|
46
66
|
"rimraf": "6.1.2",
|
|
47
67
|
"ts-jest": "29.4.6",
|
|
48
68
|
"typescript": "5.9.3"
|
|
49
|
-
},
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "tsc",
|
|
52
|
-
"ci": "pnpm install --frozen-lockfile",
|
|
53
|
-
"dev": "tsc --watch",
|
|
54
|
-
"inspect": "HOST=0.0.0.0 pnpx @modelcontextprotocol/inspector --config ./inspector.json --server drawio",
|
|
55
|
-
"lint": "tsc --noEmit",
|
|
56
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
57
|
-
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
58
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
59
|
-
"test:watch": "jest --watch",
|
|
60
|
-
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
|
61
|
-
"clean": "rimraf build coverage .eslintcache",
|
|
62
|
-
"prebuild": "pnpm run clean"
|
|
63
69
|
}
|
|
64
|
-
}
|
|
70
|
+
}
|