Next AI Draw.io

A draw.io MCP server for Claude Code, Cursor, Codex and VS Code

Your AI agent reads your project's files and draws the diagram on a live draw.io canvas in your browser. Edit it by hand at any time: the agent reads your changes before it edits again.

$ claude mcp add --scope user drawio -- npx @next-ai-drawio/mcp-server@latest

Install

$ claude mcp add --scope user drawio -- npx @next-ai-drawio/mcp-server@latest

--scope user makes the tools available in every project. Without it, they exist only in the folder where you ran the command.

Or install it as a plugin from the Claude Code community marketplace (Claude Code 2.1.275 or later):

/plugin install next-ai-drawio --marketplace anthropics/claude-plugins-community

Restart the client, then ask, for example, "Read this repo and draw its architecture". The preview opens in your browser and the diagram appears as it is drawn.

What it does

Draws from your project

The agent reads your code and documents with its own tools. Existing .drawio and .drawio.svg files open too.

Every change is a version

The AI's changes are outlined for a few seconds and one Ctrl+Z takes them back. The last 20 versions sit next to the canvas to restore or compare.

You and the AI share the canvas

Edit by hand at any time, or select shapes and say "these". The AI reads your edits before it edits again.

Real icons

The web app's drawing rules and shape libraries for AWS, Azure, GCP, Kubernetes, Cisco and more, so the AI uses real icon names.

Checks its own work

The AI can look at a screenshot of the rendered diagram and fix overlapping shapes.

Export, offline and saved

Save .drawio, .png, .svg or .drawio.svg. The draw.io editor ships inside the package and works offline, and every diagram is saved for a later conversation.

Why Next AI Draw.io is better than draw.io's official MCP server

If you keep changing a diagram after the AI has drawn it, use Next AI Draw.io. You and the AI share one canvas, so the AI sees what you select and what you change.

What you dodraw.io's official MCP server and pluginNext AI Draw.io
Select two shapes and say "make these two red"draw.io's official MCP server and pluginThe AI does not know which twoNext AI Draw.ioThe AI changes those two
Change the diagram by handdraw.io's official MCP server and pluginThe AI sees it only after you save it to a fileNext AI Draw.ioThe AI reads the canvas before it edits
Want to know what the AI changeddraw.io's official MCP server and pluginNothing on the diagram shows itNext AI Draw.ioThe change is outlined
Want to take the AI's change backdraw.io's official MCP server and pluginAsk the AI to change it againNext AI Draw.ioPress Ctrl+Z
Want to watch the AI drawdraw.io's official MCP server and pluginIt opens when it is doneNext AI Draw.ioYou watch it being drawn

Tools

ToolWhat it does
start_sessionOpen the preview and return the drawing guide; session_id continues a saved diagram
create_new_diagramDraw a new diagram from mxCell XML
edit_diagramAdd, update or delete cells by id, all or nothing
get_diagramThe current XML, including your edits in the browser
get_selectionThe shapes you selected in the preview
screenshot_diagramA PNG of a page, for the AI to check
load_diagramexport_diagramOpen a .drawio or .drawio.svg file; save .drawio, .png, .svg or .drawio.svg
restore_versionGo back to an earlier version; a redo stays possible
list_saved_diagramsDiagrams saved by earlier sessions, newest first
get_drawing_guideget_shape_libraryThe drawing rules again; the icon styles of a library such as aws4
list_pagesadd_pagerename_pagedelete_pagePages (tabs)

Configuration and troubleshooting

Environment variables, your own drawing rules, a self-hosted draw.io and fixes for common problems are in the docs and the README.