home / mcp / excalidraw mcp server
Provides an Excalidraw canvas exposed via MCP for real-time diagramming and element CRUD from AI agents.
Configuration
View docs{
"mcpServers": {
"yctimlin-mcp_excalidraw": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"EXPRESS_SERVER_URL=http://host.docker.internal:3000",
"-e",
"ENABLE_CANVAS_SYNC=true",
"ghcr.io/yctimlin/mcp_excalidraw:latest"
],
"env": {
"ENABLE_CANVAS_SYNC": "true",
"EXPRESS_SERVER_URL": "http://host.docker.internal:3000"
}
}
}
}You can run a live Excalidraw canvas and control it from AI agents using an MCP server and a dedicated agent skill. This setup lets you programmatically create, update, and export diagrams in real time, powered by the Model Context Protocol so your agents can interact with the canvas like a native service.
To use this MCP server, start the canvas server first and then launch the MCP server in stdio mode. Your agents connect through the MCP interface to issue commands that create and modify Excalidraw elements on the live canvas. The canvas is available locally at http://localhost:3000, and the MCP server updates the canvas in real time.
Prerequisites: Node.js (version 18 or newer) and npm installed on your machine.
npm ci
npm run buildStart the canvas server in one terminal window.
HOST=0.0.0.0 PORT=3000 npm run canvasIn a second terminal, run the MCP server in stdio mode so clients can connect to the canvas.
EXPRESS_SERVER_URL=http://localhost:3000 node dist/index.jsThe MCP server can also be run from a Docker container if you prefer a contained environment. The container image exposes the same MCP interface and connects to the canvas via the canvas URL you provide.
If the canvas does not update, verify that EXPRESS_SERVER_URL points to the running canvas server and that ENABLE_CANVAS_SYNC is set to true when required by your setup.
The canvas server stores elements in memory. Restarting the canvas clears the current diagram. Use export/import workflows if you need persistence across restarts.
Check that the canvas is running before attempting MCP connections. If batch operations fail to update or delete elements, ensure you are using a build that preserves element ids during batch creation.
Create a new diagram element on the canvas with specified type and properties.
Update properties of an existing element by its id.
Remove an element from the canvas by id.
Search and retrieve elements that match given criteria.
Retrieve current canvas state or specific resources.
Create multiple elements in a single operation while preserving IDs where supported.
Align a set of elements according to a chosen alignment rule.
Evenly distribute a group of elements across a chosen axis.
Group multiple elements into a single composite.
Break apart a grouped element into its constituent parts.
Convert Mermaid diagrams into Excalidraw elements on the canvas.