excalidraw-skill
Skill2.6k starsChanged 14 days agoMITView on GitHub
Excalidraw canvas toolkit for creating, editing, and refining diagrams on a live canvas. Use when an agent needs to (1) draw or lay out diagrams, (2) iteratively refine them by describing the scene and screenshotting its own work, (3) export/import .excalidraw files or PNG/SVG images, (4) save/restore canvas snapshots, (5) convert Mermaid to Excalidraw, or (6) perform element-level CRUD, alignment, distribution, grouping, duplication, and locking. Primary interface is the bundled CLI (npx -y mcp-excalidraw-server <command>) which auto-starts the canvas server; MCP tools and a REST API are equivalent alternatives.
- Installs packages
5 other projects use a version of this.
Trending
Less talk lately.thin dataabout the whole repository
Most recently taken up by
- willlee1995/skillstheir own version, first seen Oct 13, 2026
- flup-repo/skillstheir own version, first seen Aug 5, 2026
- dongzhigang13305312738-art/paper-skillstheir own version, first seen Jul 21, 2026
- lingzhi227/agent-research-skillstheir own version, first seen Feb 20, 2026
- amanaiproduct/amans-skillstheir own version, first seen Feb 15, 2026
Who's talking about yctimlin/mcp_excalidraw
- excalidraw/excalidraw“MCP Server Integration: Real-time Claude + Excalidraw Canvas Sync”GitHub · Jul 12, 2025 · 16 reactions
- cursor/mcp-servers“[Server Request]:”GitHub · Feb 11, 2026 · 1 reactions
- sudosubin/agents.nix“agent-skills.github.yctimlin.mcp_excalidraw: 2.1.1 → 2.1.2”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.yctimlin.mcp_excalidraw: 2.1.0 → 2.1.1”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.yctimlin.mcp_excalidraw: 0-unstable-2026-07-17 → 2.1.0”GitHub · Oct 4, 2026
The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 14
Talked about on GitHub (14 times).
On GitHub · 14
- Jul 12, 2025MCP Server Integration: Real-time Claude + Excalidraw Canvas Sync — excalidraw/excalidraw16 reactions · 1 comment
- Feb 11, 2026[Server Request]: — cursor/mcp-servers1 reaction · 1 comment
- Oct 4, 2026agent-skills.github.yctimlin.mcp_excalidraw: 2.1.1 → 2.1.2 — sudosubin/agents.nix0 reactions
- Oct 4, 2026agent-skills.github.yctimlin.mcp_excalidraw: 2.1.0 → 2.1.1 — sudosubin/agents.nix0 reactions
- Oct 4, 2026agent-skills.github.yctimlin.mcp_excalidraw: 0-unstable-2026-07-17 → 2.1.0 — sudosubin/agents.nix0 reactions
9 more on GitHub
- Oct 3, 2026agent-skills.github.yctimlin.mcp_excalidraw: init at 0-unstable-2026-07-17 — sudosubin/agents.nix0 reactions
- Jul 31, 2026Claim an npm identity this repository owns and stop the publish workflow probing upstream's package — vitorengers/vibemaxxing0 reactions
- Jul 30, 2026Delete the Docker install path rather than half-supporting it — vitorengers/vibemaxxing0 reactions
- Jul 30, 2026Give LICENSE a named copyright holder, add NOTICE.md, and stop using upstream's demo as this fork's hero — vitorengers/vibemaxxing0 reactions
- Jul 30, 2026Claim an npm identity this repository owns and stop the publish workflow probing upstream's package — vitorengers/vibemaxxing0 reactions
- Jul 30, 2026Add a repo-wide fork-identity check before any file is renamed — vitorengers/vibemaxxing0 reactions
- Jun 10, 2026Block external diagram export in Excalidraw skill — cappyzawa/nix-config0 reactions
- Jun 6, 2026content(mcp): add Excalidraw Canvas MCP Server — JSONbored/awesome-claude0 reactions · 3 comments
- Mar 1, 2026feat: replace Pencil MCP with Excalidraw MCP for big-picture rendering — cogni-work/cogni-visual0 reactions
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- lingzhi227/agent-research-skills★ 350same name
- amanaiproduct/amans-skills★ 79same name
- flup-repo/skills★ 11same name
- dongzhigang13305312738-art/paper-skills★ 1same name
- willlee1995/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 9 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
No setup needed — any canvas-touching command auto-starts the canvas server on http://127.0.0.1:3000 (first npx run downloads the package).
- Very specific: line 47
Labels: put "text": "My Label" on any shape — converted to Excalidraw's bound-label format for you.
- Distinctive: line 81
When you put a label on a background rectangle, Excalidraw creates a bound text element centered in the middle of that shape — right where …
- Distinctive: line 100
Design rule: Keep arrows within the same zone or tier.
- Distinctive: line 102
If you must connect across zones, use an elbowed arrow that travels along the perimeter — never through the middle of another zone.
- Distinctive: line 108
Only add an arrow label when the relationship name is genuinely essential (e.g., protocol, port number, data direction).
- Distinctive: line 109
If you're adding a label to every arrow, reconsider — it usually adds visual noise, not clarity.
- Distinctive: line 110
Keep arrow labels to ≤ 12 characters.
- Very specific: line 120
After each add / apply / batch_create_elements, take a screenshot and check:
- Distinctive: line 130
If you find any issue: stop, fix it, re-screenshot, then continue.
- Very specific: line 138
Use
mermaid/create_from_mermaid: when: the user already has a Mermaid diagram, or the structure maps cleanly to a … - Distinctive: line 140
Create elements directly: when: you need precise layout control, the diagram type doesn't map to Mermaid well (e.g., custom architecture, …
- Very specific: line 146
Create shapes and arrows in one call.
- Distinctive: line 195
Rule: If an arrow would pass through an unrelated shape, add a waypoint to route around it.
- Very specific: line 221
If updates fail: check the ID exists with get <id>.
- Very specific: line 235
Import scene: import diagram.excalidraw (append) or import diagram.excalidraw --replace
- Very specific: line 266
Exit code 4 (browser required)?: Only mermaid and screenshot --renderer browser need an open tab.
- Very specific: line 267
Elements not appearing?: Check describe — they may be off-screen.
- Very specific: line 268
Arrow not connecting?: Verify element IDs with get <id>.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Excalidraw Skill
Step 0: Pick an Interface
Three interfaces drive the same live canvas. Pick the first one that applies:
- MCP tools — if
excalidraw/*tools (e.g.batch_create_elements) are in your tool list, prefer them: results land directly in your context, and screenshots come back as images without touching disk. - CLI (default when no MCP tools are present):
No setup needed — any canvas-touching command auto-starts the canvas server onnpx -y mcp-excalidraw-server <command>http://127.0.0.1:3000(firstnpxrun downloads the package). If the CLI is installed globally (npm i -g mcp-excalidraw-server), the shorter aliasexcalidraw-canvas <command>works too. - REST API (last resort, e.g. from application code): HTTP endpoints on
http://127.0.0.1:3000— seereferences/cheatsheet.mdfor payloads. The server must already be running.
The canvas URL comes from EXPRESS_SERVER_URL (default http://127.0.0.1:3000). Screenshots and image exports render headless inside the canvas server, so you never need a browser tab to check your own work. Only mermaid conversion and viewport control need an open tab (CLI exits with code 4 when it's missing). Still tell the user the URL — opening it lets them watch you draw.
CLI Quick Reference
Results are JSON on stdout — except describe (plain text) and raw-content output when --out is omitted (export scene JSON, screenshot --format svg). Diagnostics on stderr. Exit codes: 0 ok, 1 error, 2 usage, 3 canvas unreachable, 4 browser tab required (only mermaid and screenshot --renderer browser).
| Task | Command | |
| Start / stop / inspect server | start, stop, status | |
| Create elements (batch) | add elements.json or echo '[...]' | add or add --one '{...}' | |
| Multi-op patch in one call | apply patch.json — {"create":[...],"update":[{"id":"a","set":{...}}],"delete":[...]} | |
| Read one / query many | get <id>, query [--type t] [--bbox x0,y0,x1,y1] [--filter k=v] [--filter-json '{...}'] | |
| Update / delete | update <id> --set '{...}', delete <id> [...] | |
| Understand the scene | describe (plain-text summary: ids, positions, labels, connections) | |
| See the scene | screenshot [--out f.png] (PNG without --out → temp file path in JSON; SVG without --out → raw SVG) | |
| Layout operations | arrange align|distribute|group|ungroup|lock|unlock|duplicate --ids a,b,c [--to left|horizontal|...] | |
| Scene files | export [--out scene.excalidraw], `import [scene.excalidraw | -] [--replace]— a.excalidraw.md` out path writes Obsidian's format (see File I/O) |
| Mermaid → canvas | `mermaid [diagram.mmd | -]` (or stdin) |
| Snapshots | snapshot save|list|restore <name> | |
| Share link | share (encrypted upload → excalidraw.com URL) | |
| Wipe canvas | clear --yes | |
| Install / upgrade this skill | install-skill --dir <skills-root> (agent chooses project/global root) |
Element Format (CLI and MCP)
The CLI and MCP tools accept the same agent-friendly format and normalize it automatically:
- Labels: put
"text": "My Label"on any shape — converted to Excalidraw's bound-label format for you. - Arrow binding:
"startElementId": "a"/"endElementId": "b"— arrows auto-route to element edges. - fontFamily: pass a string name (
"helvetica","cascadia","excalifont", ...) or string number"1"–"8". - points: both
[[x,y], ...]tuples and[{"x":..,"y":..}]objects are accepted. - Patch updates: in
apply, update entries can use either direct fields ({"id":"a","x":120}) or asetobject ({"id":"a","set":{"x":120}}). Do not mix both forms in one update entry.
Raw REST is stricter: labels must be "label": {"text": "..."}, bindings must be "start": {"id": "..."} / "end": {"id": "..."}. Only worry about this when POSTing to the API directly.
Coordinate System
The canvas uses a 2D coordinate grid: (0, 0) is the origin, x increases rightward, y increases downward. Plan your layout before writing any JSON.
General spacing guidelines:
- Vertical spacing between tiers: 80–120px (enough that arrows don't crowd labels)
- Horizontal spacing between siblings: 40–60px minimum; give labeled arrows 120px+
- Shape width:
max(160, labelCharCount * 12)to keep the label on one line - Shape height: 60px single-line, 80px two-line labels
- Background/zone padding: 50px on all sides around contained elements
Styling for a professional look:
"fillStyle": "solid"on shapes gives crisp flat fills — the default is a sketchy hachure pattern- Pair pastel
backgroundColorfills with their darkerstrokeColor(palette in the cheatsheet) "strokeStyle": "dashed"on zone borders and async arrows reads as "boundary / background"
Layout Anti-Patterns (Critical for Complex Diagrams)
These are the most common mistakes that produce unreadable diagrams. Avoid all of them.
1. Do NOT use label.text (or text) on large background zone rectangles
When you put a label on a background rectangle, Excalidraw creates a bound text element centered in the middle of that shape — right where your service boxes will be placed. The text overlaps everything inside the zone and cannot be repositioned.
Wrong:
{"id": "vpc-zone", "type": "rectangle", "x": 50, "y": 50, "width": 800, "height": 400, "text": "VPC (10.0.0.0/16)"}Right — use a free-standing text element anchored at the top of the zone:
{"id": "vpc-zone", "type": "rectangle", "x": 50, "y": 50, "width": 800, "height": 400, "backgroundColor": "#e3f2fd"},
{"id": "vpc-label", "type": "text", "x": 70, "y": 60, "width": 300, "height": 30, "text": "VPC (10.0.0.0/16)", "fontSize": 18}The free-standing text element sits at the top corner of the zone and doesn't interfere with elements placed inside.
2. Avoid cross-zone arrows in complex diagrams
An arrow from an element in one layout zone to an element in a distant zone will draw a long diagonal line crossing through everything in between. In a multi-zone infra diagram this produces an unreadable tangle of spaghetti.
Design rule: Keep arrows within the same zone or tier. To show cross-zone relationships, use annotation text or separate the zones so their edges are adjacent (no elements between them), and route the arrow along the edge.
If you must connect across zones, use an elbowed arrow that travels along the perimeter — never through the middle of another zone.
3. Use arrow labels sparingly
Arrow labels are placed at the midpoint of the arrow. On short arrows, they overlap the shapes at both ends. On crowded diagrams, they collide with nearby elements.
- Only add an arrow label when the relationship name is genuinely essential (e.g., protocol, port number, data direction).
- If you're adding a label to every arrow, reconsider — it usually adds visual noise, not clarity.
- Keep arrow labels to ≤ 12 characters. Prefer omitting them entirely on dense diagrams.
Quality: Why It Matters (and How to Check)
Excalidraw diagrams are visual communication. If text is cut off, elements overlap, or arrows cross through unrelated shapes, the diagram becomes confusing and unprofessional — it defeats the whole purpose of drawing it. So after every batch of elements, verify before adding more.
Quality Checklist
After each add / apply / batch_create_elements, take a screenshot and check:
- Text truncation — Is all label text fully visible? Truncated text means the shape is too small. Increase
widthand/orheight. - Overlap — Do any shapes share the same space? Background zones must fully contain children with padding.
- Arrow crossing — Do arrows cut through unrelated elements? If yes, route them around using curved or elbowed arrows (see Arrow Routing below).
- Arrow-label overlap — Arrow labels sit at the midpoint. If they overlap a shape, shorten the label or adjust the arrow path.
- Spacing — At least 40px gap between elements. Cramped layouts are hard to read.
- Readability — Font size ≥ 16 for body text, ≥ 20 for titles.
- Zone label placement — If you used
text/label.texton a background zone rectangle, the zone label will be centered in the middle of the zone, overlapping everything inside. Fix: delete the bound text element and add a free-standing text element at the top of the zone instead (see Layout Anti-Patterns above).
If you find any issue: stop, fix it, re-screenshot, then continue. Say "I see [issue], fixing it" rather than glossing over problems. Only proceed once all checks pass.
Workflow: Drawing a New Diagram
Mermaid vs. Direct Creation — Which to Use?
Use mermaid / create_from_mermaid when: the user already has a Mermaid diagram, or the structure maps cleanly to a flowchart/sequence/ER diagram with standard Mermaid syntax. It's fast and handles conversion automatically, though you get less control over exact layout.
Create elements directly when: you need precise layout control, the diagram type doesn't map to Mermaid well (e.g., custom architecture, annotated cloud diagrams), or you want elements positioned in a specific coordinate grid.
Steps (CLI shown; MCP tools are 1:1 — see cheatsheet)
- Plan your coordinate grid — map out tiers and x-positions before writing JSON. (MCP mode: call
read_diagram_guidefor colors/sizing; the same guidance lives inreferences/cheatsheet.md.) - Optional fresh start:
npx -y mcp-excalidraw-server clear --yes - Create shapes and arrows in one call. Custom
idfields (e.g."id": "auth-svc") make later updates easy:
(Thenpx -y mcp-excalidraw-server add - <<'EOF' [ {"id": "lb", "type": "rectangle", "x": 300, "y": 50, "width": 180, "height": 60, "text": "Load Balancer"}, {"id": "svc-a", "type": "rectangle", "x": 100, "y": 200, "width": 160, "height": 60, "text": "Web Server 1"}, {"id": "svc-b", "type": "rectangle", "x": 450, "y": 200, "width": 160, "height": 60, "text": "Web Server 2"}, {"id": "db", "type": "rectangle", "x": 275, "y": 350, "width": 210, "height": 60, "text": "PostgreSQL"}, {"type": "arrow", "x": 0, "y": 0, "startElementId": "lb", "endElementId": "svc-a"}, {"type": "arrow", "x": 0, "y": 0, "startElementId": "lb", "endElementId": "svc-b"}, {"type": "arrow", "x": 0, "y": 0, "startElementId": "svc-a", "endElementId": "db"}, {"type": "arrow", "x": 0, "y": 0, "startElementId": "svc-b", "endElementId": "db"} ] EOF-positional is optional — with no file argument,addreads stdin.) - Set shape widths using
max(160, labelLength * 12). screenshot→ view the file → run the Quality Checklist → fix issues before the next batch.
Arrow Routing — Avoid Overlaps
Straight arrows can cross through elements in complex diagrams. Use curved or elbowed arrows when needed:
Curved arrows (smooth arc over obstacles):
{
"type": "arrow", "x": 100, "y": 100,
"points": [[0, 0], [50, -40], [200, 0]],
"roundness": {"type": 2}
}The intermediate waypoint [50, -40] lifts the arrow upward. roundness: {type: 2} makes it smooth.
Elbowed arrows (right-angle / L-shaped routing):
{
"type": "arrow", "x": 100, "y": 100,
"points": [[0, 0], [0, -50], [200, -50], [200, 0]],
"elbowed": true
}When to use which:
- Fan-out (one source → many targets): curved arrows with waypoints spread to avoid overlapping
- Cross-lane (connecting to side panels): elbowed arrows that go up, then across, then down
- Long horizontal connections: curved arrows with a slight vertical offset
Rule: If an arrow would pass through an unrelated shape, add a waypoint to route around it.
Workflow: Iterative Refinement
Pairing describe with screenshot is what makes this skill powerful.
describe(describe_scenein MCP) → structured text: element IDs, types, positions, labels, connections. Use it to know what's on the canvas before making programmatic updates (find IDs, understand bounding boxes).screenshot(get_canvas_screenshotin MCP) → PNG rendered headless from the canonical canvas state with Excalidraw's own renderer (no browser tab needed, a few ms). Use it for visual quality verification — it shows exactly what the diagram looks like, including truncation, overlap, and arrow routing. The CLI prints the saved file path as JSON; read/view that file.--scale 2for legibility on dense diagrams,--ids a,bor--frame <id>to zoom in on a part,--darkfor dark mode.
Feedback loop:
add elements
→ screenshot → view → "text truncated on auth-svc"
→ update auth-svc --set '{"width": 220}' → screenshot → "overlap between auth-svc and rate-limiter"
→ update rate-limiter --set '{"x": 520}' → screenshot → "all checks pass"
→ proceedWorkflow: Refine an Existing Diagram
describeto understand current state — note element IDs and positions.- Identify elements by
idor label text (not by x/y coordinates — they change). update <id> --set '{...}'to resize/recolor/move;delete <id>to remove; or bundle everything in oneapplypatch. Bound arrows re-route automatically when you move or resize their endpoints — no need to delete and recreate them.screenshotto confirm the change looks right.- If updates fail: check the ID exists with
get <id>; unlock witharrange unlock --ids <id>if locked.
Workflow: Mermaid Conversion
echo 'graph TD
A[Client] --> B[API]
B --> C[(DB)]' | npx -y mcp-excalidraw-server mermaidRequires an open browser tab (conversion runs in the frontend; exit code 4 tells you to open the canvas URL). Afterwards screenshot to verify layout. If the auto-layout is poor (nodes crowded, edges crossing), find problem elements with describe and reposition them with update.
Workflow: File I/O
- Export scene:
export --out diagram.excalidraw(no--out→ JSON to stdout) - Import scene:
import diagram.excalidraw(append) orimport diagram.excalidraw --replace - Image:
screenshot --out diagram.png/screenshot --format svg --out diagram.svg(headless; SVGs embed their fonts) - Offline:
render diagram.excalidraw --out diagram.pngrenders a saved file without the canvas server (CI-friendly, same flags asscreenshot) - Share link:
share— encrypts the scene and returns a shareable excalidraw.com URL (or a self-hosted instance whenEXCALIDRAW_SHARE_UPLOAD_URL/EXCALIDRAW_SHARE_BASE_URLare set)
This is how diagrams live in a repo: commit the .excalidraw file, and re-import + edit + export it when the architecture changes.
Obsidian vaults: use .excalidraw.md
Check the destination before writing: if any ancestor directory contains .obsidian/, it is an Obsidian vault. A raw .excalidraw file there opens in the Excalidraw plugin only in compatibility mode ("Convert to new format" warning), gets no block references or vault-wide search, and default Obsidian Sync skips non-.md files. Give the export a .excalidraw.md extension and the CLI writes the plugin's native format automatically:
npx -y mcp-excalidraw-server export --out "$VAULT/diagrams/system-map.excalidraw.md" # .md → Obsidian format (or force with --format obsidian)
npx -y mcp-excalidraw-server import "$VAULT/diagrams/system-map.excalidraw.md" --replace # reads both plain and compressed Drawing blocksRound-trips are safe: text-element block references follow the plugin's own id rules, so re-importing, editing, and re-exporting the same file keeps links from other notes intact.
Workflow: Snapshots
snapshot save <name>before risky changes.- Make changes, evaluate with
describe/screenshot. snapshot restore <name>to roll back if needed.snapshot listshows what's saved.
Workflow: Duplication
arrange duplicate --ids a,b --offset 40,40 (default offset 20,20). Useful for repeated patterns or copying layouts.
Error Recovery
- Exit code 3 (canvas unreachable)? Auto-start is disabled (
EXCALIDRAW_NO_AUTOSTART=1) or a non-loopbackEXPRESS_SERVER_URLis set. Runstartexplicitly or fix the env. - Exit code 4 (browser required)? Only
mermaidandscreenshot --renderer browserneed an open tab. Openhttp://127.0.0.1:3000in a browser and retry, or drop--renderer browser— screenshots and image exports render headless. - Elements not appearing? Check
describe— they may be off-screen. In MCP mode, useset_viewportwithscrollToContent: true, orscrollToElementIdsplus optionalviewportZoomFactorto focus on a specific subgraph; in a browser, press the zoom-to-fit button. - Arrow not connecting? Verify element IDs with
get <id>. Make surestartElementId/endElementIdmatch existing element IDs. - Canvas in a bad state?
snapshot savefirst, thenclear --yesand rebuild. Orsnapshot restoreto go back. - Element won't update? It may be locked —
arrange unlock --ids <id>first. - Duplicate text elements / element count doubling? The frontend auto-sync timer periodically writes the full Excalidraw scene back to the server. Excalidraw internally generates a bound text element for every shape with a label; clearing and re-sending elements can re-inject cached bound texts. Clean up:
query --type textto find elements with acontainerId,deletethe unwanted ones, wait a few seconds for auto-sync to settle. The safest prevention: never put labels on background zone rectangles — use free-standing text elements.
References
references/cheatsheet.md: full CLI reference, the 26 MCP tools, REST API endpoints + payload shapes, and the diagram design guide (colors, sizing).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

