The Excalidraw MCP Server provides a structured API for creating, modifying, and managing Excalidraw diagrams, enabling seamless integration with LLMs and other platforms.
Capabilities include:
Create/Update/Delete Elements: Generate or modify shapes like rectangles, ellipses, and text
Query Elements: Filter and retrieve elements based on criteria
Manage Resources: Access scene information, libraries, and themes
Organize Elements: Group, ungroup, align, distribute, lock, and unlock elements
Flexible Integration: Works with Claude Desktop, Cursor, and Docker for deployment
Supports containerized deployment of the MCP server for simplified integration and consistent environment.
Enables creation, modification, and manipulation of Excalidraw diagrams, including element control, grouping, alignment, and resource management.
Provides installation and dependency management through npm, allowing users to easily set up and run the MCP server.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Excalidraw MCP Servercreate a flowchart showing user login process"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Excalidraw MCP Server & Agent Skill
Run a live Excalidraw canvas and control it from AI agents. This repo provides:
MCP Server: Connect via Model Context Protocol (Claude Desktop, Cursor, Codex CLI, etc.)
Agent Skill: Portable skill for Claude Code, Codex CLI, and other skill-enabled agents
Keywords: Excalidraw agent skill, Excalidraw MCP server, AI diagramming, Claude Code skill, Codex CLI skill, Claude Desktop MCP, Cursor MCP, Mermaid to Excalidraw.
Demo

Watch AI agents create and manipulate diagrams in real-time on the live canvas
Related MCP server: Excalidraw MCP Server
Table of Contents
What It Is
This repo contains two separate processes:
Canvas server: web UI + REST API + WebSocket updates (default
http://localhost:3000)MCP server: exposes MCP tools over stdio; syncs to the canvas via
EXPRESS_SERVER_URL
What's New
Agent skill:
skills/excalidraw-mcp/(portable instructions + helper scripts for export/import and repeatable CRUD)Better testing loop: MCP Inspector CLI examples + browser screenshot checks (
agent-browser)Bugfixes: batch create now preserves element ids (fixes update/delete after batch); frontend entrypoint fixed (
main.tsx)
Quick Start (Local)
Prereqs: Node >= 18, npm
Terminal 1: start the canvas
Open http://localhost:3000.
Terminal 2: run the MCP server (stdio)
Quick Start (Docker)
Canvas server:
MCP server (stdio) is typically launched by your MCP client (Claude Desktop/Cursor/etc.). If you want a local container for it, use the image ghcr.io/yctimlin/mcp_excalidraw:latest and set EXPRESS_SERVER_URL to point at the canvas.
Configure MCP Clients
The MCP server runs over stdio and can be configured with any MCP-compatible client. Below are configurations for both local (requires cloning and building) and Docker (pull-and-run) setups.
Environment Variables
Variable | Description | Default |
| URL of the canvas server |
|
| Enable real-time canvas sync |
|
Claude Desktop
Config location:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Local (node)
Docker
Claude Code
Use the claude mcp add command to register the MCP server.
Local (node) - User-level (available across all projects):
Local (node) - Project-level (shared via .mcp.json):
Docker
Manage servers:
Cursor
Config location: .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for global config)
Local (node)
Docker
Codex CLI
Use the codex mcp add command to register the MCP server.
Local (node)
Docker
Manage servers:
OpenCode
Config location: ~/.config/opencode/opencode.json or project-level opencode.json
Local (node)
Docker
Antigravity (Google)
Config location: ~/.gemini/antigravity/mcp_config.json
Local (node)
Docker
Notes
Docker networking: Use
host.docker.internalto reach the canvas server running on your host machine. On Linux, you may need--add-host=host.docker.internal:host-gatewayor use172.17.0.1.Canvas server: Must be running before the MCP server connects. Start it with
npm run canvas(local) ordocker run -d -p 3000:3000 ghcr.io/yctimlin/mcp_excalidraw-canvas:latest(Docker).Absolute paths: When using local node setup, replace
/absolute/path/to/mcp_excalidrawwith the actual path where you cloned and built the repo.In-memory storage: The canvas server stores elements in memory. Restarting the server will clear all elements. Use the export/import scripts if you need persistence.
Agent Skill (Optional)
This repo includes a skill at skills/excalidraw-mcp/ that provides:
Workflow playbook (
SKILL.md): step-by-step guidance for drawing, refining, and exporting diagramsCheatsheet (
references/cheatsheet.md): MCP tool and REST API referenceHelper scripts (
scripts/*.cjs): export, import, clear, healthcheck, CRUD operations
The skill complements the MCP server by giving your AI agent structured workflows to follow.
Install The Skill (Codex CLI example)
To update an existing installation, remove the old folder first (rm -rf ~/.codex/skills/excalidraw-mcp) then re-copy.
Install The Skill (Claude Code)
User-level (available across all your projects):
Project-level (scoped to a specific project, can be committed to the repo):
Then invoke the skill in Claude Code with /excalidraw-mcp.
To update an existing installation, remove the old folder first then re-copy.
Use The Skill Scripts
All scripts respect EXPRESS_SERVER_URL (default http://localhost:3000) or accept --url.
When The Skill Is Useful
Repository workflow: export elements as JSON, commit it, and re-import later.
Reliable refactors: clear + re-import in
syncmode to make canvas match a file.Automated smoke tests: create/update/delete a known element to validate a deployment.
Repeatable diagrams: keep a library of element JSON snippets and import them.
See skills/excalidraw-mcp/SKILL.md and skills/excalidraw-mcp/references/cheatsheet.md.
MCP Tools (High Level)
The MCP server exposes tools such as:
create_element,update_element,delete_elementquery_elements,get_resourcebatch_create_elementsalign_elements,distribute_elementsgroup_elements,ungroup_elementslock_elements,unlock_elementscreate_from_mermaid(frontend converts Mermaid to Excalidraw elements)
The full tool list and schemas are discoverable via MCP Inspector (tools/list) or by reading src/index.ts.
Testing
Canvas Smoke Test (HTTP)
MCP Smoke Test (MCP Inspector)
List tools:
Create a rectangle:
Frontend Screenshots (agent-browser)
If you use agent-browser for UI checks:
Troubleshooting
Canvas not updating: confirm
EXPRESS_SERVER_URLpoints at the running canvas server.Updates/deletes fail after batch creation: ensure you are on a build that includes the batch id preservation fix (merged via PR #34).
Known Issues / TODO
The following issues are known and tracked for future improvement:
align_elements: These tools log and return success but do not actually move elements. Implementation needed insrc/index.ts:782-806.points: The Zod schema expects[{x, y}]objects but Excalidraw expects[[x, y]]tuples. This may cause issues when creating arrows/lines via MCP. Seesrc/index.ts:187vssrc/types.ts:64.label: Thelabeltype is defined inEXCALIDRAW_ELEMENT_TYPESbut has no corresponding interface in the type union. Seesrc/types.ts:109,118.HTTP transport mode placeholder:
MCP_TRANSPORT_MODE=httpis accepted but falls back to stdio. Seesrc/index.ts:989-996.ungroup_elements: Returns success even when no elements are ungrouped (e.g., elements not found). Seesrc/index.ts:765-769.
Contributions welcome!