drawio-mcp-server 1.2.1 → 1.3.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 +27 -0
- package/build/index.js +62 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -279,6 +279,33 @@ The Draw.io MCP server provides the following tools for programmatic diagram int
|
|
|
279
279
|
- `text`: Optional text content
|
|
280
280
|
- `style`: Optional additional style properties
|
|
281
281
|
|
|
282
|
+
- **`set-cell-shape`**
|
|
283
|
+
Applies a library shape's style to an existing cell
|
|
284
|
+
*Parameters*:
|
|
285
|
+
- `cell_id`: ID of the cell whose appearance should change
|
|
286
|
+
- `shape_name`: Name of the library shape whose style should be applied
|
|
287
|
+
|
|
288
|
+
- **`set-cell-data`**
|
|
289
|
+
Stores or updates a custom attribute on a cell
|
|
290
|
+
*Parameters*:
|
|
291
|
+
- `cell_id`: ID of the cell to update
|
|
292
|
+
- `key`: Attribute name to set
|
|
293
|
+
- `value`: Attribute value (stored as a string internally)
|
|
294
|
+
|
|
295
|
+
- **`edit-cell`**
|
|
296
|
+
Updates an existing vertex/shape cell in place by ID
|
|
297
|
+
*Parameters*:
|
|
298
|
+
- `cell_id`: ID of the cell whose properties should change (required)
|
|
299
|
+
- `text`, `x`, `y`, `width`, `height`, `style`: Optional fields to update on the cell; omitted properties stay as-is
|
|
300
|
+
|
|
301
|
+
- **`edit-edge`**
|
|
302
|
+
Updates an existing edge connection between cells by ID
|
|
303
|
+
*Parameters*:
|
|
304
|
+
- `cell_id`: ID of the edge cell to update (required)
|
|
305
|
+
- `text`: Optional edge label text
|
|
306
|
+
- `source_id`, `target_id`: Optional IDs of new source/target cells
|
|
307
|
+
- `style`: Optional replacement style string
|
|
308
|
+
|
|
282
309
|
## Related Resources
|
|
283
310
|
|
|
284
311
|
[Troubleshooting](./TROUBLESHOOTING.md)
|
package/build/index.js
CHANGED
|
@@ -213,6 +213,68 @@ server.tool(TOOL_add_cell_of_shape, "This tool allows you to add new vertex cell
|
|
|
213
213
|
.optional()
|
|
214
214
|
.describe("Semi-colon separated list of Draw.io visual styles, in the form of `key=value`. Example: `whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;`"),
|
|
215
215
|
}, default_tool(TOOL_add_cell_of_shape, context));
|
|
216
|
+
const TOOL_set_cell_shape = "set-cell-shape";
|
|
217
|
+
server.tool(TOOL_set_cell_shape, "Updates the visual style of an existing vertex cell to match a library shape by name.", {
|
|
218
|
+
cell_id: z
|
|
219
|
+
.string()
|
|
220
|
+
.describe("Identifier (`id` attribute) of the cell whose shape should change."),
|
|
221
|
+
shape_name: z
|
|
222
|
+
.string()
|
|
223
|
+
.describe("Name of the library shape whose style should be applied to the existing cell."),
|
|
224
|
+
}, default_tool(TOOL_set_cell_shape, context));
|
|
225
|
+
const TOOL_set_cell_data = "set-cell-data";
|
|
226
|
+
server.tool(TOOL_set_cell_data, "Sets or updates a custom attribute on an existing cell.", {
|
|
227
|
+
cell_id: z
|
|
228
|
+
.string()
|
|
229
|
+
.describe("Identifier (`id` attribute) of the cell to update with custom data."),
|
|
230
|
+
key: z.string().describe("Name of the attribute to set on the cell."),
|
|
231
|
+
value: z
|
|
232
|
+
.union([z.string(), z.number(), z.boolean()])
|
|
233
|
+
.describe("Value to store for the attribute. Non-string values are stringified before storage."),
|
|
234
|
+
}, default_tool(TOOL_set_cell_data, context));
|
|
235
|
+
const TOOL_edit_cell = "edit-cell";
|
|
236
|
+
server.tool(TOOL_edit_cell, "Update properties of an existing vertex/shape cell by its ID. Only provided fields are modified; unspecified properties remain unchanged.", {
|
|
237
|
+
cell_id: z
|
|
238
|
+
.string()
|
|
239
|
+
.describe("Identifier (`id` attribute) of the cell to update. Applies to vertex/shape cells."),
|
|
240
|
+
text: z
|
|
241
|
+
.string()
|
|
242
|
+
.optional()
|
|
243
|
+
.describe("Replace the cell's text/label content."),
|
|
244
|
+
x: z
|
|
245
|
+
.number()
|
|
246
|
+
.optional()
|
|
247
|
+
.describe("Set a new X-axis position for the cell."),
|
|
248
|
+
y: z
|
|
249
|
+
.number()
|
|
250
|
+
.optional()
|
|
251
|
+
.describe("Set a new Y-axis position for the cell."),
|
|
252
|
+
width: z.number().optional().describe("Set a new width for the cell."),
|
|
253
|
+
height: z.number().optional().describe("Set a new height for the cell."),
|
|
254
|
+
style: z
|
|
255
|
+
.string()
|
|
256
|
+
.optional()
|
|
257
|
+
.describe("Replace the cell's style string (semi-colon separated `key=value` pairs)."),
|
|
258
|
+
}, default_tool(TOOL_edit_cell, context));
|
|
259
|
+
const TOOL_edit_edge = "edit-edge";
|
|
260
|
+
server.tool(TOOL_edit_edge, "Update properties of an existing edge by its ID. Only provided fields are modified; unspecified properties remain unchanged.", {
|
|
261
|
+
cell_id: z
|
|
262
|
+
.string()
|
|
263
|
+
.describe("Identifier (`id` attribute) of the edge cell to update. The ID must reference an edge."),
|
|
264
|
+
text: z.string().optional().describe("Replace the edge's label text."),
|
|
265
|
+
source_id: z
|
|
266
|
+
.string()
|
|
267
|
+
.optional()
|
|
268
|
+
.describe("Reassign the edge's source terminal to a different cell ID."),
|
|
269
|
+
target_id: z
|
|
270
|
+
.string()
|
|
271
|
+
.optional()
|
|
272
|
+
.describe("Reassign the edge's target terminal to a different cell ID."),
|
|
273
|
+
style: z
|
|
274
|
+
.string()
|
|
275
|
+
.optional()
|
|
276
|
+
.describe("Replace the edge's style string (semi-colon separated `key=value` pairs)."),
|
|
277
|
+
}, default_tool(TOOL_edit_edge, context));
|
|
216
278
|
const Attributes = z.lazy(() => z
|
|
217
279
|
.array(z.union([
|
|
218
280
|
z.string(),
|