Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…

Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

A developer types a text prompt into a chat interface, which instantly generates a clean architecture diagram with…
Open SourceScore: 72

Generate Git-Friendly Architecture Diagrams in 30 Seconds with the Draw.io

Draw.io MCP server lets Claude Code generate version-controlled .drawio diagrams from text prompts in seconds. Use structured prompts with colors and real schema data for best results.

·3h ago·4 min read··5 views·AI-Generated·Report error
Share:
Source: dev.tovia devto_mcpSingle Source
How do I generate architecture diagrams with Claude Code and the Draw.io MCP server?

Install the Draw.io MCP server via .mcp.json, then prompt Claude Code with a structured description (systems, connections, colors). It renders valid mxGraphModel XML locally, saving .drawio files directly to your repo's /docs folder for version control.

TL;DR

Install the Draw.io MCP server, describe your system in plain text, and Claude Code generates a version-controlled .drawio file in under a minute.

The Technique: Text-to-Diagram with Draw.io MCP

You've been there: someone asks for an architecture diagram, and you spend 30 minutes fighting Visio connectors or dragging boxes in PowerPoint. The Draw.io MCP server eliminates that entire workflow. It lets Claude Code generate valid, git-friendly .drawio files from plain text descriptions.

This isn't a toy. The author of the original article generates production diagrams for Dynamics 365 integration architectures, swimlane process flows, and ERDs. The key insight: Draw.io uses mxGraphModel XML, which is text-based and diffs cleanly in git. That means your diagrams become part of your living documentation, versioned alongside your code.

Why It Works: MCP + Structured XML

The Draw.io MCP server runs locally on port 3000. It renders diagrams from mxGraphModel XML. Claude Code connects via the Model Context Protocol (MCP), which Anthropic introduced in November 2024 to standardize AI-to-tool communication. When you describe your system, Claude writes the XML directly—no manual dragging required.

Claude understands diagram semantics. It knows swimlanes have horizontal lanes, ERDs have relationships, and integration maps have system boundaries. It applies consistent color coding when you specify a scheme. The generated XML renders correctly in Draw.io every time.

How To Apply It: Setup and Prompting

Setup

Performance Review process swimlane diagram with four lanes: HR Admin, Manager, Employee, and System

Add the Draw.io MCP server to your .mcp.json config. It runs locally and opens a browser-based editor at localhost:3000 for review.

The Prompt Pattern That Works

Don't say "draw an architecture diagram." Be specific:

Create a Draw.io diagram showing:
- [System A] connects to [System B] via [protocol/method]
- [System C] reads from [System B] on a [schedule]
- Use [color] for [category], [color] for [category]
- Include a legend in the top-right corner
- Layout: left-to-right flow

The more context you give, the better the output. Paste your actual table names, API endpoints, or flow definitions. The author exports Dataverse schemas with XrmToolBox and feeds them directly to Claude for accurate ERDs.

What It Handles Well

Swimlane / process flow Excellent Business processes, approval workflows ERD Good Data models, schema visualization Integration map Good System context, API connections State machine Excellent Lifecycle diagrams Data flow Good ETL pipelines Sequence diagram OK Use Mermaid for these instead

The 80/20 Rule

Claude generates 80% of the diagram in 30 seconds. You spend 5 minutes on the remaining 20%—positioning overlapping elements and fine-tuning labels. Total: 6 minutes versus 30+ from scratch.

Three step flow from text prompt through Claude to Draw.io diagram output

Known Limitations

  • Complex layouts: 20+ elements sometimes overlap; you'll drag things manually.
  • Pixel-perfect positioning: Approximate. Fine for working docs, not presentation slides.
  • Your codebase: Claude doesn't know your table names unless you tell it. Paste schema or API specs.
  • Aesthetic polish: Functional, not beautiful. Use Draw.io's manual tools for final polish.

Real Example: D365 Integration Architecture

Prompt: "Create a Draw.io architecture diagram showing: Dynamics 365 CE in the center, connected to Azure AI Search (for document indexing), an external ERP via Azure Service Bus, Power Automate for email notifications, and Dataverse audit log feeding into Power BI. Use blue for Azure services, green for D365, gray for external systems."

Cover image for Architecture Diagrams with Draw.io MCP Server and Claude Code

30 seconds later: a color-coded diagram with labeled connections and a legend. Compare that to opening Visio and starting from a blank canvas.

Compared to Alternatives

Draw.io + Claude wins on cost (free), AI generation (full diagrams from text), and git friendliness (XML diffs). It loses on real-time collaboration—you collaborate through pull requests, not simultaneous editing. Mermaid is also free and git-friendly, but Draw.io gives you a visual editor for manual adjustments and richer diagram types.


Source: dev.to

Sources cited in this article

  1. Claude
Source: gentic.news · · author= · citation.json

AI-assisted reporting. Generated by gentic.news from 1 verified source, fact-checked against the Living Graph of 4,300+ entities. Edited by Ala SMITH.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

Claude Code users should immediately add the Draw.io MCP server to their `.mcp.json` and adopt a "docs-as-code" workflow. The biggest shift: architecture diagrams are no longer one-off exports but living artifacts that evolve with your codebase. Every time your system architecture changes, ask Claude to update the diagram instead of opening a drawing tool. This pairs perfectly with CLAUDE.md files that document your system—Claude can read the CLAUDE.md and regenerate the diagram when components change. For maximum accuracy, feed Claude real data. If you're working with a database, export your schema and include it in the prompt. If you have an OpenAPI spec, paste the endpoints. Claude's output quality scales directly with the context you provide. The 80/20 rule means you should accept imperfect positioning and reserve manual adjustments for diagrams that will be presented externally. For internal documentation, the raw output is sufficient. Finally, treat the `.drawio` XML as source code. Review it in pull requests, diff it in git history, and require updates when system architecture changes. This turns documentation from a chore into an automated byproduct of your development workflow—the same philosophy behind living documentation in git versus static Word documents that rot.
Compare side-by-side
Claude Code vs Dynamics 365
Enjoyed this article?
Share:

AI Toolslive

Five one-click lenses on this article. Cached for 24h.

Pick a tool above to generate an instant lens on this article.

Related Articles

From the lab

The framework underneath this story

Every article on this site sits on top of one engine and one framework — both built by the lab.

More in Open Source

View all