Install
openclaw skills install @matthewyin/diagram-generatorGenerate and edit diagrams with the mcp-diagram-generator MCP server. Use this skill for new diagrams, existing .drawio/.mmd/.excalidraw edits, network topology, architecture, flowchart, swimlane, sequence, class, ER, mind map, and Excalidraw whiteboard work. Always use this skill when the user asks to draw, generate, revise, or export any diagram.
openclaw skills install @matthewyin/diagram-generatorCreate and edit diagrams by converting user intent into a structured JSON specification, then delegating file generation to the mcp-diagram-generator MCP server.
Supported formats:
.drawio.mmd or markdown Mermaid content.excalidrawSupported work:
.drawio, .mmd, and .excalidraw editsdiagrams/{format}/Contact: AlkaidY, tccio2023@gmail.com.
Before generating a diagram, verify that the MCP server tools are available:
mcp__mcp-diagram-generator__get_configmcp__mcp-diagram-generator__generate_diagrammcp__mcp-diagram-generator__init_configIf the tools are missing, configure the MCP server.
Recommended remote configuration:
{
"mcpServers": {
"mcp-diagram-generator": {
"command": "npx",
"args": ["-y", "mcp-diagram-generator"]
}
}
}
Local development configuration:
{
"mcpServers": {
"mcp-diagram-generator": {
"command": "node",
"args": ["/absolute/path/to/mcp-diagram-generator/dist/index.js"]
}
}
}
After changing configuration, restart the agent environment. On first use, the server creates .diagram-config.json and default output directories.
For new diagrams, collect the basic options before accepting or processing the full diagram prompt:
Read references/interaction-intake-guide.md before asking intake questions.
Skip intake when the user already provided all required options and the full prompt. For existing-file edits, ask only for the target file and requested changes if missing.
Select exactly one primary playbook based on the diagram type:
| User Intent | Primary Playbook |
|---|---|
| Network topology, datacenter, zone, router, switch, firewall | references/playbook-network-topology.md |
| System architecture, application architecture, layered component diagram | references/playbook-architecture.md |
| Flowchart, process, decision tree | references/playbook-flowchart.md |
| Swimlane, cross-team handoff, approval workflow by department | references/playbook-swimlane.md |
| Sequence, class, ER, UML-style diagrams | references/playbook-uml.md |
| Whiteboard sketch, hand-drawn style, informal Excalidraw diagram | references/playbook-excalidraw.md |
| Unsure about format | references/format-selection-guide.md first, then the matching playbook |
Only read the playbook needed for the current diagram. If a playbook points to json-schema-guide.md or network-topology-examples.md, read only the relevant section.
For explicit geometry, also read references/layout-quality-guide.md.
Use these defaults unless the user explicitly chooses otherwise:
| Diagram Type | Default Format | Default Direction |
|---|---|---|
| Network topology | Draw.io | Vertical |
| Architecture | Draw.io | Vertical or automatic |
| Flowchart | Mermaid | Vertical |
| Swimlane | Draw.io | Horizontal |
| Sequence | Mermaid | Automatic |
| Class | Mermaid | Automatic |
| ER | Mermaid | Automatic |
| Mind map | Mermaid | Automatic |
| Whiteboard sketch | Excalidraw | Automatic |
Usage context can override defaults:
Follow references/json-schema-guide.md for the schema. Core structure:
{
"format": "drawio",
"diagramType": "architecture",
"title": "Diagram title",
"elements": [
{
"id": "unique-id",
"type": "container",
"name": "Display name",
"level": "environment",
"geometry": { "x": 0, "y": 0, "width": 800, "height": 600 },
"children": []
},
{
"type": "edge",
"source": "source-id",
"target": "target-id"
}
]
}
Universal rules:
elements must be an array.children.source and target must resolve to an existing node or container.style must be an object.#RRGGBB.fillColor: "none" for Draw.io no-fill nodes when needed.Before calling the MCP server, verify:
diagramType is explicit when supported.geometry.After generation, inspect the saved file enough to confirm the expected format-specific properties exist. For code changes to the MCP server, also run npm run test:diagrams from mcp-diagram-generator/.
Preferred call:
{
"diagram_spec": "<spec object>"
}
Optional filename:
{
"diagram_spec": "<spec object>",
"filename": "my-diagram.drawio"
}
Optional explicit output path:
{
"diagram_spec": "<spec object>",
"output_path": "custom/path/to/diagram.drawio"
}
The MCP server validates the schema, creates missing directories, and writes to the configured default directory when no output path is supplied.
Initialize defaults:
init_config()
Set custom paths:
{
"paths": {
"drawio": "output/diagrams/drawio",
"mermaid": "output/diagrams/mermaid",
"excalidraw": "output/diagrams/excalidraw"
}
}
Inspect configuration:
get_config()
Update one format path:
{
"format": "drawio",
"path": "custom/drawio-path"
}
Tool missing:
Schema validation failed:
references/json-schema-guide.md.Directory error:
get_config().init_config() if needed.Wrong extension:
.drawio..mmd or markdown output..excalidraw.Nested container issue:
Read only what is needed:
references/interaction-intake-guide.md: interactive intake defaults and question template.references/format-selection-guide.md: format selection matrix.references/playbook-network-topology.md: Draw.io and Excalidraw network topology rules.references/playbook-architecture.md: layered architecture rules.references/playbook-flowchart.md: process and decision flow rules.references/playbook-swimlane.md: swimlane and handoff rules.references/playbook-uml.md: sequence, class, and ER rules.references/playbook-excalidraw.md: Excalidraw whiteboard and binding rules.references/layout-quality-guide.md: explicit geometry, spacing, and connector readability rules.references/json-schema-guide.md: schema details and examples.references/network-topology-examples.md: network topology JSON patterns.When responding to the user: