by quangliz
Control Excalidraw drawings from AI agents via a local MCP bridge with layout checks and image export.
Excalidraw MCP
Let AI assistants create, edit, align, layout-check, and visually inspect your Excalidraw drawings right inside Obsidian via the Model Context Protocol (MCP).
Desktop only. Requires the Excalidraw community plugin to be installed and enabled.
What you can do
- Draw and edit diagrams — create or update shapes, text labels, frames, lines, arrows, and Mermaid diagrams directly on your open Excalidraw board.
- Automatic layout checks — every edit checks for overlapping shapes, text overflowing its container, arrows cutting across unrelated boxes, and disconnected arrows.
- Visual verification — export the whole board or specific elements as PNG/SVG so vision-capable AI assistants can inspect the rendered diagram, or save images straight into your vault for Markdown embeds.
- Arrange and clean up — align, evenly distribute, restack z-order, pan/zoom the viewport, and search elements by text, type, frame, or group.
Quick start
- Install and enable the Excalidraw community plugin in Obsidian.
- Install and enable Excalidraw MCP from Settings → Community plugins.
- Open any
.excalidraw.md(or.excalidraw) drawing in Obsidian. - Connect your AI client:
Using with Antidian (zero setup)
If you use Antidian, this plugin is detected automatically over local HTTP (http://127.0.0.1:27129/mcp).
Open Settings → Antidian → MCP servers to see Excalidraw MCP listed and toggle it on or off—no extra files or Node.js installation required.
Using with any HTTP MCP client
Point your MCP client to the local Streamable HTTP endpoint:
http://127.0.0.1:27129/mcp
If you set a Bearer auth token in Settings → Excalidraw MCP, include the header:
Authorization: Bearer <your-token>
Using with stdio MCP clients (Claude Desktop, Antigravity CLI, etc.)
If your client only supports stdio MCP servers, download mcp-server.js from the GitHub Releases page (requires Node.js 18+) and add:
{
"mcpServers": {
"excalidraw": {
"command": "node",
"args": ["/path/to/mcp-server.js"],
"env": {
"OBSIDIAN_EXCALIDRAW_MCP_PORT": "27129",
"OBSIDIAN_EXCALIDRAW_MCP_TOKEN": "your-optional-bearer-token"
}
}
}
}
Available tools
| Category | Tools |
|---|---|
| Inspect | get_scene_info, get_elements, search_elements, get_selected_elements, set_view |
| Draw & Edit | create_elements, update_elements, delete_elements, connect_elements, add_mermaid |
| Arrange | align_elements, restack_elements, clear_scene |
| Verify & Export | check_layout, export_image (PNG image block or SVG, optional saveToVaultPath) |
Settings & security
Open Settings → Excalidraw MCP to configure:
- Bridge status — start, stop, or restart the local server (also available via the status bar or Command Palette:
Toggle bridge,Restart bridge). - Bridge port — localhost port (default
27129). - Bearer auth token — optional shared secret for authenticating MCP requests.
- Default target view — target the active Excalidraw view or the first open view when
filePathis omitted. - Auto-start bridge — start automatically when Obsidian opens.
Security notes:
- The bridge binds strictly to
127.0.0.1(local machine only, never exposed to your network). - No arbitrary JavaScript evaluation endpoint is exposed.
clear_scenerequires explicitconfirm: true, andsaveToVaultPathonly accepts safe vault-relative paths.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.