MCP server by Matthewyin
MCP Diagram Generator
Version: 1.0.1 | Status: ✅ Production Ready | Last Updated: 2025-02-04
A powerful diagram generation tool that provides diagram creation capabilities for Claude Code and other AI assistants through the Model Context Protocol (MCP). Supports Draw.io, Mermaid, and Excalidraw - three mainstream formats.
✨ Core Features
- 🎨 Multi-format Support: Draw.io, Mermaid, Excalidraw
- 🏗️ Complex Structures: Supports nested containers, multi-layered architectures (up to 10 levels)
- 🏷️ Edge Labels: All connections support labels
- 🎨 Rich Styling: 5 color schemes, dashed lines, multiple shapes
- 🚀 High Quality: Production-grade, supports large diagrams with 100+ elements
- ✅ Fully Fixed: All limitations and known issues resolved
🚀 Quick Start
Installation
# Using npx (recommended)
npx -y mcp-diagram-generator
# Or install globally
npm install -g mcp-diagram-generator
Configure Claude Code
Add to your Claude Code settings file:
{
"mcpServers": {
"mcp-diagram-generator": {
"command": "npx",
"args": [
"-y",
"mcp-diagram-generator"
]
}
}
}
Configuration file locations:
- macOS/Linux:
~/.claude.json - Windows:
%APPDATA%\claude\claude.json
Using in Claude Code
User: Draw a microservices architecture diagram
Claude: I'll generate a microservices architecture diagram for you...
[Generates complete architecture diagram including client layer, API gateway layer, microservices layer, and data layer]
📊 Supported Diagram Types
| Diagram Type | Description | Recommended Format | |---------|------|----------| | Architecture Diagram | System architecture, microservices architecture | Excalidraw / Draw.io | | Flowchart | Business processes, algorithm flows | Mermaid / Draw.io | | Sequence Diagram | Message interactions, API calls | Mermaid | | Class Diagram | Class structures, relationship diagrams | Mermaid / Draw.io | | ER Diagram | Database relationship diagrams | Mermaid / Draw.io | | Mind Map | Hierarchical structures, brainstorming | Mermaid / Excalidraw | | Network Topology | Network architecture, device connections | Draw.io (supports 4-level nesting) |
🎯 MCP Tools
generate_diagram
Generate diagram files from structured JSON specifications.
Parameters:
diagram_spec(object): Diagram specificationoutput_path(string, optional): Output file pathformat(string, optional): Output format, overrides diagram_spec.formatfilename(string, optional): Filename without extension
Returns: Path to the generated diagram file
📁 Repository Structure
mcp-skills/
├── mcp-diagram-generator/ # MCP Server implementation
│ ├── src/
│ │ ├── index.ts # MCP server entry
│ │ ├── types.ts # TypeScript type definitions
│ │ └── generators/ # Format generators
│ │ ├── drawio.ts
│ │ ├── mermaid.ts
│ │ └── excalidraw.ts
│ ├── README.md # Detailed documentation
│ └── package.json
│
├── skills/ # Claude Skill definition
│ └── diagram-generator/ # Skill configuration
│ ├── SKILL.md # Skill documentation
│ └── package.json
│
├── video.mp4 # Demo video
└── README.md # This file
🎨 Format Details
Draw.io (.drawio)
Advantages: Best for complex diagrams, supports manual editing, rich shape library
View at: https://app.diagrams.net
Mermaid (.md)
Advantages: Code-friendly, version control friendly, GitHub native support
View with: VS Code, GitHub, Typora
Excalidraw (.excalidraw)
Advantages: Hand-drawn style, real-time collaboration, embeddable
View at: https://excalidraw.com
📖 Usage Example
{
"format": "excalidraw",
"title": "Microservices Architecture",
"elements": [
{
"id": "client-layer",
"type": "container",
"name": "Client Layer",
"geometry": {"x": 50, "y": 50, "width": 700, "height": 120},
"style": {"fillColor": "#e3f2fd", "strokeColor": "#1976d2"},
"children": [
{"id": "web", "type": "node", "name": "Web App", "geometry": {"x": 100, "y": 80, "width": 120, "height": 60}}
]
}
]
}
📊 Quality Metrics
| Metric | Value | Description | |------|------|------| | Max Nesting Level | 10 levels | Verified | | Max Elements | 100+ | Tested (84 elements) | | Edge Labels | Full support | All edges can have labels | | Generation Speed | < 1 second | 84-element diagram | | ID Uniqueness | 100% | No duplicate IDs | | Syntax Correctness | 100% | Mermaid syntax correct |
📄 License
MIT License
🤝 Contributing
Contributions welcome! Please feel free to:
- 🐛 Report bugs
- 💡 Suggest new features
- 📝 Submit Pull Requests
🎉 Get Started
Experience MCP Diagram Generator now and generate professional-grade architecture diagrams for your projects!
Supported Formats: Draw.io, Mermaid, Excalidraw
Quality Level: Production-grade
Status: Stable and reliable
Happy Diagramming! 🎨✨