Getting started
Three steps: download the browser excalix measures text in, render a spec from the command line, then hand the same ability to your agent over MCP.
-
Install Chromium
excalix needs Node 22 or newer. Export and text measurement run in headless Chromium, which Playwright downloads separately. Do this once per machine:
Terminal npx -y playwright@1.63.0 install chromiumSkip it and the first render stops with a message that names the fix:
Output without Chromium error: Chromium is not installed. Run: npx -y playwright@1.63.0 install chromium -
Render a spec
A spec is a JSON file listing nodes, the edges between them, and optionally the groups they sit in. This one is two boxes and an arrow:
spec.json { "title": "order pipeline", "groups": [{ "id": "aws", "label": "AWS eu-north-1" }], "nodes": [ { "id": "web", "label": "Web app", "kind": "client" }, { "id": "api", "label": "Order API", "kind": "service", "group": "aws" } ], "edges": [{ "from": "web", "to": "api", "label": "POST /orders" }] }Three commands cover the command line:
Terminal npx -y excalix render spec.json -o out/spec npx -y excalix validate spec.json npx -y excalix schemarenderwritesout/spec.excalidraw,out/spec.svgandout/spec.pngand prints their paths. Without-othe basename is the spec path minus its extension. End-owith a slash and it names a directory instead, so-o docs/diagrams/writesspec.excalidrawand its siblings in there.--theme darkdraws the SVG and PNG in Excalidraw's dark mode, and--theme bothwrites the light pair plusspec.dark.svgandspec.dark.png.--animate storyor--animate layersalso writesspec.animated.svgbeside each SVG, andspec.dark.animated.svgfor theme both: the same picture building itself in a loop, for a README or a web page. Story opens on the title and brings in the edges in the order the spec lists them, the source, then the target, then the arrow. Layers goes through the layout one layer at a time along the flow. Solid arrows draw on from their source while dashed ones keep marching, and once the build is done, in about eight seconds, longer for a spec of more than about thirty steps, the finished diagram holds for three before it starts over. Nothing is hidden outside the animation itself, so a viewer that ignores CSS animation shows the finished diagram, as does a browser that tells the SVG its reader prefers reduced motion. A viewer that runs the animation and keeps only its first frame, such as the thumbnail a file browser makes, shows the opening step alone, usually just the title.spec.svgstays as still as it always was.validatechecks the spec without opening a browser. It prints the counts, hereok: 2 nodes, 1 edge, 1 group, or every problem at once and a non-zero exit.schemaprints the JSON Schema of the spec, useful for editor completion or for handing to a model. The spec reference explains each field.The SVG and PNG carry the scene as well as the picture, so either one dropped on excalidraw.com opens as an editable drawing. An image optimiser such as SVGO or a PNG crusher strips the scene, so the
.excalidrawstays the source of truth. Commit the spec beside its outputs, so the next person regenerates the diagram instead of redrawing it. -
Connect an agent
excalix mcpserves one tool,sketch, over stdio. It takes the same spec, writes the three files and returns the PNG in the same result, so the agent can look at what it drew. Register it once.Claude Code
Terminal claude mcp add excalix --scope user -- npx -y excalix mcp--scope usermakes it available in every project. A relativeoutlands under the first root the client declares through MCP roots, usually the project you are working in; a client without roots falls back to the server's working directory.Other MCP clients
Cursor, VS Code, Claude Desktop and others accept this shape in their MCP configuration file:
MCP client configuration { "mcpServers": { "excalix": { "command": "npx", "args": ["-y", "excalix", "mcp"] } } }Where that file lives differs by client; check its documentation for the path. The MCP server page describes what
sketchaccepts and returns.The skill
A Claude Code skill tells the agent when to reach for excalix and how to write a spec that lays out well: reading order, short edge labels, when to split a diagram in two. Install it next to your other skills:
Terminal mkdir -p ~/.claude/skills/excalix curl -fsSL https://raw.githubusercontent.com/yasinmiran/excalix/main/skills/excalix/SKILL.md -o ~/.claude/skills/excalix/SKILL.mdIt is plain Markdown, readable on GitHub before you install it. Its description is written to match asks like "draw the architecture", "sketch a diagram" or "put this system into excalidraw".