Brings draw.io diagram generation into Claude and Cursor with real-time browser preview. Spins up an embedded HTTP server on port 6002 that serves the draw.io UI and syncs state as you work. You get five tools: start_session opens the browser, create_new_diagram and edit_diagram handle XML generation and cell-level edits by ID, get_diagram pulls current state, and export_diagram saves to .drawio files. Includes version history with visual thumbnails for rolling back changes. Self-contained with no external dependencies, though it loads the draw.io UI from embed.diagrams.net by default. You can point DRAWIO_BASE_URL at a private instance if you need to keep everything internal.
MCP (Model Context Protocol) server that enables AI agents like Claude Desktop and Cursor to generate and edit draw.io diagrams with real-time browser preview.
Self-contained - includes an embedded HTTP server, no external dependencies required.
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Add to your VS Code settings (.vscode/mcp.json in workspace or user settings):
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Add to Cursor MCP config (~/.cursor/mcp.json):
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
cline_mcp_settings.json{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
claude mcp add drawio -- npx @next-ai-drawio/mcp-server@latest
Use the standard MCP configuration with:
npx["@next-ai-drawio/mcp-server@latest"]"Create a flowchart showing user authentication with login, MFA, and session management"
.drawio filesembed.diagrams.net by default, configurable via DRAWIO_BASE_URL)| Tool | Description |
|---|---|
start_session | Opens browser with real-time diagram preview |
create_new_diagram | Create a new diagram from XML (requires xml argument) |
edit_diagram | Edit diagram by ID-based operations (update/add/delete cells) |
get_diagram | Get the current diagram XML |
export_diagram | Save diagram to a .drawio file |
┌─────────────────┐ stdio ┌─────────────────┐
│ Claude Desktop │ <───────────> │ MCP Server │
│ (AI Agent) │ │ (this package) │
└─────────────────┘ └────────┬────────┘
│
┌────────▼────────┐
│ Embedded HTTP │
│ Server (:6002) │
└────────┬────────┘
│
┌────────▼────────┐
│ User's Browser │
│ (draw.io embed) │
└─────────────────┘
| Variable | Default | Description |
|---|---|---|
PORT | 6002 | Port for the embedded HTTP server |
DRAWIO_BASE_URL | https://embed.diagrams.net | Base URL for the draw.io embed. Set this to use a self-hosted draw.io instance for private deployments. |
For security-sensitive environments that require private deployment of draw.io:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"],
"env": {
"DRAWIO_BASE_URL": "https://drawio.your-company.com"
}
}
}
}
You can deploy your own draw.io instance using the official Docker image:
docker run -d -p 8080:8080 jgraph/drawio
Then set DRAWIO_BASE_URL=http://localhost:8080 (or your server's URL).
If port 6002 is in use, the server will automatically try the next available port (up to 6020).
Or set a custom port:
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"],
"env": { "PORT": "6003" }
}
}
}
Call start_session first to open the browser window.
Check that the browser URL has the ?mcp= query parameter. The MCP session ID connects the browser to the server.
Apache-2.0
therealtimex/browser-use
jae-jae/fetcher-mcp
merajmehrabi/puppeteer-mcp-server
com.thenextgennexus/playwright-mcp-server
saik0s/mcp-browser-use