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.
MCP Excalidraw Server: Advanced Live Visual Diagramming with AI Integration
A comprehensive TypeScript-based system that combines Excalidraw's powerful drawing capabilities with Model Context Protocol (MCP) integration, enabling AI agents to create and manipulate diagrams in real-time on a live canvas.
🚦 Current Status & Version Information
📋 Choose Your Installation Method
Component | Local | Docker | Status |
Canvas Server | ✅ Fully Working | ✅ Fully Working | Production Ready |
MCP Server | ✅ Fully Working | ✅ Fully Working | Production Ready |
NPM Published | 🔧 In Progress | N/A | Development testing |
Important: Canvas and MCP Server Run Separately
This system consists of two independent components:
Canvas Server - Runs the live Excalidraw canvas (web interface)
MCP Server - Connects to Claude Desktop/Claude Code/Cursor IDE
You can choose any combination:
Canvas: Local OR Docker
MCP Server: Local OR Docker
Both local and Docker setups are fully working and production-ready!
Related MCP server: Excalidraw MCP Server
🚀 What This System Does
🎨 Live Canvas: Real-time Excalidraw canvas accessible via web browser
🤖 AI Integration: MCP server allows AI agents (like Claude) to create visual diagrams
⚡ Real-time Sync: Elements created via MCP API appear instantly on the canvas
🔄 WebSocket Updates: Live synchronization across multiple connected clients
🏗️ Production Ready: Clean, minimal UI suitable for end users
🎥 Demo Video
See MCP Excalidraw in Action!

Watch how AI agents create and manipulate diagrams in real-time on the live canvas
🏛️ Architecture Overview
Two Independent Components
🌟 Key Features
Modern TypeScript Architecture
Full TypeScript Migration: Complete type safety for backend and frontend
Comprehensive Type Definitions: Excalidraw elements, API responses, WebSocket messages
Strict Type Checking: Enhanced development experience and compile-time error detection
Type-Safe React Components: TSX components with proper props typing
🎨 Mermaid Diagram Support (NEW!)
Mermaid to Excalidraw: Convert Mermaid diagrams directly to Excalidraw elements
MCP Tool Integration: Use
create_from_mermaidtool from ClaudeBrowser-based Conversion: Leverages DOM access in the frontend for accurate rendering
Multiple Diagram Types: Supports flowcharts, sequence diagrams, class diagrams, and more
Test Button: Quick test functionality directly from the canvas UI
Real-time Canvas Integration
Elements created via MCP appear instantly on the live canvas
WebSocket-based real-time synchronization
Multi-client support with live updates
Production-Ready Interface
Clean, minimal UI with connection status
Simple "Clear Canvas" functionality
No development clutter or debug information
Comprehensive MCP API
Element Creation: rectangles, ellipses, diamonds, arrows, text, lines
Element Management: update, delete, query with filters
Batch Operations: create multiple elements in one call
Advanced Features: grouping, alignment, distribution, locking
Robust Architecture
TypeScript-based Express.js backend with REST API + WebSocket
React frontend with official Excalidraw package and TypeScript
Dual-path element loading for reliability
Auto-reconnection and error handling
📦 Installation & Setup
Step 1: Choose Your Canvas Server Setup
The canvas server provides the live Excalidraw interface.
Option A: Local Canvas Server
Clone and Install
Build the Project
Start Canvas Server
Access the Canvas
Option B: Docker Canvas Server
Option B1: Use Pre-built Image from GHCR (Recommended)
Option B2: Build Locally
Access the Canvas
Step 2: Configure MCP Server in Your IDE
The MCP server connects your AI assistant (Claude) to the canvas. Choose local OR Docker format based on your preference.
Setup Combinations
You can mix and match any combination:
Canvas Server | MCP Server | Status |
✅ Local | ✅ Local | Recommended |
✅ Local | ✅ Docker | Fully Working |
✅ Docker | ✅ Local | Fully Working |
✅ Docker | ✅ Docker | Fully Working |
Configuration examples are provided in the next section for:
Claude Desktop
Claude Code
Cursor IDE
🔧 Available Scripts
Script | Description |
| Build and start MCP server ( |
| Build and start canvas server ( |
| Build both frontend and TypeScript backend |
| Build React frontend only |
| Compile TypeScript backend to JavaScript |
| Start TypeScript watch mode + Vite dev server |
| Run TypeScript type checking without compilation |
| Build + start in production mode |
🎯 Usage Guide
For End Users
Open the canvas at
http://localhost:3000Check connection status (should show "Connected")
AI agents can now create diagrams that appear in real-time
Use "Clear Canvas" to remove all elements
For AI Agents (via MCP)
The MCP server provides these tools for creating visual diagrams:
Basic Element Creation
Create Text Elements
Create Arrows & Lines
Batch Creation for Complex Diagrams
🔌 MCP Server Configuration for IDEs
Prerequisites
✅ Ensure your canvas server is running (from Step 1):
Local:
npm run canvasDocker:
docker run -d -p 3000:3000 mcp-excalidraw-canvas
Canvas should be accessible at http://localhost:3000
Quick Reference
Choose your configuration based on IDE and preference:
IDE | Config File | Format Options |
Claude Desktop |
| Local ⭐ / Docker ✅ |
Claude Code |
| Local ⭐ / Docker ✅ |
Cursor |
| Local ⭐ / Docker ✅ |
⭐ = Recommended | ✅ = Fully Working
Configuration for Claude Desktop
Edit your claude_desktop_config.json file:
Format 1: Local MCP Server ⭐ Recommended
Important: Replace /absolute/path/to/mcp_excalidraw with your actual installation path.
Format 2: Docker MCP Server ✅ Fully Working
Using Pre-built Image from GHCR (Recommended):
OR Build Locally:
Then use mcp-excalidraw as the image name in the configuration above.
Configuration for Claude Code
Create or edit .mcp.json in your project root:
Format 1: Local MCP Server ⭐ Recommended
Important: Replace /absolute/path/to/mcp_excalidraw with your actual installation path.
Format 2: Docker MCP Server ✅ Fully Working
Using Pre-built Image from GHCR (Recommended):
OR Build Locally:
Then use mcp-excalidraw as the image name in the configuration above.
Alternative: Using Claude CLI
Configuration for Cursor IDE
Edit .cursor/mcp.json:
Format 1: Local MCP Server ⭐ Recommended
Format 2: Docker MCP Server ✅ Fully Working
Using Pre-built Image from GHCR (Recommended):
OR Build Locally:
Then use mcp-excalidraw as the image name in the configuration above.
Important Configuration Notes
Setting | Purpose | Required |
| Canvas server URL | Yes (default: http://localhost:3000) |
| Enable real-time canvas sync | Yes (set to "true") |
| Docker access to localhost | Required for Docker |
| Interactive stdin/stdout | Required for Docker |
Canvas is optional: The MCP server works without the canvas in API-only mode (for programmatic access only).
🛠️ Environment Variables
Variable | Default | Description |
|
| Canvas server URL for MCP sync |
|
| Enable/disable canvas synchronization |
|
| Path to the log file |
|
| Enable debug logging |
|
| Canvas server port |
|
| Canvas server host |
📊 API Endpoints
The canvas server provides these REST endpoints:
Method | Endpoint | Description |
|
| Get all elements |
|
| Create new element |
|
| Update element |
|
| Delete element |
|
| Create multiple elements |
|
| Server health check |
🎨 MCP Tools Available
Element Management
create_element- Create any type of Excalidraw elementupdate_element- Modify existing elementsdelete_element- Remove elementsquery_elements- Search elements with filters
Batch Operations
batch_create_elements- Create complex diagrams in one call
Element Organization
group_elements- Group multiple elementsungroup_elements- Ungroup element groupsalign_elements- Align elements (left, center, right, top, middle, bottom)distribute_elements- Distribute elements evenlylock_elements/unlock_elements- Lock/unlock elements
Resource Access
get_resource- Access scene, library, theme, or elements data
🏗️ Development Architecture
Frontend (frontend/src/)
React + TypeScript: Modern TSX components with full type safety
Vite Build System: Fast development and optimized production builds
Official Excalidraw:
@excalidraw/excalidrawpackage with TypeScript typesWebSocket Client: Type-safe real-time element synchronization
Clean UI: Production-ready interface with proper TypeScript typing
Canvas Server (src/server.ts → dist/server.js)
TypeScript + Express.js: Fully typed REST API + static file serving
WebSocket: Type-safe real-time client communication
Element Storage: In-memory with comprehensive type definitions
CORS: Cross-origin support with proper typing
MCP Server (src/index.ts → dist/index.js)
TypeScript MCP Protocol: Type-safe Model Context Protocol implementation
Canvas Sync: Strongly typed HTTP requests to canvas server
Element Management: Full CRUD operations with comprehensive type checking
Batch Support: Type-safe complex diagram creation
Type System (src/types.ts)
Excalidraw Element Types: Complete type definitions for all element types
API Response Types: Strongly typed REST API interfaces
WebSocket Message Types: Type-safe real-time communication
Server Element Types: Enhanced element types with metadata
🐛 Troubleshooting
Canvas Not Loading
Ensure
npm run buildcompleted successfullyCheck that
dist/index.htmlanddist/frontend/directory existVerify canvas server is running on port 3000
Check if port 3000 is already in use:
lsof -i :3000(macOS/Linux) ornetstat -ano | findstr :3000(Windows)
Elements Not Syncing
Confirm canvas server is running and accessible at http://localhost:3000
Check
ENABLE_CANVAS_SYNC=truein MCP server environment configurationVerify
EXPRESS_SERVER_URLpoints to correct canvas server URLCheck browser console for WebSocket connection errors
For Docker: Ensure
--network hostflag is used
WebSocket Connection Issues
Check browser console for WebSocket errors (F12 → Console tab)
Ensure no firewall blocking WebSocket connections on port 3000
Try refreshing the browser page
Verify canvas server is running:
curl http://localhost:3000/health
Docker Issues
Canvas Container:
Check if container is running:
docker ps | grep canvasView logs:
docker logs mcp-excalidraw-canvasEnsure port 3000 is not already in use
MCP Container:
For Docker MCP server, ensure
--network hostis used (required to access localhost:3000)Verify
-iflag is present (required for MCP stdin/stdout protocol)Check environment variables are properly set
Build Errors
Delete
node_modulesanddist/directories, then runnpm install && npm run buildCheck Node.js version (requires 16+):
node --versionRun
npm run type-checkto identify TypeScript issuesVerify
dist/directory contains bothindex.js,server.js, andfrontend/after build
NPM Package Issues
Status: NPM package is under development
Recommendation: Use local or Docker installation methods for production use
📋 Project Structure
🔮 Development Roadmap
✅ TypeScript Migration: Complete type safety for enhanced development experience
✅ Docker Deployment: Both Canvas and MCP server fully working in Docker
🔧 NPM Package: Resolving MCP tool registration issues
🎯 Enhanced Features: Additional MCP tools and capabilities
🎯 Performance Optimization: Real-time sync improvements
🎯 Advanced TypeScript Features: Stricter type checking and advanced type utilities
🎯 Container Registry: Publishing to GitHub Container Registry (GHCR)
🤝 Contributing
We welcome contributions! If you're experiencing issues with the NPM package or Docker version, please:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
Excalidraw Team - For the amazing drawing library
MCP Community - For the Model Context Protocol specification