Miro Diagram Creator
Create diagrams on Miro boards that communicate clearly. Miro auto-layouts everything — your job is to give it clean, structured input so it produces a readable result.
The Two-Step Process
Every diagram requires exactly two Miro MCP calls:
diagram_get_dsl — Fetch the DSL syntax rules for your diagram type. Read the response carefully — it contains the exact grammar, palette rules, and examples. Never guess DSL syntax.
diagram_create — Submit your DSL to create the diagram on the board.
Miro's Layout Engine — What You Need to Know
Miro auto-layouts your diagram. You cannot control pixel positions of nodes. This means:
- Fewer nodes = better layout. The layout engine works well with 8-12 nodes. Past 15, things get messy — giant whitespace gaps, overlapping connections, nodes hidden inside bloated clusters.
- Fewer cross-cluster connections = cleaner result. Every connection between different clusters forces the layout to stretch.
- Clusters should be small. 2-5 nodes per cluster is ideal. A cluster with 7+ nodes becomes a giant empty box.
- Direction matters.
LR (left-to-right) works best for architecture and data flow. TB (top-to-bottom) works best for process/decision flows.
Emoji Icons in Labels
Miro renders emoji in node labels, entity titles, actor names, and cluster titles. Use them — they dramatically improve visual scannability. Add port numbers to service labels when relevant (e.g., :3500, :4000). The per-domain emoji table (👤 user, 🌐 web, 🔐 auth, 🐘 database, ⚡ cache, …) is in references/diagram-patterns.md — read it when picking labels.
Flowchart Diagrams
The Golden Rules
8-12 nodes maximum. One node per major component or decision point. Internal details (middleware, ORM layers) belong in labels or companion docs, not separate nodes.
2-3 palette colors. Each color = a meaning. Use only Miro's approved hex colors and recommended palettes — listed in references/color-palette.md; read it before choosing a palette line.
2-3 clusters with 2-5 nodes each. Clusters organize the story — "Application Layer" vs "Data Layer" — but too many clusters with cross-connections create spaghetti.
Use node types semantically:
flowchart-process — Services, components, actions (rectangle)
flowchart-decision — Branch points, conditions (diamond)
flowchart-terminator — Start/end points (rounded)
flowchart-data — Databases, files, storage (parallelogram)
Connection labels: 1-3 words. Use - for self-evident connections. Label decisions (YES/NO) and cross-service connections (REST, Queue, Triggers).
A full worked example (8-node architecture flowchart DSL) is in references/diagram-patterns.md under "Worked Examples" — read it before writing your first flowchart DSL.
UML Sequence Diagrams
Good for showing multi-service interactions over time — auth flows, API call chains, workflow executions.
Key Patterns
- Actors get a color each. Use the same semantic colors as flowcharts.
- Message types:
sync_call — Request that blocks until response (solid arrow)
sync_return — Response to a sync call (dashed arrow back)
async_call — Fire-and-forget or user action (solid arrow, no wait)
async_return — Async response/callback (dashed arrow)
- Self-calls (same source and target) show internal processing — useful for validation, parsing, etc.
- Keep actors to 5-7. More than 7 actors makes the diagram too wide.
- Group related messages. The eye reads top-to-bottom, so put the happy path first, error handling after.
A worked auth-flow sequence example is in references/diagram-patterns.md under "Worked Examples".
Entity-Relationship Diagrams
Good for database schemas and data models.
Key Patterns
- Attributes use TAB characters (not spaces) to separate key, field, and type.
- Key types:
PK (primary), FK (foreign), UQ (unique), NULL, NOT_NULL
- Cardinalities:
one, many, one_or_many, only_one, zero_or_many, zero_or_one
- Connector types:
-- (identifying — parent PK is part of child PK), .. (non-identifying — normal FK)
- Color entities by domain — e.g., blue for core entities, purple for AI-specific, teal for audit/logging.
- 5-8 entities maximum per diagram. For large schemas, split into focused diagrams (e.g., "User Domain", "Workflow Domain").
- Emoji in entity titles work and improve readability.
A worked 3-entity ERD example (with correct TAB usage) is in references/diagram-patterns.md under "Worked Examples".
Handling Complex Systems
When the user asks for something detailed, don't try to fit everything in one diagram. Instead:
Option A: Simplify to one clean diagram with 8-12 nodes. Put details in a companion document using doc_create.
Option B: Multiple focused diagrams on the same board:
- "System Overview" (flowchart, 8 nodes)
- "Auth Flow" (sequence, 5 actors)
- "Data Model" (ERD, 5-8 entities)
Position multiple diagrams using x/y. The diagram_create response includes bounds — use previous width/height + 300px spacing to prevent overlap.
Companion Documents
Use doc_create for details that would clutter the diagram — legends, implementation notes, full field definitions, API specs:
doc_create(
board_id: "...",
content: "# Architecture Details\n\n## Web App (Next.js 16 — Port 3500)\n- React 19...",
x: <near the diagram>,
y: <below or right of diagram>
)
Before You Create — Checklist
Reference Files
references/color-palette.md — Miro's approved hex colors, semantic mappings, and recommended palettes. Read before writing a palette line.
references/diagram-patterns.md — Per-type structural patterns, the emoji-by-domain table, and worked DSL examples (flowchart, sequence, ERD). Read before writing DSL for a diagram type you haven't produced this session.
1---2name: miro-diagram3description: Create diagrams on Miro boards using the Miro MCP tools — flowcharts, UML class/sequence diagrams, and ERDs. Use whenever the user wants to diagram or visualize anything on a Miro board: architecture, system flows, database schemas, process maps, interaction sequences — or just says "diagram this" with the Miro MCP connected. For multi-element layouts (diagrams + text + tables + metrics), use miro-infographic instead.4---56# Miro Diagram Creator78Create diagrams on Miro boards that communicate clearly. Miro auto-layouts everything — your job is to give it clean, structured input so it produces a readable result.910## The Two-Step Process1112Every diagram requires exactly two Miro MCP calls:13141. **`diagram_get_dsl`** — Fetch the DSL syntax rules for your diagram type. Read the response carefully — it contains the exact grammar, palette rules, and examples. Never guess DSL syntax.15162. **`diagram_create`** — Submit your DSL to create the diagram on the board.1718## Miro's Layout Engine — What You Need to Know1920Miro auto-layouts your diagram. You cannot control pixel positions of nodes. This means:2122- **Fewer nodes = better layout.** The layout engine works well with 8-12 nodes. Past 15, things get messy — giant whitespace gaps, overlapping connections, nodes hidden inside bloated clusters.23- **Fewer cross-cluster connections = cleaner result.** Every connection between different clusters forces the layout to stretch.24- **Clusters should be small.** 2-5 nodes per cluster is ideal. A cluster with 7+ nodes becomes a giant empty box.25- **Direction matters.** `LR` (left-to-right) works best for architecture and data flow. `TB` (top-to-bottom) works best for process/decision flows.2627## Emoji Icons in Labels2829Miro renders emoji in node labels, entity titles, actor names, and cluster titles. Use them — they dramatically improve visual scannability. Add port numbers to service labels when relevant (e.g., `:3500`, `:4000`). The per-domain emoji table (👤 user, 🌐 web, 🔐 auth, 🐘 database, ⚡ cache, …) is in `references/diagram-patterns.md` — read it when picking labels.3031## Flowchart Diagrams3233### The Golden Rules34351. **8-12 nodes maximum.** One node per major component or decision point. Internal details (middleware, ORM layers) belong in labels or companion docs, not separate nodes.36372. **2-3 palette colors.** Each color = a meaning. Use only Miro's approved hex colors and recommended palettes — listed in `references/color-palette.md`; read it before choosing a `palette` line.38393. **2-3 clusters with 2-5 nodes each.** Clusters organize the story — "Application Layer" vs "Data Layer" — but too many clusters with cross-connections create spaghetti.40414. **Use node types semantically:**42 - `flowchart-process` — Services, components, actions (rectangle)43 - `flowchart-decision` — Branch points, conditions (diamond)44 - `flowchart-terminator` — Start/end points (rounded)45 - `flowchart-data` — Databases, files, storage (parallelogram)46475. **Connection labels: 1-3 words.** Use `-` for self-evident connections. Label decisions (`YES`/`NO`) and cross-service connections (`REST`, `Queue`, `Triggers`).4849A full worked example (8-node architecture flowchart DSL) is in `references/diagram-patterns.md` under "Worked Examples" — read it before writing your first flowchart DSL.5051## UML Sequence Diagrams5253Good for showing multi-service interactions over time — auth flows, API call chains, workflow executions.5455### Key Patterns5657- **Actors** get a color each. Use the same semantic colors as flowcharts.58- **Message types:**59 - `sync_call` — Request that blocks until response (solid arrow)60 - `sync_return` — Response to a sync call (dashed arrow back)61 - `async_call` — Fire-and-forget or user action (solid arrow, no wait)62 - `async_return` — Async response/callback (dashed arrow)63- **Self-calls** (same source and target) show internal processing — useful for validation, parsing, etc.64- **Keep actors to 5-7.** More than 7 actors makes the diagram too wide.65- **Group related messages.** The eye reads top-to-bottom, so put the happy path first, error handling after.6667A worked auth-flow sequence example is in `references/diagram-patterns.md` under "Worked Examples".6869## Entity-Relationship Diagrams7071Good for database schemas and data models.7273### Key Patterns7475- **Attributes use TAB characters** (not spaces) to separate key, field, and type.76- **Key types:** `PK` (primary), `FK` (foreign), `UQ` (unique), `NULL`, `NOT_NULL`77- **Cardinalities:** `one`, `many`, `one_or_many`, `only_one`, `zero_or_many`, `zero_or_one`78- **Connector types:** `--` (identifying — parent PK is part of child PK), `..` (non-identifying — normal FK)79- **Color entities by domain** — e.g., blue for core entities, purple for AI-specific, teal for audit/logging.80- **5-8 entities maximum** per diagram. For large schemas, split into focused diagrams (e.g., "User Domain", "Workflow Domain").81- **Emoji in entity titles** work and improve readability.8283A worked 3-entity ERD example (with correct TAB usage) is in `references/diagram-patterns.md` under "Worked Examples".8485## Handling Complex Systems8687When the user asks for something detailed, don't try to fit everything in one diagram. Instead:8889**Option A: Simplify to one clean diagram** with 8-12 nodes. Put details in a companion document using `doc_create`.9091**Option B: Multiple focused diagrams** on the same board:92- "System Overview" (flowchart, 8 nodes)93- "Auth Flow" (sequence, 5 actors)94- "Data Model" (ERD, 5-8 entities)9596Position multiple diagrams using x/y. The `diagram_create` response includes bounds — use previous width/height + 300px spacing to prevent overlap.9798## Companion Documents99100Use `doc_create` for details that would clutter the diagram — legends, implementation notes, full field definitions, API specs:101102```103doc_create(104 board_id: "...",105 content: "# Architecture Details\n\n## Web App (Next.js 16 — Port 3500)\n- React 19...",106 x: <near the diagram>,107 y: <below or right of diagram>108)109```110111## Before You Create — Checklist112113- [ ] Called `diagram_get_dsl` first? (DSL syntax can change)114- [ ] Node count under 12?115- [ ] Using 2-3 palette colors with semantic meaning?116- [ ] Clusters have 2-5 nodes each?117- [ ] Emoji in labels for visual scannability?118- [ ] Port numbers on service labels?119- [ ] Connection labels are 1-3 words?120- [ ] Chose the right direction? (LR for architecture, TB for processes)121- [ ] Complex details moved to companion doc?122123## Reference Files124125- `references/color-palette.md` — Miro's approved hex colors, semantic mappings, and recommended palettes. Read before writing a `palette` line.126- `references/diagram-patterns.md` — Per-type structural patterns, the emoji-by-domain table, and worked DSL examples (flowchart, sequence, ERD). Read before writing DSL for a diagram type you haven't produced this session.