antigravity-drawio-mcp
Integrates with diagrams.net (Draw.io) to programmatically create, parse, export, and validate .drawio diagrams.
Converts Mermaid JS flowchart syntax into native editable .drawio XML elements.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@antigravity-drawio-mcp Create a flowchart for the user registration process"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐จ Flowchart AI Generator & Draw.io MCP Server (antigravity-drawio-mcp)
Automate Draw.io Flowcharts & Architecture Diagrams with AI. antigravity-drawio-mcp is a production-grade Model Context Protocol (MCP) Server framework connecting Google Antigravity MCP, Claude Code, Cursor IDE, VS Code, and Windsurf directly to the Draw.io Desktop App and CLI environment as an advanced Flowchart AI Generator and Architecture Diagram AI solution.
๐ค AI System Prompt & Quick Context
Package:
antigravity-drawio-mcp(PyPI:antigravity-drawio-mcp)
Type: Model Context Protocol (MCP) Server for Draw.io Diagram & Flowchart Automation
Supported Clients: Google Antigravity, Claude Code, Claude Desktop, Cursor IDE, VS Code, Windsurf
Core Capabilities: Programmatic.drawioXML creation, 4-5 iteration boundary collision verification, Mermaid JS to Draw.io conversion, native zlib stream decompression, headless CLI export (PNG, SVG, PDF, JPEG), desktop GUI auto-launch.
CLI Tool Suite:create_diagram,export_diagram,open_in_drawio,parse_diagram,convert_mermaid_to_drawio,validate_diagram.
Install Command:pip install antigravity-drawio-mcpORuvx antigravity-drawio-mcp
System Requirement: Python 3.8+, optional localdraw.ioexecutable for headless rendering.
Use When User Requests: AI flowchart generation, software architecture diagram creation, C4 component diagrams, Mermaid to Draw.io conversion, Draw.io XML parsing, automated diagram boundary auditing.
โก Quick Install & Setup
pip install antigravity-drawio-mcpOr run directly without installation via uvx:
uvx antigravity-drawio-mcpRelated MCP server: fcp-drawio
๐๏ธ System Architecture & C4 Diagram Model

The antigravity-drawio-mcp framework is structured into a 3-tier C4 Software Component Architecture (Level 3) for Architecture Diagram AI automation:
Software System Boundary (AI Clients): Communicates via standard JSON-RPC 2.0 over Stdio transport with Google Antigravity MCP Core Agent or any MCP-compatible IDE (VS Code, Cursor, Claude Desktop, Windsurf).
Container: Antigravity Draw.io MCP Server (
src/antigravity_drawio_mcp):FastMCP Request Handler: FastMCP protocol engine and tool request dispatcher.Draw.io XML Builder: Programmatic XML DOM construction and geometry engine.Draw.io File Parser: Direct.drawioXML parsing & native zlib/base64 decompressor.CLI Export Engine: Process lock manager and Draw.io desktop CLI wrapper (--export).Diagram Validator: Automated collision detector & label boundary auditor.Mermaid Conversion Engine: Bi-directional Mermaid JS to Draw.io converter.
External Systems & Storage: Interoperates with local
draw.io.exefor headless image rendering (PNG, SVG, PDF) and persistent file storage.
๐ค Flowchart AI Generator & Diagram Automation Capabilities
๐ค Flowchart AI Generator Engine: Automatically generate clean visual graphs, C4 software models, and system flows straight from natural language AI prompts.
๐จ Programmatic Draw.io MCP XML Builder: Construct complex multi-page
.drawioXML documents natively in Python with exact geometric node coordinates and edge connectors.๐ Mermaid JS to Draw.io Converter: Instantly transform Mermaid JS flowchart definitions into fully editable native Draw.io XML cells without layout loss.
๐ก๏ธ 4-5 Iteration Boundary Collision Verification: Built-in layout auditor calculates node boundaries, text label bounds, and connector paths to eliminate visual overlaps in Architecture Diagram AI.
๐ผ๏ธ Headless CLI Image Renderer: Export
.drawiofiles to high-resolution PNG, vector SVG, PDF, or JPEG using backgrounddraw.ioCLI execution.๐ Native Zlib Stream Decompressor: Inspect existing compressed Draw.io diagrams, automatically inflating base64/zlib XML streams into raw DOM trees.
๐ Google Antigravity MCP & Multi-IDE Support: Native Stdio transport integration for Google Antigravity MCP, Claude Code, Cursor IDE, VS Code, and Windsurf.
๐ฅ๏ธ Desktop GUI Auto-Launch Interop: Programmatically open created or updated
.drawiofiles directly inside the Draw.io Desktop application for manual edits.
๐ Google Antigravity MCP & AI Assistant Setup (Cursor, Claude, VS Code, Windsurf)
For detailed step-by-step setup guides, refer to the Integration Guide.
1. ๐ Google Antigravity MCP Integration (~/.gemini/config/mcp_config.json)
{
"mcpServers": {
"drawio": {
"command": "uvx",
"args": ["antigravity-drawio-mcp"]
}
}
}Or using local python:
{
"mcpServers": {
"drawio": {
"command": "python",
"args": ["-m", "antigravity_drawio_mcp.server"]
}
}
}2. ๐ค Claude Desktop & Claude Code MCP Setup (claude_desktop_config.json)
{
"mcpServers": {
"antigravity_drawio": {
"command": "python",
"args": ["-m", "antigravity_drawio_mcp.server"]
}
}
}3. โก Cursor IDE MCP Configuration (Features -> MCP Servers)
Name:
antigravity_drawioType:
stdioCommand:
python -m antigravity_drawio_mcp.server
4. ๐ป VS Code / Continue.dev & Windsurf Setup (~/.continue/config.json)
{
"experimental": {
"modelContextProtocol": [
{
"name": "antigravity_drawio",
"command": "python",
"args": ["-m", "antigravity_drawio_mcp.server"]
}
]
}
}๐ ๏ธ Draw.io MCP Server Tools Reference
The antigravity-drawio-mcp server exposes production Draw.io MCP tools over Model Context Protocol:
Tool Name | Parameters | Description |
|
| Generates a native |
|
| Renders a |
|
| Launches the specified |
|
| Parses raw or zlib-compressed |
|
| Converts Mermaid JS flowchart syntax directly to a |
|
| Audits a diagram for node collisions, layout overlaps, and text clipping issues. |
๐๏ธ Architecture Diagram AI & Real-World Industry Examples
antigravity-drawio-mcp powers production-grade Architecture Diagram AI solutions across hardware, software, and decision-tree domains:
1. SystemVerilog UVM Layered Testbench Architecture
IEEE 1800 Object-Oriented Verification Framework diagram featuring Driver, Monitor, Sequencer, Scoreboard, and DUT Interface layers.
2. Graphic Organizer Selection Flowchart
27-node decision flowchart mapping complex pedagogical visual learning structures.
3. DE10-Advanced FPGA Design & CAD Tool Flow
Intel Quartus Prime CAD compilation, System Builder, and FPGA programming workflow.
๐ Flowchart AI Generator PoC & Runnable Examples
Comprehensive Python PoC scripts demonstrating Flowchart AI Generator capabilities are available in the examples/ directory:
Example Script | Procedure Demonstrated |
Programmatic 3-tier web architecture graph creation, verification, PNG & SVG rendering. | |
Converts a standard Mermaid JS flowchart definition string into native | |
Loads an existing | |
Simulates how AI Assistants (e.g. Google Antigravity MCP) dispatch Model Context Protocol (MCP) tool requests. |
โ Frequently Asked Questions (FAQ โ Draw.io MCP & Flowchart AI)
1. How do I use AI to generate Draw.io flowcharts with Draw.io MCP?
Install antigravity-drawio-mcp and connect it to Google Antigravity MCP, Claude Code, or Cursor IDE. You can then ask your AI assistant to generate C4 architecture graphs, flowcharts, or UML diagrams in plain English, and the Draw.io MCP server will construct fully editable .drawio XML files automatically.
2. Can I convert Mermaid.js graphs to native Draw.io files using Flowchart AI Generator?
Yes! Use the convert_mermaid_to_drawio MCP tool. It parses Mermaid JS flowchart syntax and converts it into native editable .drawio XML elements with full node cell geometry and edge pathing.
3. Are generated Architecture Diagram AI Draw.io files fully editable?
Absolutely. All generated files are standard .drawio XML documents. You can open them in the Draw.io Desktop App or web editor (app.diagrams.net) to make manual adjustments or export them to images.
4. Which AI assistants and IDEs support Google Antigravity MCP integration?
antigravity-drawio-mcp supports Google Antigravity MCP, Claude Code, Claude Desktop, Cursor IDE, VS Code (via Continue.dev), and Windsurf IDE over Stdio transport.
5. Does Draw.io MCP require a local installation of the Draw.io Desktop App?
No. XML creation, parsing, Mermaid conversion, and collision validation operate natively in pure Python without external dependencies. However, headless image rendering (PNG, SVG, PDF) requires local draw.io executable integration.
6. How does automated diagram boundary verification work in Architecture Diagram AI?
The validate_diagram tool executes a 4-5 iteration boundary auditing algorithm that calculates node bounding boxes, detects label overlaps, and verifies edge routing to prevent visual clipping.
7. How do I inspect and decompress compressed Draw.io XML files?
Use the parse_diagram tool. It automatically handles raw XML as well as zlib/base64 compressed Draw.io XML streams, returning parsed nodes, edges, and cell geometry.
8. How do I install and run antigravity-drawio-mcp?
You can install it via PyPI using pip install antigravity-drawio-mcp or run it instantly without installation using uvx antigravity-drawio-mcp.
๐ท๏ธ Recommended GitHub Repository Topics
Enhance repository discoverability by applying these 20 topics in GitHub Repository Settings:
mcp-server, model-context-protocol, drawio, draw-io, antigravity, google-antigravity, flowchart-ai, flowchart-generator, diagram-automation, diagram-as-code, mermaid-to-drawio, cursor-ide, claude-code, windsurf, ai-diagrams, c4-architecture, python-mcp, fastmcp, drawio-automation, drawio-cli
๐งช Testing & Verification
Run the comprehensive unit test suite:
python -m unittest tests/test_mcp_server.py๐ License
Distributed under the MIT License. Copyright (c) 2026 SUJAN S.
Available Tools
14 toolsanalyze_diagramB
Analyze diagram topology: extracts entry points, sinks, feedback cycles, bottlenecks, and critical execution paths.
Inputs: input_path (required). Returns: result
beautify_diagramC
Beautify any existing diagram by running topological auto-layout, resolving overlapping links, and applying modern themes.
Inputs: input_path (required), theme, output_path, layout_direction. Returns: result
convert_mermaid_to_drawioC
Convert a Mermaid JS graph definition string into native .drawio XML.
Inputs: output_path (required), mermaid_code (required). Returns: result
create_diagramB
Create a new .drawio XML diagram file with nodes and edges at specified coordinates.
Inputs: edges (required), nodes (required), output_path (required), page_name. Returns: result
export_diagramB
Export a .drawio XML diagram to PNG, SVG, PDF, or JPEG using desktop CLI.
Inputs: input_path (required), output_path (required), format, page_index. Returns: result
generate_c4_diagramB
Generate an official C4 architecture diagram (Context, Container, or Component view) with actors, systems, and boundaries.
Inputs: spec (required), output_path (required). Returns: result
generate_er_diagramA
Generate a relational database ER schema diagram with tables, primary/foreign keys, types, and cardinalities.
Inputs: spec (required), output_path (required). Returns: result
generate_sequence_diagramC
Generate a UML sequence diagram with lifelines, sync/async call arrows, and return messages.
Inputs: spec (required), output_path (required). Returns: result
generate_smart_diagramC
Generate a professionally themed, auto-laid-out diagram without calculating manual pixel coordinates.
Inputs: edges (required), nodes (required), output_path (required), theme, +3 more. Returns: result
open_in_drawioB
Open a .drawio diagram file directly in the local Draw.io Desktop GUI app.
Inputs: input_path (required). Returns: result
parse_diagramB
Parse a .drawio XML file and extract structured nodes, edges, and page metadata.
Inputs: input_path (required). Returns: result
patch_diagramA
Surgically patch an existing diagram: add/delete/update nodes, rewire edges, group into containers, or highlight paths.
Inputs: operations (required), drawio_path (required), output_path. Returns: result
resolve_diagram_collisionsC
Auto-resolve node collisions in a .drawio diagram by shifting overlapping coordinates.
Inputs: input_path (required), output_path. Returns: result
validate_diagramA
Audit a .drawio diagram file for node collisions and text boundary overflows.
Inputs: input_path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 14 tools
Each generator targets a distinct diagram type, and lifecycle tools like create, patch, parse, export, and validate have clear boundaries. Minor overlap exists between beautify_diagram and resolve_diagram_collisions, both dealing with layout/overlap fixes.
Tools consistently use snake_case verb-first names such as generate_*, create_diagram, patch_diagram, and validate_diagram. open_in_drawio and convert_mermaid_to_drawio break the strict verb_noun pattern but remain predictable.
14 tools cover generation, editing, layout, analysis, validation, conversion, export, and GUI opening without redundancy. The count is well-scoped for a diagramming server.
The set covers diagram creation, parsing, patching, layout, validation, conversion, export, and opening, which is a complete workflow. It lacks an explicit file deletion/list operation, but that is a minor gap outside core diagramming.
Related MCP Connectors
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Collaborative whiteboard MCP server โ create objects, connectors, C4 diagrams, and manage boards
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to programmatically create and manage flowcharts, ERDs, and swimlane diagrams. It provides tools for manipulating diagram structures, performing auto-layouts, and exporting to Mermaid or Markdown formats.MIT
- AlicenseBqualityCmaintenanceMCP server that enables LLMs to create and edit draw.io diagrams using high-level intent commands, with automatic layout and styling.47 npm4MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables LLMs to create and open diagrams in draw.io using XML, Mermaid, or CSV formats, by building a URL with compressed content and opening it in the browser.385 npmMIT
- AlicenseAqualityDmaintenanceMCP server for generating diagrams, charts, and visualizations using Gemini image generation on Vertex AI. Supports auto-detection of diagram types, multiple style modes, and iterative refinement.367 npm1MIT