Enables AI agents to programmatically generate, edit, and view Excalidraw diagrams, featuring tools for adding shapes, text, and arrows with real-time preview and bi-directional synchronization.
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 how a user logs into our app"
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
An MCP (Model Context Protocol) server that empowers AI agents (like Claude, Cursor, Windsurf) to create, edit, and manage Excalidraw diagrams directly within your conversation.
Why Excalidraw? Its hand-drawn aesthetic and JSON-based format are perfect for rapid, programmable diagramming. This server bridges standard MCP clients with a local Excalidraw instance, enabling AI-powered visual thinking.
β¨ Features
Feature | Description |
π¨ Real-time Preview | Changes appear instantly in a local browser window via WebSocket |
π Smart Layout | Automatically calculates text width and binds labels to containers |
π Multi-Session | Switch between different diagrams seamlessly |
π§ Mermaid Support | Convert Mermaid syntax to Excalidraw diagrams instantly |
π¦ Export Options | Export to PNG, SVG, or JSON formats |
ποΈ Templates | Built-in architecture diagram templates |
π Quick Start
You don't need to clone this repo. Just configure your MCP client:
Claude Code (cc)
Codex CLI
Cursor / Windsurf
Go to Settings > MCP β Add New MCP Server:
Field | Value |
Name |
|
Type |
|
Command |
|
Cline (VS Code Extension)
Open Cline settings and add to MCP Servers:
GitHub Copilot
Use the Copilot CLI to interactively add:
Alternatively, create or edit ~/.copilot/mcp-config.json:
Kiro
Follow the MCP Servers documentation. Add to .kiro/settings/mcp.json:
opencode
VS Code
One-click install:
Or install via CLI:
Claude Desktop
Add to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
π οΈ Available Tools
Tool | Description |
| Start browser preview and open Excalidraw editor |
| Add shapes, text, arrows to the canvas |
| Modify existing element properties |
| Remove elements from canvas |
| Retrieve current diagram state |
| Convert Mermaid syntax to Excalidraw |
| Add a pre-built architecture diagram template |
| Create a new diagram or clear existing |
| Export diagram to PNG, SVG, or JSON |
| List all active diagram sessions |
| Delete a diagram session |
π¬ Usage Examples
Example 1: Create a Simple Diagram
You say:
"Draw a flowchart with three boxes: Input β Process β Output"
AI uses:
Example 2: Convert Mermaid to Excalidraw
You say:
"Convert this Mermaid diagram to Excalidraw:
graph LR: A[User] --> B[API Gateway] --> C[Service] --> D[(Database)]"
AI uses:
Example 3: Architecture Diagram
You say:
"Create an architecture diagram for a microservices system"
AI uses:
ποΈ Architecture
π§ Development
Prerequisites
Node.js >= 18
pnpm >= 9
Setup
Scripts
Command | Description |
| Start dev server (backend + frontend) |
| Build for production |
| Run TypeScript type checking |
| Run ESLint |
| Create a new release version |
π¦ Project Structure
π Troubleshooting
Port Already in Use
The server automatically finds an available port starting from 3100. If you need a specific port, set the PORT environment variable.
Browser Doesn't Open
Ensure you have a default browser configured. The server uses the open package to launch the browser.
WebSocket Connection Failed
Check if any firewall or antivirus is blocking WebSocket connections on localhost.
π€ Contributing
Contributions are welcome! Please read our Contributing Guide for details.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'feat: add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
MIT Β© Scofieldfree