excalidraw-mcp

excalidraw-mcp

Enables AI agents to build, edit, organize, and export Excalidraw diagrams (architecture, flowcharts, etc.) entirely headless, producing .excalidraw files, SVG, and PNG renders.

Category
Visit Server

README

excalidraw-mcp

An MCP (Model Context Protocol) server for Excalidraw. It lets an AI agent build, edit, organize, and export Excalidraw scenes — architecture diagrams, flowcharts, codebase maps, whiteboards — entirely headless, producing .excalidraw files you can open at excalidraw.com, plus SVG/PNG renders in Excalidraw's hand-drawn style.

<p align="center"><img src="examples/flowchart.png" width="420" alt="Flowchart generated by the smoke test" /></p>

Features

  • Every element type: rectangles, ellipses, diamonds, text, lines, arrows, freedraw strokes, frames, embedded images, and embeddables (iframes)
  • Real Excalidraw semantics: bound labels (text inside shapes / on arrows), arrow ↔ shape bindings that survive dragging in the UI, groups, frames, z-order, lock state, fractional indices
  • One-shot diagrams: create_flowchart lays out labeled nodes and bound edges automatically (layered layout, down or right)
  • Full editing surface: update, move, resize, duplicate (with binding remap), align, distribute, group, reorder, query
  • Overlap-free by default: creation tools nudge new elements to free space (avoidOverlap: false to layer intentionally), resolve_overlaps spreads out colliding elements, and bound arrows re-route automatically after moves
  • Persistence & export: .excalidraw files (v2), .excalidrawlib libraries, SVG and PNG rendering (roughjs + perfect-freehand, so it looks like Excalidraw)
  • All three MCP primitives: 42 tools, resources (excalidraw://scenes, excalidraw://scene/{id}, excalidraw://scene/{id}/svg), and prompts (architecture-diagram, flowchart, annotate-scene)

Setup

npm install
npm run build

Claude Code

claude mcp add excalidraw -- node /path/to/excalidraw-mcp/dist/index.js

(This repo also ships a project-scoped .mcp.json, so opening the repo in Claude Code registers the server automatically.)

Claude Desktop

// claude_desktop_config.json
{
  "mcpServers": {
    "excalidraw": {
      "command": "node",
      "args": ["/path/to/excalidraw-mcp/dist/index.js"]
    }
  }
}

Tools

Group Tools
Scenes create_scene list_scenes switch_scene get_scene describe_scene clear_scene delete_scene set_app_state save_scene load_scene unlock_all
Create add_shape add_text add_line add_arrow add_freedraw add_frame add_image add_embed add_elements
Edit get_element find_elements update_element delete_elements duplicate_elements move_elements resize_element
Organize connect_elements add_label group_elements ungroup_elements align_elements distribute_elements resolve_overlaps reorder_elements lock_elements add_to_frame
Export export_svg export_png export_library import_library
Diagrams create_flowchart

Typical flow:

  1. create_scene
  2. add_shape / add_text / create_flowchart, then connect_elements to wire things up
  3. describe_scene to verify
  4. save_scene → open the .excalidraw file at excalidraw.com, and/or export_svg / export_png for a preview

Example — the whole auth flowchart above is one call:

{
  "name": "create_flowchart",
  "arguments": {
    "nodes": [
      { "id": "start", "label": "Request", "shape": "ellipse", "backgroundColor": "#b2f2bb" },
      { "id": "auth", "label": "Authenticated?", "shape": "diamond", "backgroundColor": "#ffec99" },
      { "id": "handler", "label": "Route handler" },
      { "id": "reject", "label": "401 Unauthorized", "backgroundColor": "#ffc9c9" },
      { "id": "db", "label": "Database" }
    ],
    "edges": [
      { "from": "start", "to": "auth" },
      { "from": "auth", "to": "handler", "label": "yes" },
      { "from": "auth", "to": "reject", "label": "no", "strokeStyle": "dashed" },
      { "from": "handler", "to": "db", "label": "query" }
    ]
  }
}

Notes

  • Coordinates: y grows downward; shapes are positioned by their top-left corner.
  • PNG export uses the optional @resvg/resvg-js dependency; SVG export has no native dependencies.
  • Text sizing is estimated headlessly (~0.6em per character); Excalidraw re-measures precisely when a file is opened.

Development

npm run build   # compile TypeScript
npm test        # end-to-end smoke test (spawns the server with a real MCP client)

The smoke test writes example output (demo.excalidraw, flowchart.excalidraw, SVG/PNG renders, a .excalidrawlib) into examples/.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured