Excalidraw MCP Server

Excalidraw MCP Server

Scofieldfree

Lets AI assistants create, edit, and view Excalidraw diagrams with real-time browser synchronization. Supports natural language diagram creation with automatic layout and Mermaid syntax conversion.

Enables AI agents to programmatically generate, edit, and view Excalidraw diagrams with real-time browser synchronization. It provides a suite of tools for adding shapes, text, and arrows to diagrams through natural language interactions.

79692 views4Local (stdio)

What it does

  • Create and edit Excalidraw diagrams through conversation
  • Add shapes, text, arrows, and elements to diagrams
  • Convert Mermaid syntax to Excalidraw diagrams
  • Preview diagrams in real-time in browser
  • Manage multiple diagram sessions
  • Export diagrams to PNG, SVG, or JSON

Best for

AI-powered visual thinking and brainstormingCreating architecture diagrams through conversationConverting text descriptions to visual diagramsCollaborative diagram editing with AI assistance
Real-time browser synchronizationMermaid syntax supportMulti-session support

About Excalidraw MCP Server

Excalidraw MCP Server is a community-built MCP server published by Scofieldfree that provides AI assistants with tools and capabilities via the Model Context Protocol. Excalidraw MCP Server: let AI agents generate, edit, and view Excalidraw diagrams via natural-language commands with rea It is categorized under developer tools, design. This server exposes 11 tools that AI clients can invoke during conversations and coding sessions.

How to install

You can install Excalidraw MCP Server in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Excalidraw MCP Server is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (11)

start_session

Start browser preview and open Excalidraw editor interface. Multi-session support: - No sessionId: Uses default session (default) - sessionId specified: Open/Create specific session - Multiple sessions can be opened simultaneously for different diagrams After calling this tool: 1. Browser window opens automatically 2. Excalidraw editor loads 3. WebSocket realtime connection is established Please pass the same sessionId when using tools like add_elements, update_element subsequently.

list_sessions

List all currently active Excalidraw sessions.

create_diagram

Create a new diagram or clear an existing session. This action will: 1. If a sessionId is specified, clear all elements in that session. 2. If no sessionId is specified, create a new session. 3. Reset the application state. Usage scenarios: • Starting a new project (no sessionId specified) • Clearing an existing diagram (sessionId specified) • Creating multiple independent diagrams (specify different sessionIds each time)

delete_diagram

Delete the specified diagram session. Note: This will completely delete the session and all its elements, and cannot be undone. If you only want to clear elements but keep the session, use create_diagram and specify the sessionId.

add_elements

Add multiple Excalidraw elements to the canvas. Supported element types: - rectangle - ellipse - diamond - arrow - text - line - freedraw - image - frame/magicframe - iframe/embeddable Style options: - strokeColor: e.g. #1e1e1e - backgroundColor: e.g. #D97706 - fillStyle: solid/hachure/cross-hatch - strokeWidth: 1-4 - roughness: 0=architect, 1=artist, 2=cartoonist Advanced options: - label: Auto-create bound text inside shape/arrow containers - start/end: Arrow endpoint binding to new or existing elements - containerId: DEPRECATED (use label instead) Multi-session support: Specify sessionId to target a specific session.

Excalidraw MCP Server

npm version License: MIT

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.

Excalidraw MCP Demo

✨ Features

FeatureDescription
🎨 Real-time PreviewChanges appear instantly in a local browser window via WebSocket
📐 Smart LayoutAutomatically calculates text width and binds labels to containers
🔄 Multi-SessionSwitch between different diagrams seamlessly
🧜 Mermaid SupportConvert Mermaid syntax to Excalidraw diagrams instantly
📦 Export OptionsExport to PNG, SVG, or JSON formats
🏗️ TemplatesBuilt-in architecture diagram templates

🚀 Quick Start

You don't need to clone this repo. Just configure your MCP client:

Claude Code (cc)

claude mcp add excalidraw -- npx -y @scofieldfree/excalidraw-mcp

Codex CLI

codex mcp add excalidraw -- npx -y @scofieldfree/excalidraw-mcp

Cursor / Windsurf

Go to Settings > MCPAdd New MCP Server:

FieldValue
Nameexcalidraw
Typecommand
Commandnpx -y @scofieldfree/excalidraw-mcp

Cline (VS Code Extension)

Open Cline settings and add to MCP Servers:

{
  "mcpServers": {
    "excalidraw": {
      "command": "npx",
      "args": ["-y", "@scofieldfree/excalidraw-mcp"]
    }
  }
}

GitHub Copilot

Use the Copilot CLI to interactively add:

/mcp add

Alternatively, create or edit ~/.copilot/mcp-config.json:

{
  "mcpServers": {
    "excalidraw": {
      "type": "local",
      "command": "npx",
      "tools": ["*"],
      "args": ["-y", "@scofieldfree/excalidraw-mcp"]
    }
  }
}

Kiro

Follow the MCP Servers documentation. Add to .kiro/settings/mcp.json:

{
  "mcpServers": {
    "excalidraw": {
      "command": "npx",
      "args": ["-y", "@scofieldfree/excalidraw-mcp"]
    }
  }
}

opencode

opencode mcp add excalidraw -- npx -y @scofieldfree/excalidraw-mcp

VS Code

One-click install:

Install in VS Code Install in VS Code Insiders

Or install via CLI:

# For VS Code
code --add-mcp '{"name":"excalidraw","command":"npx","args":["-y","@scofieldfree/excalidraw-mcp"]}'

# For VS Code Insiders
code-insiders --add-mcp '{"name":"excalidraw","command":"npx","args":["-y","@scofieldfree/excalidraw-mcp"]}'

Claude Desktop

Add to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "excalidraw": {
      "command": "npx",
      "args": ["-y", "@scofieldfree/excalidraw-mcp"]
    }
  }
}

🛠️ Available Tools

ToolDescription
start_sessionStart browser preview and open Excalidraw editor
add_elementsAdd shapes, text, arrows to the canvas
update_elementModify existing element properties
delete_elementRemove elements from canvas
get_sceneRetrieve current diagram state
create_from_mermaidConvert Mermaid syntax to Excalidraw
add_template_architectureAdd a pre-built architecture diagram template
create_diagramCreate a new diagram or clear existing
export_diagramExport diagram to PNG, SVG, or JSON
list_sessionsList all active diagram sessions
delete_diagramDelete a diagram session

💬 Usage Examples

Example 1: Create a Simple Diagram

You say:

"Draw a flowchart with three boxes: Input → Process → Output"

AI uses:

start_session → add_elements (3 rectangles + 2 arrows)

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:

start_session → create_from_mermaid

Example 3: Architecture Diagram

You say:

"Create an architecture diagram for a microservices system"

AI uses:

start_session → add_template_architecture (or) add_elements with custom layout

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│                     AI Agent (Claude/Cursor)                │
└─────────────────────────┬───────────────────────────────────┘
                          │ MCP Protocol (JSON-RPC over stdio)
                          ▼
┌─────────────────────────────────────────────────────────────┐
│                   Excalidraw MCP Server                     │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │ Tool Router │──│ State Store │──│ WebSocket Broadcast │  │
│  └─────────────┘  └─────────────┘  └──────────┬──────────┘  │
└────────────────────────────────────────────────┼────────────┘
                                                 │ WebSocket
                                                 ▼
                          ┌───────────────────────────────────┐
                          │     Browser (Excalidraw Editor)   │
                          └───────────────────────────────────┘

🔧 Development

Prerequisites

  • Node.js >= 18
  • pnpm >= 9

Setup

# Clone the repository
git clone https://github.com/Scofieldfree/excalidraw-mcp.git
cd excalidraw-mcp

# Install dependencies
pnpm install

# Start development server
pnpm dev

Scripts

CommandDescription
pnpm devStart dev server (backend + frontend)
pnpm buildBuild for production
pnpm typecheckRun TypeScript type checking
pnpm lintRun ESLint
pnpm releaseCreate a new release version

📦 Project Structure

excalidraw-mcp/
├── packages/
│   └── mcp-server/          # Core MCP server + Excalidraw frontend
│       ├── src/
│       │   ├── index.ts     # Entry point
│       │   ├── state.ts     # Session state management
│       │   ├── http-server.ts
│       │   └── tools/       # MCP tool implementations
│       └── web/             # Excalidraw React frontend
├── docs/                    # Documentation
└── package.json             # Workspace configuration

🐛 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📜 License

MIT © Scofieldfree


🔗 Links

Alternatives

Related Skills

Browse all skills
ui-design-system

UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.

18
cli-developer

Use when building CLI tools, implementing argument parsing, or adding interactive prompts. Invoke for CLI design, argument parsing, interactive prompts, progress indicators, shell completions.

1
mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

103
supabase-developer

Build full-stack applications with Supabase (PostgreSQL, Auth, Storage, Real-time, Edge Functions). Use when implementing authentication, database design with RLS, file storage, real-time features, or serverless functions.

87
excalidraw-architect

Create diagrams, flowcharts, and architecture visualizations using Excalidraw. Use when user requests "create diagram", "draw flowchart", "architecture diagram", or mentions Excalidraw, visualization, system design.

57
api-design-principles

Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.

55