The model now writes a shape as one self-closing mxCell with x, y, w and h and an edge as one with source and target; compact-cells.ts fills in vertex, edge, parent="1" and the mxGeometry element after validation. The long form stays accepted, so waypoints, edge labels and anything else keep their mxGeometry. The diagram shown to the model (the system context, the edit error texts and the MCP get_diagram result) is folded into the same notation, so the model reads what it is asked to write; the canvas and the saved file stay standard draw.io XML. Folding then expanding the 652 valid production diagrams gives the same cells back for every one of them. The auto-fix gains one step for the slip this notation invites: a missing closing quote before the self-closing slash (h="112/>). Prompts and the shared examples use the compact form; the single waypoint example keeps the long form on purpose. Measured on the five start-screen examples, same prompt, against the named-styles build: gpt-6-luna 19% fewer output tokens, Opus 5.5 26% fewer (35% and 41% against main). Every shape was written compactly on the first try; edits used it too and all applied.
Next AI Draw.io
Draw and edit draw.io diagrams by chatting with an AI.
https://github.com/user-attachments/assets/66b9f12f-219f-4d62-acc0-0725e6850eec
Describe a diagram in a sentence and the AI draws it on a real draw.io canvas. Edit it by hand like any draw.io file, or select a few shapes and tell the AI what to change. Every AI change is a version you can compare, restore or undo, and the result exports as .drawio, .png or .svg.
Available as a web app, a desktop app for Windows, macOS and Linux, and an MCP server for AI agents such as Claude Code, Cursor and VS Code.
Highlights
Draw
- Architecture diagrams, flowcharts, sequence diagrams and more from one sentence, with built-in AWS, Azure, GCP and Kubernetes icon libraries
- Connectors can carry a flowing animation
- Upload a screenshot or a sketch and the AI redraws it; upload PDF, Markdown, code and other text files and get a diagram of their content
Edit
- Edit by chat: changes stream onto the canvas and the shapes the AI just changed are highlighted
- Ask about a selection: select shapes on the canvas and the AI changes only those
- Versions and undo: every AI change is a version card with a thumbnail; compare it with the canvas, restore it or undo it, and Ctrl+Z on the canvas also takes back an AI change in one step
- It is a normal draw.io diagram: double-click to rename, drag, restyle, use several pages, and export as
.drawio,.png,.svgor.drawio.svgat any time
Use
- 24 model providers; enter your own API key in the browser and it stays on your machine
- Models that reason show their thinking
- Dark mode; the interface is available in English, Simplified Chinese, Traditional Chinese and Japanese
Examples
Use it
Online demo
Open next-ai-drawio.jiang.jp, nothing to install. The demo has a usage limit; click the settings icon in the chat panel and enter your own provider and API key to lift it. The key stays in your browser and is never sent to the server for storage.
Desktop app
Download the Windows, macOS or Linux installer from the Releases page.
In your AI agent (MCP)
Through MCP (Model Context Protocol, the protocol AI agents use to call outside tools), Claude Desktop, Cursor, VS Code and others can draw draw.io diagrams directly. Add this to your client's MCP configuration:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
For Claude Code, one command does it:
claude mcp add drawio -- npx @next-ai-drawio/mcp-server@latest
Then ask the AI for "a flowchart of user authentication with login, MFA and session management" and the diagram appears in your browser as it is drawn. The MCP server has most of the web app's drawing features:
- The same drawing rules and icon libraries (AWS, Azure, GCP, Kubernetes and more)
- A screenshot tool, so the AI can look at the rendered diagram and fix it
- Version history, multi-page diagrams, and download as
.drawio,.png,.svgor.drawio.svg - Auto-save to
~/.next-ai-drawio/, so a diagram survives a restart
See the MCP server README for VS Code, Cursor and other client configurations.
Self-host
Run locally
git clone https://github.com/DayuanJiang/next-ai-draw-io
cd next-ai-draw-io
npm install
cp env.example .env.local # add your provider and API key, see "Models and providers" below
npm run dev
Open http://localhost:6002.
One-click deploy
| Platform | How |
|---|---|
| Tencent EdgeOne Pages | |
| Vercel | .env.local |
| Cloudflare Workers | Cloudflare deploy guide |
| Docker | Docker guide |
| Offline or intranet | Offline deployment |
Models and providers
24 providers are supported: AWS Bedrock (default), OpenAI, Anthropic, Google AI, Google Vertex AI, Azure OpenAI, Ollama, OpenRouter, AIHubMix, DeepSeek, SiliconFlow, SGLang, Vercel AI Gateway, Tencent EdgeOne, ByteDance Doubao, ModelScope, Zhipu GLM, Qwen, Qiniu, Kimi, MiniMax, Novita, Xiaomi MiMo and Atlas Cloud. The environment variables and notes for each are in the provider configuration guide.
Which model: the task is to produce long text in a strict format (draw.io XML), so pick a capable model; small models tend to produce broken diagrams.
Several models and the admin panel: list several model IDs in AI_MODEL separated by commas, or configure models from several providers with the AI_MODELS_CONFIG environment variable or an ai-models.json file, and every user can use them without a key of their own. Set ADMIN_PASSWORD and open /admin to manage models, access codes, feature switches, observability and quotas from a web page; see the admin panel guide.
Support
- Questions and ideas: open a GitHub issue or email me[at]jiang.jp
- Common problems: FAQ
- If the project is useful to you, consider sponsoring to help keep the demo site running