Skip to content
Design
Skill

/excalidraw-skill

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

From plugin
mcp-excalidraw
2.7k1 skill

Claude Code

$ npx -y skills add yctimlin/mcp_excalidraw --skill excalidraw-skill --agent claude-code

SKILL.md

excalidraw-skill.SKILL.md
name: excalidraw-skill
description: 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.

Excalidraw Skill

Step 0: Pick an Interface

Three interfaces drive the same live canvas. Pick the first one that applies:

1. **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. 2. **CLI** (default when no MCP tools are present):

   npx -y mcp-excalidraw-server <command>

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). If the CLI is installed globally (`npm i -g mcp-excalidraw-server`), the shorter alias `excalidraw-canvas <command>` works too. 3. **REST API** (last resort, e.g. from application code): HTTP endpoints on `http://127.0.0.1:3000` — see `references/cheatsheet.md` for 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> [...]` | | Read the current selection | `selection` (selected element IDs and count) | | 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 or a configured self-hosted 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 a `set` object (`{"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 `backgroundColor` fills with their darker `strokeColor` (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 boxe

Read more
@yctimlin
Ships withmcp-excalidraw

mcp-excalidraw-server gives AI agents a live Excalidraw canvas they can draw on, look at, refine, and save into your repo.

Stars on GitHub

Momentum

stars in total
2.7k
Star history of yctimlin/mcp_excalidraw on GitHub, a chart by star-history.com

More skills from other plugins.

impeccable

impeccable

Use to design, redesign, critique, audit, polish or animate a frontend: websites, landing pages, dashboards, app UI, components,…

@pbakaus@pbakausInstall Skill

Questions about excalidraw-skill.

Which coding agents can use excalidraw-skill?
excalidraw-skill installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.