Skip to main content
Glama

drawui

Draw a UI on a canvas, and your coding agent builds it in your project.

drawui is a local canvas (Excalidraw) with an MCP server. You sketch screens freeform: rectangles are containers, text inside a shape is its label, and text starting with // is a note to the agent. The agent reads the drawing, writes the frontend with the component library you chose, and draws its changes back onto the canvas, so the drawing and the code stay in step.

It works with any MCP client that speaks streamable HTTP, such as Claude Code and Switchback.

Run it

You need Bun 1.4 or later.

git clone https://github.com/Harville-Labs/drawui
cd drawui
bun install
bun run build
bun start ~/code/my-app

That opens the canvas at http://localhost:4747 for ~/code/my-app. Leave the path off to use the current directory, or point it at an empty folder to start from a blank canvas. Then connect your agent:

claude mcp add --transport http drawui http://localhost:4747/mcp

Or copy .mcp.json into your project's root so everyone working in it gets the server. Change the port there if you start drawui with --port.

Pick a component library in the top bar (Sivir UI, shadcn/ui, and shadcn-svelte are suggested; any name works) and, if you like, the URL of your dev server so the preview sits beside the drawing. Then ask the agent to "build what I drew in drawui", or use the build prompt.

Related MCP server: Excalidraw MCP Server

How to draw

You draw

The agent reads

A rectangle, ellipse, or frame around other shapes

A container. Nesting is layout; rows and columns are inferred.

A frame

A screen, named by the frame's name

Text inside a shape

That component's visible text, used verbatim

Text starting with //

A note to the agent, attached to the container it sits in

An arrow from a note to an element

A note about that element

An arrow between elements

Navigation or data flow; its label says which

Dashed strokes, fills, colors

Deliberate hints

Freehand lines

A rough sketch; the agent looks at an image of it

Select text and use Mark as note to turn it into a note without typing //. Select part of the drawing to ask the agent to build only that part.

Things the agent draws are tagged as its own, and elements it implemented link to their source file. When it can't build something or had to guess, it leaves a note with an arrow pointing at the element.

What's saved

Everything stays on your machine. The server listens only on 127.0.0.1 and answers only requests addressed to localhost.

  • drawui.excalidraw: the drawing, in the project directory. Open it in Excalidraw too.

  • drawui.json: the chosen library and preview URL.

Commit both if you want the drawing to live with the code.

MCP tools

get_project, set_project, get_canvas, get_selection, get_canvas_image, wait_for_change, draw, update, delete, and annotate. See docs/mcp.md.

Develop

bun run check   # lint, typecheck, tests, build, file length; what CI runs
bun run dev     # build the canvas and start the server on the current directory

See AGENTS.md for the layout and the rules changes must follow.

License

Apache 2.0.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to programmatically control a live Excalidraw canvas through element-level CRUD operations and real-time synchronization. It allows agents to iteratively build, inspect, and refine diagrams while providing visual feedback via screenshots and scene descriptions.
    1,199 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to programmatically control a live Excalidraw canvas with element-level CRUD operations and real-time synchronization. It supports iterative diagramming through scene descriptions, screenshots, and advanced layout tools for collaborative AI-human workflows.
    1,199 npm
    2
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables coding agents to capture pixel-accurate screenshots and DOM state from localhost apps, receive user-drawn instructions and reference images, and manage implementation review cycles.
    2 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables coding agents to draw and edit Excalidraw diagrams on localhost by rendering Mermaid source into a live-updating canvas synced through a context file, with support for reusable icon libraries. No API key is required.
    2 npm
    GNU Lesser General Public v2.1 only