Next AI Draw.io

Design and media

Draw.io diagrams your AI agent draws on a live browser canvas that you can also edit by hand.

Your AI app calls the Next AI Draw.io MCP server, which does the design and media work and sends the result back to the chat.

About Next AI Draw.io

Next AI Draw.io is a community MCP server from DayuanJiang, filed in our directory under design and media. Draw.io diagrams your AI agent draws on a live browser canvas that you can also edit by hand.

Next AI Draw.io runs on your own machine: your AI app starts it with the command npx -y @next-ai-drawio/mcp-server@0.4.15 and talks to it over standard input and output.

Next AI Draw.io is listed in the official MCP registry as io.github.DayuanJiang/next-ai-drawio, version 0.4.15.

At a glance

Publisher
DayuanJiang (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @next-ai-drawio/mcp-server
Written in
TypeScript
License
Apache-2.0
GitHub stars
37,314
Official MCP registry
io.github.DayuanJiang/next-ai-drawio

How to set up Next AI Draw.io

  1. Install Node.js on the machine that runs your AI app, because Next AI Draw.io starts with npx and downloads its package on first run.
  2. Check the Next AI Draw.io README for keys or settings; the registry lists none that Next AI Draw.io requires.
  3. Add Next AI Draw.io to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Next AI Draw.io tools to confirm the connection.
  5. Run one read-only task with Next AI Draw.io first, and keep your app asking before each tool call until the results look right.

Next AI Draw.io compared with similar servers

  • MCP For Blender by ahujasid has fewer GitHub stars than Next AI Draw.io (36.8k against 37.3k); both are community servers, and both run locally.
  • HyperFrames by HeyGen by heygen-com has more GitHub stars than Next AI Draw.io (94.7k against 37.3k); HyperFrames by HeyGen is official while Next AI Draw.io is a community server, and HyperFrames by HeyGen runs as a remote server and Next AI Draw.io runs on your own machine.
  • Pascal 3D Editor by pascalorg has fewer GitHub stars than Next AI Draw.io (26k against 37.3k); both are community servers, and Pascal 3D Editor runs as a remote server and Next AI Draw.io runs on your own machine.

Before you connect Next AI Draw.io

  • Give Next AI Draw.io its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Next AI Draw.io tool call until you trust what it does with them.
  • Treat text that Next AI Draw.io fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Next AI Draw.io on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Next AI Draw.io

How marketing and sales teams put Next AI Draw.io to work, by company size. Pick the size closest to yours and start Next AI Draw.io on one use case.

Small business

  • A small business can use Next AI Draw.io to resize and adapt one design for every channel instead of hiring for each version.
  • Owners can ask Next AI Draw.io to pull brand assets and make quick ad and social variations that still look on brand.
  • Next AI Draw.io runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Creative teams can connect Next AI Draw.io so agents produce variants for testing while designers keep control of the master files.
  • Marketing teams can use Next AI Draw.io to hand off designs to web and ads with specs attached, cutting review rounds.
  • Start Next AI Draw.io on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can use Next AI Draw.io with brand rules and approved assets only, so generated work stays inside the brand system.
  • Large creative ops teams can use Next AI Draw.io to localize and version assets for many markets with review built in.
  • Next AI Draw.io is a community server, so have security review the code and pin a version before Next AI Draw.io touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Next AI Draw.io README

From DayuanJiang/next-ai-draw-io on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

Next AI Draw.io MCP Server

An MCP server that lets Claude Code, Cursor, VS Code and other AI agents draw draw.io diagrams from your project's files, with a live preview in your browser. The preview is the canvas of the Next AI Draw.io web app: the AI's changes are outlined, Ctrl+Z takes them back, and you can edit by hand at any time.

https://github.com/user-attachments/assets/6f53a67b-ab21-4113-9fee-7fb32f9de678

Install

In VS Code or Cursor, one click adds it:

Let your AI agent install it

Paste this into Claude Code, Codex, Cursor, VS Code, Cline or any agent that can edit files and run commands:

Install the drawio MCP server for the client you are running in, following
https://raw.githubusercontent.com/DayuanJiang/next-ai-draw-io/main/packages/mcp-server/README.md
Install it for all my projects (user scope, for Claude Code "--scope user"),
name the server "drawio" and keep the servers that are already configured.
Then tell me how to reload so its tools show up.
Install by hand

Claude Code

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

Codex CLI

codex mcp add drawio -- npx @next-ai-drawio/mcp-server@latest

Codex asks before each drawio tool that changes the diagram, and codex exec without full access fails with "MCP tool call requires approval". To let the drawio tools run without asking, add one line to the server's section in ~/.codex/config.toml:

[mcp_servers.drawio]
command = "npx"
args = ["@next-ai-drawio/mcp-server@latest"]
default_tools_approval_mode = "approve"

To approve only some tools, use [mcp_servers.drawio.tools.<tool name>] with approval_mode = "approve" instead.

VS Code (.vscode/mcp.json)

{
  "servers": {
    "drawio": { "type": "stdio", "command": "npx", "args": ["@next-ai-drawio/mcp-server@latest"] }
  }
}

DeepSeek Harness: install the plugin into the profile you start DSH with (web for dsh web). The agent replies with the preview link; clicking it opens the preview in DSH's right sidebar.

dsh plugin --profile web add @next-ai-drawio/dsh

Cursor, Claude Desktop, Cline and most other clients (~/.cursor/mcp.json, claude_desktop_config.json, cline_mcp_settings.json)

{
  "mcpServers": {
    "drawio": { "command": "npx", "args": ["@next-ai-drawio/mcp-server@latest"] }
  }
}

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.

Features

  • Draws from your project: the agent reads your code and documents with its own tools. Existing .drawio and .drawio.svg files open with load_diagram.
  • The web app's canvas: the AI's changes are outlined for a few seconds (never in exports) and one Ctrl+Z takes them back. Select shapes and say "these" (get_selection). Your hand edits are read before the AI edits again.
  • Real icons: the web app's drawing rules and shape libraries (AWS, Azure, GCP, Kubernetes, Cisco and more), so the AI uses real icon names.
  • Sequence, swimlane and use case diagrams: a drawing guide for each (get_drawing_guide with topic), and the server lays the drawing out: it spaces the shapes for their texts and leads every line around the shapes in its way.
  • Every other new diagram is checked: a connector that passes through a shape gets a path around it, a connector's text that stands on a shape or on another text gets a free place, and shapes that stand on each other are moved apart. A drawing without such a problem stays as it was written.
  • Self-check: the AI can look at a screenshot of the rendered diagram and fix overlaps (screenshot: true, or screenshot_diagram).
  • Versions: the last 20 versions as cards next to the canvas; restore or compare one, or ask the AI to undo (restore_version).
  • Pages and export: multi-page diagrams; save as .drawio, .png, .svg or .drawio.svg. Images get a 20 px margin and a white background (transparent: true for none); an SVG keeps its light colors in a viewer's dark mode.
  • Offline: the draw.io editor ships inside the package.

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 do draw.io's official MCP server and plugin Next AI Draw.io
Select two shapes and say "make these two red" The AI does not know which two The AI changes those two
Change the diagram by hand The AI sees it only after you save it to a file The AI reads the canvas before it edits
Want to know what the AI changed Nothing on the diagram shows it The change is outlined
Want to take the AI's change back Ask the AI to change it again Press Ctrl+Z
Want to watch the AI draw It opens when it is done You watch it being drawn

Saved diagrams

Every change is saved to ~/.next-ai-drawio/<session-id>.drawio with its last 20 versions; the newest 50 diagrams are kept. To continue one in a later conversation, ask the AI for it: it finds it with list_saved_diagrams and reopens it with start_session.

Your own drawing rules

Write them in ~/.next-ai-drawio/instructions.md, for example "Always use a minimal style". They are added to the drawing guide on every call, so edits apply without a restart. The first 5000 characters are used.

Tools

Tool What it does
start_session Open the preview and return the drawing guide; session_id continues a saved diagram
create_new_diagram Draw a new diagram from mxCell XML
edit_diagram Add, update or delete cells by id, all or nothing
get_diagram The current XML, including your edits in the browser
get_selection The shapes you selected in the preview
screenshot_diagram A PNG of a page, for the AI to check
load_diagram, export_diagram Open a .drawio or .drawio.svg file; save .drawio, .png, .svg or .drawio.svg
restore_version Go back to an earlier version; a redo stays possible
list_saved_diagrams Diagrams saved by earlier sessions, newest first
get_drawing_guide, get_shape_library The drawing rules again; the icon styles of a library such as aws4
list_pages, add_page, rename_page, delete_page Pages (tabs)

Configuration

Environment variables, set in the client's env for the server:

Variable Default What it does
PORT 6002 Preview port; when it is taken, the next free one up to 6020 is used
DRAWIO_DATA_DIR ~/.next-ai-drawio Folder for saved diagrams and instructions.md; off turns saving off
DRAWIO_AUTO_SCREENSHOT unset true attaches a screenshot to every create and edit result (2 to 10 s per call)
DRAWIO_BASE_URL the bundled draw.io Use another draw.io, such as a self-hosted one (see below)
DRAWIO_LANG unset Fix the editor and preview language: en, zh, zh-tw, ja, de and so on
DRAWIO_UI unset Fix the draw.io theme: kennedy, atlas, dark, min, sketch or simple
DRAWIO_DARK auto 1 starts dark, 0 starts light, auto follows the system
BROWSER unset none does not open the preview by itself; start_session still returns the URL, and the AI gives it to you. Linux without a display (SSH, a container) works the same way
DRAWIO_ALLOW_EMBED unset true lets pages on this machine (localhost, 127.0.0.1) show the preview in a frame, such as DeepSeek Harness's sidebar browser
DRAWIO_PREVIEW_URL unset Explicit trusted preview origin behind a private HTTPS reverse proxy (see below)
DRAWIO_PREVIEW_UI shell classic opens the previous preview page, without outlines, Ctrl+Z or get_selection
DEBUG unset true logs debug messages to stderr
Remote preview behind a private proxy

Set DRAWIO_PREVIEW_URL=https://diagram.example.net in the MCP server's environment. start_session returns that origin with the session's preview path and query. The server still listens only on 127.0.0.1; configure a private or authenticated HTTPS reverse proxy to its actual PORT, preserving the external Host and browser Origin headers. Forward the whole origin, including /shell/, /drawio/ and /api/, without a path prefix. If the chosen port is occupied, the server may choose another port, so check the listener before configuring the proxy.

Only this exact additional Host and matching Origin are trusted. Forwarded headers are not used to establish trust; the default localhost checks and API token remain. The value must be a canonical HTTPS origin, optionally ending in /, without credentials, a path, query or fragment. HTTP is accepted only for localhost or 127.0.0.1. Invalid values fail startup rather than silently falling back.

The hostname is not authentication. Anyone who can reach the preview can read its embedded API token and edit diagrams. Restrict proxy access to trusted users with network policy or authentication. Do not expose this listener publicly. DRAWIO_ALLOW_EMBED is separate and does not permit arbitrary remote framing. This setting changes only the browser preview, not the stdio MCP transport or DRAWIO_BASE_URL (the draw.io editor).

Self-hosted draw.io
docker run -d -p 8080:8080 jgraph/drawio

Then set DRAWIO_BASE_URL=http://localhost:8080. The preview cannot reach into a draw.io from another origin, so the AI's changes are not outlined, Ctrl+Z does not take them back (use the version cards) and get_selection does not work. The bundled copy leaves out a few features that load code on demand, such as the org chart layout. It also has no image proxy, so exported images leave out pictures inserted by their web address; see Offline deployment.

Troubleshooting

  • Blank preview in VS Code Simple Browser or Cursor's browser: the page refuses to be embedded in other pages. Open the URL in a regular browser.
  • Screenshot or PNG/SVG export times out: the preview tab renders them, and browsers slow down background tabs. Bring the tab to the front and try again.
  • "No active session": the AI has to call start_session first; after a restart it continues the earlier diagram with that session's id.
  • The preview does not update: open the URL that start_session returned; its ?mcp= part connects the page to the session.

How it works

The server talks to the agent over stdio and runs an HTTP server on 127.0.0.1 that serves the preview page and the bundled draw.io; the page polls it for changes. Every /api request needs a token that only the preview page has, so other websites cannot read or change your diagram.

License

Apache-2.0

Questions about Next AI Draw.io

What is the Next AI Draw.io MCP server?

Draw.io diagrams your AI agent draws on a live browser canvas that you can also edit by hand. Next AI Draw.io is maintained by DayuanJiang on GitHub at DayuanJiang/next-ai-draw-io, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Next AI Draw.io MCP server?

Add Next AI Draw.io to your AI app's MCP config with the command npx -y @next-ai-drawio/mcp-server@0.4.15. In Claude Code, run claude mcp add --transport stdio dayuanjiang -- npx -y @next-ai-drawio/mcp-server@0.4.15. To run Next AI Draw.io this way you need Node.js installed.

Does Next AI Draw.io need an API key?

The registry lists no required keys for Next AI Draw.io. Check the Next AI Draw.io README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Next AI Draw.io an official MCP server?

No. Next AI Draw.io is a community server maintained by DayuanJiang. Community servers can be excellent; read the code and the open issues before you give Next AI Draw.io access to company data.

What license is Next AI Draw.io under?

Next AI Draw.io is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Next AI Draw.io; the service it connects to has its own terms.