diag2md-mcp
Officialdiag2md-mcp
Model Context Protocol (MCP)-Server, der KI-Codierungsagenten Draw.io-C4- und UML-Architektur-Leitplanken sowie Diagrammkonvertierungsfunktionen bereitstellt.
diag2md-mcp verbindet Draw.io-Architekturdiagramme (.xml, .drawio) mit KI-Codierungsagenten (wie Antigravity, Cursor, Claude Desktop und VS Code-MCP-Clients), indem es C4- und UML-Diagramme in Echtzeit in strukturiertes Mermaid-Markdown konvertiert.
Angetrieben von diag2md.
Hauptfunktionen
Automatische Workspace-Erkennung: Durchsucht Projektverzeichnisse nach Draw.io-Diagrammdateien, die konfigurierbaren Glob-Mustern entsprechen (
**/architecture/**/*.xml,**/*.drawio).Hochleistungs-In-Memory-Konvertierung: Konvertiert Draw.io-XML-Modelle in Mermaid-Markdown für C4 und UML im Arbeitsspeicher, ohne den Overhead durch das Starten von Subshell-Prozessen.
KI-Kontextanbieter (
convert_diagrams_read): Liest und konvertiert Diagramme dynamisch, um KI-Codierungsassistenten während Chat-Sitzungen direkt umfangreichen Architekturkontext bereitzustellen.Batch-Diagrammsynchronisierung (
convert_diagrams_write): Hält die Architekturdokumentation aktuell, indem.md-Dateien neben den Diagrammquellen erzeugt werden.
Related MCP server: drawio-mcp
Schnellstart
Ausführen über npx
Sie können den MCP-Server direkt ausführen, ohne ihn vorab zu installieren:
npx -y diag2md-mcpGlobale Installation
npm install -g diag2md-mcpMCP-Server-Konfiguration
Um diag2md-mcp mit Ihrem bevorzugten KI-Assistenten oder MCP-Client zu verbinden, fügen Sie den Server zu Ihrer Client-Konfigurationsdatei hinzu (z. B. mcp_config.json, claude_desktop_config.json, Cursor- oder Antigravity-MCP-Einstellungen).
Empfohlen (Global installiertes Paket)
{
"mcpServers": {
"diag2md-mcp": {
"command": "diag2md-mcp"
}
}
}Alternative: Lokal erstellte Quelle
{
"mcpServers": {
"diag2md-mcp": {
"command": "node",
"args": ["/path/to/diag2md-mcp/dist/index.js"]
}
}
}Alternative: Bei Bedarf über npx
{
"mcpServers": {
"diag2md-mcp": {
"command": "npx",
"args": ["-y", "diag2md-mcp"]
}
}
}MCP-Tools-Referenz
diag2md-mcp stellt KI-Codierungsagenten 3 Kern-Tools zur Verfügung:
Tool-Name | Beschreibung | Argumente |
| Findet alle Draw.io-Architekturdiagrammdateien ( |
|
| Scannt Workspace-Diagrammdateien, die Glob-Mustern entsprechen, im Batch-Modus, konvertiert sie und schreibt aktualisierte |
|
| Scannt Workspace-Diagrammdateien im Batch-Modus und gibt konvertiertes Mermaid-Markdown direkt als Kontext für den KI-Assistenten zurück. |
|
Server-Konfiguration
Die MCP-Server-Einstellungen können über Umgebungsvariablen angepasst werden:
Umgebungsvariable | Beschreibung | Standardwert |
| Kommagetrennte Glob-Muster zum Ermitteln von Diagrammdateien. |
|
| Kommagetrennte Glob-Muster, die bei der Dateisuche ignoriert werden. |
|
| Standarddiagrammtyp für die Konvertierung ( |
|
Konfigurationsbeispiel mit env-Mustern
Sie können benutzerdefinierte Suchmuster direkt in Ihrer MCP-Server-JSON-Konfiguration über den env-Block konfigurieren:
{
"mcpServers": {
"diag2md-mcp": {
"command": "diag2md-mcp",
"env": {
"DIAG2MD_PATTERNS": "**/architecture/**/*.xml, **/docs/**/*.drawio",
"DIAG2MD_IGNORE": "**/tmp/**, **/node_modules/**",
"DIAG2MD_TYPE": "c4"
}
}
}
}Beispiel für dynamische Tool-Aufrufe mit patterns
KI-Assistenten oder Tools können Suchmuster auch pro Anfrage dynamisch überschreiben:
{
"name": "convert_diagrams_read",
"arguments": {
"patterns": [
"**/architecture/**/*.xml",
"**/docs/**/*.drawio"
]
}
}Entwicklung
# 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 typecheckLizenz
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