drawio-mcp-server 1.7.0 → 2.0.3
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 +96 -425
- package/build/assets/downloader.js +96 -0
- package/build/assets/index.js +2 -0
- package/build/assets/manager.js +31 -0
- package/build/config.js +45 -0
- package/build/config.test.js +54 -0
- package/build/emitter_bus.js +2 -3
- package/build/index.js +305 -337
- package/build/plugin/mcp-plugin.js +2618 -0
- 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/harness.js +175 -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 +29 -22
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { writeFileSync, existsSync } from "node:fs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { export_tool_handler } from "../tool.js";
|
|
4
|
+
export const TOOL_export_diagram = "export-diagram";
|
|
5
|
+
export const registerExportDiagramTool = (server, context) => {
|
|
6
|
+
server.tool(TOOL_export_diagram, "Export the current diagram as SVG, PNG, or XML. Returns the diagram data as base64 (PNG) or text (SVG/XML). Optionally saves to a file.", {
|
|
7
|
+
format: z
|
|
8
|
+
.enum(["svg", "png", "xml"])
|
|
9
|
+
.describe("Export format: svg for vector graphics, png for raster image, xml for raw diagram data"),
|
|
10
|
+
scale: z
|
|
11
|
+
.number()
|
|
12
|
+
.optional()
|
|
13
|
+
.default(1)
|
|
14
|
+
.describe("Zoom factor for the export (1 = 100%)"),
|
|
15
|
+
border: z
|
|
16
|
+
.number()
|
|
17
|
+
.optional()
|
|
18
|
+
.default(0)
|
|
19
|
+
.describe("Border width in pixels around the diagram"),
|
|
20
|
+
background: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.default("#ffffff")
|
|
24
|
+
.describe("Background color in hex format (e.g., #ffffff)"),
|
|
25
|
+
shadow: z
|
|
26
|
+
.boolean()
|
|
27
|
+
.optional()
|
|
28
|
+
.default(false)
|
|
29
|
+
.describe("Include shadow effects in the export"),
|
|
30
|
+
crop: z
|
|
31
|
+
.boolean()
|
|
32
|
+
.optional()
|
|
33
|
+
.default(true)
|
|
34
|
+
.describe("Crop the export to diagram bounds (true) or full page (false)"),
|
|
35
|
+
selection_only: z
|
|
36
|
+
.boolean()
|
|
37
|
+
.optional()
|
|
38
|
+
.default(false)
|
|
39
|
+
.describe("Export only the currently selected cells"),
|
|
40
|
+
transparent: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.optional()
|
|
43
|
+
.default(false)
|
|
44
|
+
.describe("Use transparent background (overrides background color)"),
|
|
45
|
+
dpi: z
|
|
46
|
+
.number()
|
|
47
|
+
.optional()
|
|
48
|
+
.default(96)
|
|
49
|
+
.describe("DPI for PNG export (affects quality)"),
|
|
50
|
+
embed_xml: z
|
|
51
|
+
.boolean()
|
|
52
|
+
.optional()
|
|
53
|
+
.default(false)
|
|
54
|
+
.describe("Embed the diagram XML data in SVG/PNG so it can be reopened in draw.io"),
|
|
55
|
+
size: z
|
|
56
|
+
.enum(["selection", "page", "diagram"])
|
|
57
|
+
.optional()
|
|
58
|
+
.default("diagram")
|
|
59
|
+
.describe("What to export: 'selection' for selected cells only, 'page' for current page, 'diagram' for entire model"),
|
|
60
|
+
output_path: z
|
|
61
|
+
.string()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("Absolute file path to save the exported file (must be an absolute path)"),
|
|
64
|
+
}, async (args, _extra) => {
|
|
65
|
+
const exportHandler = export_tool_handler(TOOL_export_diagram, context);
|
|
66
|
+
const result = await exportHandler(args, _extra);
|
|
67
|
+
if (args.output_path) {
|
|
68
|
+
const path = await import("node:path");
|
|
69
|
+
if (!path.isAbsolute(args.output_path)) {
|
|
70
|
+
throw new Error("output_path must be an absolute path");
|
|
71
|
+
}
|
|
72
|
+
const dir = path.dirname(args.output_path);
|
|
73
|
+
if (!existsSync(dir)) {
|
|
74
|
+
throw new Error(`Directory does not exist: ${dir}`);
|
|
75
|
+
}
|
|
76
|
+
const exportContent = result.content;
|
|
77
|
+
if (args.format === "png") {
|
|
78
|
+
const imageContent = exportContent.find((c) => c.type === "image");
|
|
79
|
+
if (imageContent) {
|
|
80
|
+
writeFileSync(args.output_path, Buffer.from(imageContent.data, "base64"));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const textContent = exportContent.find((c) => c.type === "text");
|
|
85
|
+
if (textContent) {
|
|
86
|
+
writeFileSync(args.output_path, textContent.text, "utf-8");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
result.content.push({
|
|
90
|
+
type: "text",
|
|
91
|
+
text: `Saved to: ${args.output_path}`,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
});
|
|
96
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default_tool } from "../tool.js";
|
|
2
|
+
export const TOOL_get_active_layer = "get-active-layer";
|
|
3
|
+
export const registerGetActiveLayerTool = (server, context) => {
|
|
4
|
+
server.tool(TOOL_get_active_layer, "Gets the currently active layer information.", {}, default_tool(TOOL_get_active_layer, context));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default_tool } from "../tool.js";
|
|
2
|
+
export const TOOL_get_selected_cell = "get-selected-cell";
|
|
3
|
+
export const registerGetSelectedCellTool = (server, context) => {
|
|
4
|
+
server.tool(TOOL_get_selected_cell, "This tool allows you to retrieve selected cell (whether vertex or edge) on the current page of a Draw.io diagram. The response is a JSON containing attributes of the cell.", {}, default_tool(TOOL_get_selected_cell, context));
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_get_shape_by_name = "get-shape-by-name";
|
|
4
|
+
export const registerGetShapeByNameTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_get_shape_by_name, "Retrieve a specific shape by its name from all available shapes in the diagram's library. It returns the shape and also the category it belongs.", {
|
|
6
|
+
shape_name: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe("Name of the shape to retrieve from the shape library of the current diagram."),
|
|
9
|
+
}, default_tool(TOOL_get_shape_by_name, context));
|
|
10
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default_tool } from "../tool.js";
|
|
2
|
+
export const TOOL_get_shape_categories = "get-shape-categories";
|
|
3
|
+
export const registerGetShapeCategoriesTool = (server, context) => {
|
|
4
|
+
server.tool(TOOL_get_shape_categories, "Retrieves available shape categories from the diagram's library. Library is split into multiple categories.", {}, default_tool(TOOL_get_shape_categories, context));
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_get_shapes_in_category = "get-shapes-in-category";
|
|
4
|
+
export const registerGetShapesInCategoryTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_get_shapes_in_category, "Retrieve all shapes in the provided category from the diagram's library. A shape primarily contains `style` based on which you can create new vertex cells.", {
|
|
6
|
+
category_id: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe("Identifier (ID / key) of the category from which all the shapes should be retrieved."),
|
|
9
|
+
}, default_tool(TOOL_get_shapes_in_category, context));
|
|
10
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_import_diagram = "import-diagram";
|
|
4
|
+
export const registerImportDiagramTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_import_diagram, "Import a diagram from XML, SVG with embedded XML, or PNG with embedded XML into the current Draw.io instance.", {
|
|
6
|
+
data: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe("The diagram data: raw XML string, or base64-encoded SVG/PNG with embedded XML"),
|
|
9
|
+
format: z
|
|
10
|
+
.enum(["xml", "svg", "png"])
|
|
11
|
+
.describe("Input format: xml for raw Draw.io XML, svg for SVG with embedded XML, png for PNG with embedded XML"),
|
|
12
|
+
mode: z
|
|
13
|
+
.enum(["replace", "add", "new-page"])
|
|
14
|
+
.optional()
|
|
15
|
+
.default("replace")
|
|
16
|
+
.describe("Import mode: replace clears current diagram and loads new one, add merges imported cells into current diagram, new-page creates a new page with imported diagram"),
|
|
17
|
+
filename: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Optional original filename for context"),
|
|
21
|
+
}, default_tool(TOOL_import_diagram, context));
|
|
22
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { registerAddCellOfShapeTool } from "./add-cell-of-shape.js";
|
|
2
|
+
import { registerAddEdgeTool } from "./add-edge.js";
|
|
3
|
+
import { registerAddRectangleTool } from "./add-rectangle.js";
|
|
4
|
+
import { registerCreateLayerTool } from "./create-layer.js";
|
|
5
|
+
import { registerDeleteCellByIdTool } from "./delete-cell-by-id.js";
|
|
6
|
+
import { registerEditCellTool } from "./edit-cell.js";
|
|
7
|
+
import { registerEditEdgeTool } from "./edit-edge.js";
|
|
8
|
+
import { registerExportDiagramTool } from "./export-diagram.js";
|
|
9
|
+
import { registerGetActiveLayerTool } from "./get-active-layer.js";
|
|
10
|
+
import { registerGetSelectedCellTool } from "./get-selected-cell.js";
|
|
11
|
+
import { registerGetShapeByNameTool } from "./get-shape-by-name.js";
|
|
12
|
+
import { registerGetShapeCategoriesTool } from "./get-shape-categories.js";
|
|
13
|
+
import { registerGetShapesInCategoryTool } from "./get-shapes-in-category.js";
|
|
14
|
+
import { registerImportDiagramTool } from "./import-diagram.js";
|
|
15
|
+
import { registerListLayersTool } from "./list-layers.js";
|
|
16
|
+
import { registerListPagedModelTool } from "./list-paged-model.js";
|
|
17
|
+
import { registerMoveCellToLayerTool } from "./move-cell-to-layer.js";
|
|
18
|
+
import { registerSetActiveLayerTool } from "./set-active-layer.js";
|
|
19
|
+
import { registerSetCellDataTool } from "./set-cell-data.js";
|
|
20
|
+
import { registerSetCellParentTool } from "./set-cell-parent.js";
|
|
21
|
+
import { registerSetCellShapeTool } from "./set-cell-shape.js";
|
|
22
|
+
const registrars = [
|
|
23
|
+
registerGetSelectedCellTool,
|
|
24
|
+
registerAddRectangleTool,
|
|
25
|
+
registerAddEdgeTool,
|
|
26
|
+
registerDeleteCellByIdTool,
|
|
27
|
+
registerGetShapeCategoriesTool,
|
|
28
|
+
registerGetShapesInCategoryTool,
|
|
29
|
+
registerGetShapeByNameTool,
|
|
30
|
+
registerAddCellOfShapeTool,
|
|
31
|
+
registerSetCellShapeTool,
|
|
32
|
+
registerSetCellDataTool,
|
|
33
|
+
registerEditCellTool,
|
|
34
|
+
registerEditEdgeTool,
|
|
35
|
+
registerListPagedModelTool,
|
|
36
|
+
registerListLayersTool,
|
|
37
|
+
registerSetActiveLayerTool,
|
|
38
|
+
registerMoveCellToLayerTool,
|
|
39
|
+
registerSetCellParentTool,
|
|
40
|
+
registerGetActiveLayerTool,
|
|
41
|
+
registerCreateLayerTool,
|
|
42
|
+
registerExportDiagramTool,
|
|
43
|
+
registerImportDiagramTool,
|
|
44
|
+
];
|
|
45
|
+
export function registerTools(...args) {
|
|
46
|
+
for (const register of registrars) {
|
|
47
|
+
register(...args);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default_tool } from "../tool.js";
|
|
2
|
+
export const TOOL_list_layers = "list-layers";
|
|
3
|
+
export const registerListLayersTool = (server, context) => {
|
|
4
|
+
server.tool(TOOL_list_layers, "Lists all available layers in the diagram with their IDs and names.", {}, default_tool(TOOL_list_layers, context));
|
|
5
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
import { Attributes } from "./shared.js";
|
|
4
|
+
export const TOOL_list_paged_model = "list-paged-model";
|
|
5
|
+
export const registerListPagedModelTool = (server, context) => {
|
|
6
|
+
server.tool(TOOL_list_paged_model, "Retrieves a paginated view of all cells (vertices and edges) in the current Draw.io diagram. This tool provides access to the complete model data with essential fields only, sanitized to remove circular dependencies and excessive data. It allows to filter based on multiple criteria and attribute boolean logic. Useful for programmatic inspection of diagram structure without overwhelming response sizes.", {
|
|
7
|
+
page: z
|
|
8
|
+
.number()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe("Zero-based page number for pagination. Page 0 returns the first batch of cells, page 1 returns the next batch, etc. Default is 0.")
|
|
11
|
+
.default(0),
|
|
12
|
+
page_size: z
|
|
13
|
+
.number()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("Maximum number of cells to return in a single page. Controls response size and performance. Must be between 1 and 1000. Default is 50.")
|
|
16
|
+
.default(50),
|
|
17
|
+
filter: z
|
|
18
|
+
.object({
|
|
19
|
+
cell_type: z
|
|
20
|
+
.enum(["edge", "vertex", "object", "layer", "group"])
|
|
21
|
+
.optional()
|
|
22
|
+
.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"),
|
|
23
|
+
parent_ids: z
|
|
24
|
+
.array(z.string())
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Filter cells to only those whose parent is one of the specified parent IDs."),
|
|
27
|
+
layer_ids: z
|
|
28
|
+
.array(z.string())
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Filter cells to only those whose parent is one of the specified layer IDs. Alias for parent_ids."),
|
|
31
|
+
ids: z
|
|
32
|
+
.array(z.string())
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Filter cells to only those whose ID is one of the specified IDs."),
|
|
35
|
+
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.'),
|
|
36
|
+
})
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Optional filter criteria to apply to cells before pagination")
|
|
39
|
+
.default({}),
|
|
40
|
+
}, default_tool(TOOL_list_paged_model, context));
|
|
41
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_move_cell_to_layer = "move-cell-to-layer";
|
|
4
|
+
export const registerMoveCellToLayerTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_move_cell_to_layer, "Moves a cell from its current layer to a target layer.", {
|
|
6
|
+
cell_id: z.string().describe("ID of the cell to move"),
|
|
7
|
+
target_layer_id: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe("ID of the target layer where the cell will be moved"),
|
|
10
|
+
}, default_tool(TOOL_move_cell_to_layer, context));
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_set_active_layer = "set-active-layer";
|
|
4
|
+
export const registerSetActiveLayerTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_set_active_layer, "Sets the active layer for creating new elements. All subsequent element creation will happen in this layer.", {
|
|
6
|
+
layer_id: z.string().describe("ID of the layer to set as active"),
|
|
7
|
+
}, default_tool(TOOL_set_active_layer, context));
|
|
8
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_set_cell_data = "set-cell-data";
|
|
4
|
+
export const registerSetCellDataTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_set_cell_data, "Sets or updates a custom attribute on an existing cell.", {
|
|
6
|
+
cell_id: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe("Identifier (`id` attribute) of the cell to update with custom data."),
|
|
9
|
+
key: z.string().describe("Name of the attribute to set on the cell."),
|
|
10
|
+
value: z
|
|
11
|
+
.union([z.string(), z.number(), z.boolean()])
|
|
12
|
+
.describe("Value to store for the attribute. Non-string values are stringified before storage."),
|
|
13
|
+
}, default_tool(TOOL_set_cell_data, context));
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_set_cell_parent = "set-cell-parent";
|
|
4
|
+
export const registerSetCellParentTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_set_cell_parent, "Sets the parent of a cell, making it a child of the specified parent cell. This allows creating hierarchical relationships where moving the parent also moves its children.", {
|
|
6
|
+
cell_id: z.string().describe("ID of the cell to reparent"),
|
|
7
|
+
parent_id: z.string().describe("ID of the new parent cell"),
|
|
8
|
+
}, default_tool(TOOL_set_cell_parent, context));
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { default_tool } from "../tool.js";
|
|
3
|
+
export const TOOL_set_cell_shape = "set-cell-shape";
|
|
4
|
+
export const registerSetCellShapeTool = (server, context) => {
|
|
5
|
+
server.tool(TOOL_set_cell_shape, "Updates the visual style of an existing vertex cell to match a library shape by name.", {
|
|
6
|
+
cell_id: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe("Identifier (`id` attribute) of the cell whose shape should change."),
|
|
9
|
+
shape_name: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe("Name of the library shape whose style should be applied to the existing cell."),
|
|
12
|
+
}, default_tool(TOOL_set_cell_shape, context));
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const Attributes = z.lazy(() => z
|
|
3
|
+
.array(z.union([z.string(), Attributes]))
|
|
4
|
+
.refine((arr) => arr.length === 0 || typeof arr[0] === "string", {
|
|
5
|
+
message: "If not empty, the first element must be a string operator",
|
|
6
|
+
})
|
|
7
|
+
.default([]));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drawio-mcp-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Provides Draw.io services to MCP Clients",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "index.js",
|
|
6
|
+
"main": "build/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"drawio-mcp-server": "
|
|
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"
|
|
8
|
+
"drawio-mcp-server": "build/index.js"
|
|
24
9
|
},
|
|
25
10
|
"engines": {
|
|
26
11
|
"node": ">=20.0.0"
|
|
@@ -43,28 +28,50 @@
|
|
|
43
28
|
"license": "MIT",
|
|
44
29
|
"repository": {
|
|
45
30
|
"type": "git",
|
|
46
|
-
"url": "https://github.com/lgazo/drawio-mcp-server"
|
|
31
|
+
"url": "git+https://github.com/lgazo/drawio-mcp-server.git"
|
|
47
32
|
},
|
|
48
|
-
"packageManager": "pnpm@10.8.1",
|
|
49
33
|
"dependencies": {
|
|
50
34
|
"@hono/node-server": "1.19.7",
|
|
51
35
|
"@modelcontextprotocol/sdk": "1.25.1",
|
|
36
|
+
"cachedir": "^2.4.0",
|
|
52
37
|
"hono": "4.11.1",
|
|
53
38
|
"nanoid": "5.1.6",
|
|
39
|
+
"unzipper": "^0.12.0",
|
|
54
40
|
"ws": "8.18.3",
|
|
55
41
|
"zod": "4.2.1"
|
|
56
42
|
},
|
|
57
43
|
"devDependencies": {
|
|
58
44
|
"@jest/globals": "30.2.0",
|
|
45
|
+
"@playwright/test": "1.54.2",
|
|
59
46
|
"@types/jest": "30.0.0",
|
|
60
47
|
"@types/node": "25.0.3",
|
|
48
|
+
"@types/unzipper": "^0.10.11",
|
|
61
49
|
"@types/ws": "^8.18.1",
|
|
50
|
+
"esbuild": "^0.24.0",
|
|
62
51
|
"globals": "16.5.0",
|
|
63
52
|
"jest": "30.2.0",
|
|
64
53
|
"jest-environment-node": "30.2.0",
|
|
65
54
|
"prettier": "3.7.4",
|
|
66
55
|
"rimraf": "6.1.2",
|
|
67
56
|
"ts-jest": "29.4.6",
|
|
68
|
-
"typescript": "5.9.3"
|
|
57
|
+
"typescript": "5.9.3",
|
|
58
|
+
"drawio-mcp-plugin": "2.0.0"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "rimraf build && tsc && mkdir -p build/plugin && cp node_modules/drawio-mcp-plugin/dist/mcp-plugin.js build/plugin/mcp-plugin.js",
|
|
62
|
+
"ci": "pnpm install --frozen-lockfile",
|
|
63
|
+
"dev": "tsc --watch",
|
|
64
|
+
"inspect": "HOST=0.0.0.0 pnpx @modelcontextprotocol/inspector --config ./inspector.json --server drawio",
|
|
65
|
+
"lint": "tsc --noEmit",
|
|
66
|
+
"prefetch-assets": "node build/prefetch-assets.js",
|
|
67
|
+
"format": "prettier --write \"**/*.ts\"",
|
|
68
|
+
"format:check": "prettier --check \"**/*.ts\"",
|
|
69
|
+
"test:real-environment": "NODE_OPTIONS=--experimental-vm-modules jest build/real-environment --runInBand",
|
|
70
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest build/",
|
|
71
|
+
"test:watch": "jest --watch",
|
|
72
|
+
"test:coverage": "jest --config ../../jest.config.js --coverage",
|
|
73
|
+
"clean": "rimraf build coverage .eslintcache",
|
|
74
|
+
"download-assets": "curl -sL \"$(curl -sL https://api.github.com/repos/jgraph/drawio/releases/latest | grep -o '\"browser_download_url\": *\"[^\"]*\\.war\"' | head -1 | cut -d'\"' -f4)\" -o draw.war && unzip -q -o draw.war -d assets/drawio/webapp && rm draw.war",
|
|
75
|
+
"start": "node build/index.js"
|
|
69
76
|
}
|
|
70
|
-
}
|
|
77
|
+
}
|