diag2md-mcp
OfficialClick on "Install 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., "@diag2md-mcpconvert all Draw.io diagrams in the architecture folder to Mermaid markdown"
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.
diag2md-mcp
Model Context Protocol (MCP) server providing AI coding agents with Draw.io C4 and UML architectural guardrails and diagram conversion capabilities.
diag2md-mcp bridges Draw.io architecture diagrams (.xml, .drawio) with AI coding agents (such as Antigravity, Cursor, Claude Desktop, and VS Code MCP clients) by converting C4 and UML diagrams into structured Mermaid Markdown in real time.
Powered by diag2md.
Key Features
Automated Workspace Discovery: Scans project directories for Draw.io diagram files matching configurable glob patterns (
**/architecture/**/*.xml,**/*.drawio).High-Performance In-Memory Conversion: Converts Draw.io XML models to Mermaid C4 & UML Markdown in-memory without subshell process spawning overhead.
AI Context Provider (
convert_diagrams_read): Reads and converts diagrams dynamically to provide rich architectural context directly to AI coding assistants during chat sessions.Batch Diagram Synchronization (
convert_diagrams_write): Keeps architecture documentation up to date by generating.mdfiles alongside diagram sources.
Related MCP server: drawio-mcp
Quick Start
Running via npx
You can run the MCP server directly without pre-installing:
npx -y diag2md-mcpInstalling Globally
npm install -g diag2md-mcpMCP Server Configuration
To connect diag2md-mcp to your favorite AI assistant or MCP client, add the server to your client configuration file (e.g., mcp_config.json, claude_desktop_config.json, Cursor, or Antigravity MCP settings).
Recommended (Globally Installed Package)
{
"mcpServers": {
"diag2md-mcp": {
"command": "diag2md-mcp"
}
}
}Alternative: Local Built Source
{
"mcpServers": {
"diag2md-mcp": {
"command": "node",
"args": ["/path/to/diag2md-mcp/dist/index.js"]
}
}
}Alternative: On-Demand via npx
{
"mcpServers": {
"diag2md-mcp": {
"command": "npx",
"args": ["-y", "diag2md-mcp"]
}
}
}MCP Tools Reference
diag2md-mcp exposes 3 core tools to AI coding agents:
Tool Name | Description | Arguments |
| Discovers all Draw.io architecture diagram files ( |
|
| Batch scans workspace diagram files matching glob patterns, converts them, and writes updated |
|
| Batch scans workspace diagram files and returns converted Mermaid Markdown directly as context for the AI assistant. |
|
Server Configuration
The MCP server settings can be customized via environment variables:
Environment Variable | Description | Default Value |
| Comma-separated glob patterns to discover diagram files. |
|
| Comma-separated glob patterns to ignore during file discovery. |
|
| Default conversion diagram type ( |
|
Configuration Example with env Patterns
You can configure custom search patterns directly in your MCP server JSON configuration using the env block:
{
"mcpServers": {
"diag2md-mcp": {
"command": "diag2md-mcp",
"env": {
"DIAG2MD_PATTERNS": "**/architecture/**/*.xml, **/docs/**/*.drawio",
"DIAG2MD_IGNORE": "**/tmp/**, **/node_modules/**",
"DIAG2MD_TYPE": "c4"
}
}
}
}Dynamic Tool Call Example with patterns
AI assistants or tools can also override search patterns dynamically per request:
{
"name": "convert_diagrams_read",
"arguments": {
"patterns": [
"**/architecture/**/*.xml",
"**/docs/**/*.drawio"
]
}
}Development
# Clone the repository
git clone https://github.com/diag2md/diag2md-mcp.git
cd diag2md-mcp
# Install dependencies
npm install
# Build TypeScript to JavaScript dist/
npm run build
# Run unit tests
npm run test
# Run type checker
npm run typecheckLicense
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables AI agents to programmatically create, modify, and analyze Draw.io diagrams through the Model Context Protocol. Supports generating architectural diagrams, flowcharts, and visualizations with bidirectional communication between AI systems and Draw.io.13741,443MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to create, read, and edit draw.io diagrams with live preview in VS Code.21742MIT
- FlicenseNot gradedqualityFmaintenanceEnables AI assistants to create, read, and manage Draw.io diagrams programmatically through natural language interactions.1
- AlicenseAqualityBmaintenanceEnables AI assistants to generate professional UML diagrams (class, use case, activity, sequence) from natural language descriptions, producing editable .drawio files compatible with diagrams.net.774ISC
Related MCP Connectors
Let Claude, Cursor, or ChatGPT author Mermaid diagrams your team can read and share.
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/diag2md/diag2md-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server