diagram-tool
Renders diagram scenes as editable Excalidraw canvases in a live localhost UI, with autosave and support for Excalidraw library assets and decorations.
Validates Mermaid diagram source and converts it into Excalidraw scenes, enabling agents to draw diagrams from Mermaid syntax.
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., "@diagram-tooldraw a sequence diagram showing how a user logs in"
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.
Diagram Tool — agent-drawn Excalidraw on localhost, synced via a context file
No API key needed. Your coding agent is the LLM — diagram-tool only validates Mermaid, renders the scene, and serves the live UI.
Recommended: MCP server (any coding agent)
OpenCode (opencode.json) — note the format differs from other agents:
{ "mcp": { "diagram-tool": {
"type": "local",
"command": ["npx", "-y", "diagram-tool", "mcp"],
"enabled": true
} } }Claude Code / Cursor / Windsurf / VSCode (generic shape):
{ "mcpServers": { "diagram-tool": { "command": "npx", "args": ["-y", "diagram-tool", "mcp"] } } }Or auto-write it:
npm i -g diagram-tool # or npx -y diagram-tool mcp (no install)
diagram-tool mcp-install --agent auto # auto|opencode|claude|cursor|vscodeThen ask your agent to draw something, open the returned url once — it live-updates on every render.
Tools: render_diagram(mermaidSource, prompt?, decorations?) · get_diagram() · list_libraries(query?) · list_library_items(library) · resource diagram-tool://guide. Full authoring doc: GUIDE.md (also served to agents via the guide resource, so no LLM setup is needed).
Related MCP server: Excalidraw MCP App Server
Example: agent-drawn S3 system design
Prompt: crete a system design diagram for amason S3 filesystem (typos and all — the agent copes).
The agent discovers icons first, then renders — MCP calls, verbatim:

Result summary with the live link (rev 1, 71 elements, sidecars written):

And the whiteboard itself — icons merged into their nodes, arrows on dagre's own routing:

The context file (source of truth)
Everything revolves around diagram-tool.context.json:
{ "version": 1, "rev": 3, "prompt": "...", "mermaidSource": "...",
"scene": { "type": "excalidraw", "version": 2, "elements": [...] } }MCP/CLI writes it on every render (bumps
rev, writes.excalidraw.json+.mmdsidecars).UI autosaves canvas edits back to it (
POST /api/scene, debounced; on a rev conflict your edits are merged onto the fresh rev and retried, not discarded).UI subscribes to SSE
GET /api/live(Hono server watches the file) and refetches on rev bumps, so agent edits appear in the open canvas without reload.
Shell fallback (no MCP)
diagram-tool render --no-serve # re-derive scene from the context file's mermaidSource
diagram-tool serve # just the UI (default http://localhost:3000)Agent loop without MCP: edit mermaidSource in the context file, run diagram-tool render --no-serve. Structural changes belong in mermaidSource + render; small canvas nudges can go straight into scene.elements.
Libraries (excalidraw-libs)
libraries/*.excalidrawlib (v1 + v2) are served at GET /api/libraries for hand drag-drop, and composited server-side via decorations for agent renders. 6 payloads ship offline (network-topology, dev-ops, systemdesignicons, UML-ER, awesome-icons, system-icons); the full 232-library catalog is searchable via list_libraries (generated metadata with real item counts, refreshable via node scripts/build-catalog.mjs) and fetched on demand into ~/.cache/diagram-tool/libraries/.
diagram-tool library list— downloaded files + item countdiagram-tool library add <name>— download from libraries.excalidraw.com (e.g.diagram-tool library add aws)Node icon classes also work:
class USER actor,icon_user(slugs:icon_user,icon_users,icon_home,icon_lock,icon_search,icon_chart,icon_email,icon_calendar,icon_location,icon_payment)
Rule of thumb: cloud/architecture/network diagrams get ≤6 icons; logic flowcharts and sequence/ER/class diagrams stay pure mermaid. Agents follow this automatically — a mandatory library rule in the MCP instructions forces icon lookup (e.g. the 24 named AWS Serverless v2 icons) whenever cloud services are mentioned.
The viewer ships Excalidraw's real canvas fonts (Virgil, Cascadia, …) with the bundle, so labels render exactly as measured — no fallback-font overflow. (Only the 13MB CJK set is excluded; CJK falls back to system fonts.)
BYOK fallback (optional, needs a key)
cp .env.example .env # OPENROUTER_API_KEY=sk-or-...
diagram-tool "draw the request lifecycle of a REST API" --provider openrouter
diagram-tool edit "add a retry step" --provider openrouterFlags: --provider openai|anthropic|google|ollama|openrouter, --model, --api-key, --base-url, --port, --no-serve, --context.
Pipeline: strict Mermaid parse → mermaid-to-excalidraw (dagre layout ships as-is — no post-passes) → flowchart-only arrow dedupe → icon replacement (scale-to-fit in the SDK box, opt-in allowGrow on proven slack) → arrow-label detach. The viewer ships Excalidraw's real canvas fonts, so what the agent lays out is what you see.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Create and edit architecture diagrams from your AI agent; get an SVG and a live editable canvas.
Create, read and live-edit visual boards, Kanban plans, Gantt timelines and diagrams with AI agents.
Whiteboard where any shape opens into another canvas. Your AI agent draws on it live.
Create, validate, edit, export (markdown/svg/png/mermaid), and search JSON Canvas files.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables 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.112,783100MIT
- FlicenseNot gradedqualityDmaintenanceEnables users to create and interact with hand-drawn sketches and architecture diagrams directly within chat interfaces using Excalidraw. It leverages the Model Context Protocol to provide interactive HTML visualizations with smooth viewport control and fullscreen editing capabilities.-
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to programmatically control a live Excalidraw canvas through element-level CRUD operations and real-time synchronization. It allows agents to iteratively build, inspect, and refine diagrams while providing visual feedback via screenshots and scene descriptions.3,073MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to programmatically control a live Excalidraw canvas with element-level CRUD operations and real-time synchronization. It supports iterative diagramming through scene descriptions, screenshots, and advanced layout tools for collaborative AI-human workflows.3,0732MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/IntegerAlex/excali-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server