# Next AI Draw.io

> Next AI Draw.io is an MCP server for design and media. Draw draw.io diagrams from your repo on a live browser canvas you can also edit. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, vscode, Web
- **Repository:** https://github.com/dayuanjiang/next-ai-draw-io/tree/HEAD/packages/mcp-server
- **MCP Registry name:** io.github.DayuanJiang/next-ai-drawio
- **Categories:** [design and media](https://ai-powered.com/categories/design-and-media), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Where other draw.io MCP servers open a file and leave, this one keeps a live preview in your browser and reads it back. Your hand edits and your current selection are visible to the agent before it edits again, its own changes are outlined for a few seconds, and Ctrl+Z reverts them.

It installs with `npx @next-ai-drawio/mcp-server@latest` and has one-click setup for VS Code and Cursor, plus instructions for Claude Code, Codex CLI, Cline and Claude Desktop. The agent reads your project files with its own tools, then draws; existing `.drawio` and `.drawio.svg` files open with `load_diagram`. The draw.io editor ships inside the package, so it works offline.

It lays out sequence, swimlane and use case diagrams, checks other diagrams for connectors crossing shapes, keeps the last 20 versions, and can screenshot its own output to fix overlaps. Diagrams are saved under `~/.next-ai-drawio/`, and a comparison table in the README sets it against draw.io's official servers and lgazo's.

## Features

- **Live editable canvas:** A browser preview where both you and the agent change the same diagram.
- **Hand edits read back:** `get_diagram` and `get_selection` include your manual changes and chosen shapes.
- **Real icon libraries:** AWS, Azure, GCP, Kubernetes, Cisco and more via `get_shape_library`.
- **Layout and self-check:** Automatic spacing for sequence and swimlane diagrams and a screenshot-based overlap check.
- **Version history:** The last 20 versions are kept; restore one with `restore_version`.
- **Export formats:** Save as .drawio, .png, .svg or .drawio.svg, across multiple pages.

## Good for

- Ask an agent to draw a repository's architecture
- Iterate on a diagram by alternating edits with the AI
- Produce AWS or Kubernetes diagrams with real icons
- Reopen and continue a saved diagram in a later session

## Install

### Claude Code (Terminal)

```sh
claude mcp add next-ai-drawio -- npx -y @next-ai-drawio/mcp-server
```

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

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

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

- `start_session`: Open the preview and return the drawing guide.
- `create_new_diagram`: Draw a new diagram from mxCell XML.
- `edit_diagram`: Add, update or delete cells by id.
- `get_diagram`: Return the current XML, including browser edits.
- `get_selection`: Return the shapes selected in the preview.
- `screenshot_diagram`: Return a PNG of a page for checking.
- `load_diagram`: Open a .drawio or .drawio.svg file.
- `export_diagram`: Save as .drawio, .png, .svg or .drawio.svg.
- `restore_version`: Go back to an earlier version.
- `list_saved_diagrams`: List diagrams from earlier sessions.
- `get_drawing_guide`: Return drawing rules for a topic.
- `get_shape_library`: Return icon styles of a library such as aws4.

## FAQ

### Where are diagrams stored?

In `~/.next-ai-drawio/<session-id>.drawio`, with the last 20 versions; the newest 50 diagrams are kept.

### Can I set my own drawing style?

Yes: write rules in `~/.next-ai-drawio/instructions.md`; the first 5000 characters are used.

### Does it work offline?

The draw.io editor ships inside the package, so the README lists offline use.

### Why does Codex ask for approval?

Codex asks before tools that change the diagram; set `default_tools_approval_mode = "approve"` to skip that.

### How do I add Next AI Draw.io to Claude Code?

Run this command in your terminal: claude mcp add next-ai-drawio -- npx -y @next-ai-drawio/mcp-server

### What are the best alternatives to Next AI Draw.io?

The closest alternatives to Next AI Draw.io are REA, HyperFrames by HeyGen, Context7, Chrome DevTools MCP and Codebase Memory.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [HyperFrames by HeyGen](https://ai-powered.com/mcp/hyperframes-by-heygen): HyperFrames by HeyGen is a freemium MCP server for design and media.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/next-ai-draw-io
