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.

  1. 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 chromium

    Skip 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
  2. 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 schema

    render writes out/spec.excalidraw, out/spec.svg and out/spec.png and prints their paths. Without -o the basename is the spec path minus its extension. End -o with a slash and it names a directory instead, so -o docs/diagrams/ writes spec.excalidraw and its siblings in there. --theme dark draws the SVG and PNG in Excalidraw's dark mode, and --theme both writes the light pair plus spec.dark.svg and spec.dark.png.

    --animate story or --animate layers also writes spec.animated.svg beside each SVG, and spec.dark.animated.svg for 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.svg stays as still as it always was.

    validate checks the spec without opening a browser. It prints the counts, here ok: 2 nodes, 1 edge, 1 group, or every problem at once and a non-zero exit. schema prints 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 .excalidraw stays the source of truth. Commit the spec beside its outputs, so the next person regenerates the diagram instead of redrawing it.

  3. Connect an agent

    excalix mcp serves 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 user makes it available in every project. A relative out lands 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 sketch accepts 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.md

    It 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".