Draw.io Diagram Server
This MCP server enables AI assistants to generate professional Draw.io diagrams from natural language prompts, outputting valid Draw.io XML files (.drawio) that can be opened directly in Draw.io.
Key capabilities:
Flowcharts - Create sequential flowcharts with process boxes, decision diamonds, terminators, data, documents, and delays, with automatic hierarchical layout and optional connection labels
Sequence Diagrams - Generate UML sequence diagrams showing interactions between participants with lifelines, activation bars, and support for solid and dashed lines (return messages)
Network Diagrams - Build network and architecture diagrams with custom-positioned nodes (rectangles, cylinders, databases, clouds, hexagons, ellipses) and labeled connections
Entity Relationship Diagrams - Create database schemas with entities, attributes, and relationship labels
Custom Diagrams - Design any diagram type with full control over 17+ shape types (including actors, notes, geometric shapes), precise positioning (x, y coordinates), dimensions, and connectors
Unified Interface - Single
create_diagramtool with type-specific data structures for all diagram typesFile Management - Automatically saves diagrams with customizable output directory via
DRAWIO_OUTPUT_DIRenvironment variableIntegration - Works with Claude Desktop via Model Context Protocol (MCP) configuration
Generates Draw.io compatible diagrams (flowcharts, sequence diagrams, network diagrams, and custom diagrams) from natural language prompts, outputting XML files that can be opened directly in Draw.io
Creates UML sequence diagrams showing interactions between participants with support for messages and return flows
Click 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., "@Draw.io Diagram Servercreate a flowchart for user login 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.
MCP Draw.io Diagram Server
A Model Context Protocol (MCP) server that generates Draw.io compatible diagrams from natural language prompts. This server enables AI assistants to create professional diagrams in XML format that can be opened directly in Draw.io.
Features
Unified Interface: Single tool (
create_diagram) for all diagram typesFlowchart Generation: Create sequential flowcharts with automatic hierarchical layout and branching support
Sequence Diagrams: Generate professional UML sequence diagrams with lifelines and activation bars
Entity Relationship Diagrams (ERD): Create database schemas with entities and relationships
Network Diagrams: Build network and architecture diagrams with custom node positioning
Custom Diagrams: Full control over shapes, positions, and connections for any diagram type
Draw.io Compatible: Outputs valid Draw.io XML format that can be imported directly
Related MCP server: draw-io-mcp
Star History
Installation
Clone or download this repository
Install dependencies:
npm installConfiguration
Environment Variables
DRAWIO_OUTPUT_DIR: (Optional) Specifies the directory where diagram files will be saved. If not set, files are saved to the current working directory.
Example:
export DRAWIO_OUTPUT_DIR=/path/to/diagrams # Linux/macOS
set DRAWIO_OUTPUT_DIR=C:\diagrams # WindowsUsage with Claude Desktop
Add this server to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Basic Configuration
{
"mcpServers": {
"diagram-master": {
"command": "node",
"args": ["D:\\TopSecret\\diagram-master\\index.js"]
}
}
}With Custom Output Directory
{
"mcpServers": {
"diagram-master": {
"command": "node",
"args": ["D:\\TopSecret\\diagram-master\\index.js"],
"env": {
"DRAWIO_OUTPUT_DIR": "C:\\Users\\YourName\\Documents\\Diagrams"
}
}
}
}Make sure to update the paths to match your actual installation directory and desired output location.
Available Tools
create_diagram
Creates a diagram of the specified type and saves it to a file.
Parameters:
filename: Name for the output .drawio file (extension added automatically)type: Type of diagram to generate (flowchart,sequence,network,erd,custom)data: Object containing diagram-specific data
1. Flowchart
Data Structure:
steps: Array of steps (id,label,type)connections: Array of connections (from,to,label)
Example:
{
"type": "flowchart",
"filename": "login-flow",
"data": {
"steps": [
{ "id": "start", "label": "Start", "type": "terminator" },
{ "id": "input", "label": "Input Credentials", "type": "data" },
{ "id": "check", "label": "Valid?", "type": "decision" },
{ "id": "end", "label": "End", "type": "terminator" }
],
"connections": [
{ "from": "start", "to": "input" },
{ "from": "input", "to": "check" },
{ "from": "check", "to": "end", "label": "Yes" },
{ "from": "check", "to": "input", "label": "No" }
]
}
}2. Sequence Diagram
Data Structure:
participants: Array of participant namesinteractions: Array of interactions (from,to,message,dashed)
Example:
{
"type": "sequence",
"filename": "api-call",
"data": {
"participants": ["Client", "Server", "DB"],
"interactions": [
{ "from": "Client", "to": "Server", "message": "Request" },
{ "from": "Server", "to": "DB", "message": "Query" },
{ "from": "DB", "to": "Server", "message": "Result", "dashed": true },
{ "from": "Server", "to": "Client", "message": "Response", "dashed": true }
]
}
}3. Entity Relationship Diagram (ERD)
Data Structure:
entities: Array of entities (id,name,attributes)relationships: Array of relationships (from,to,label)
Example:
{
"type": "erd",
"filename": "schema",
"data": {
"entities": [
{ "id": "users", "name": "Users", "attributes": ["id", "email", "password"] },
{ "id": "posts", "name": "Posts", "attributes": ["id", "user_id", "title"] }
],
"relationships": [
{ "from": "users", "to": "posts", "label": "1:N" }
]
}
}4. Network Diagram
Data Structure:
nodes: Array of nodes (id,label,type,x,y)connections: Array of connections (from,to,label)
5. Custom Diagram
Data Structure:
shapes: Array of shapes (id,label,type,x,y,width,height)connectors: Array of connectors (from,to,label)
Output Format
The server automatically saves diagrams as .drawio files in the configured output directory.
Open these files directly in Draw.io.
Development
Project Structure
diagram-master/
├── index.js # MCP server implementation
├── drawio-generator.js # Draw.io XML generation utilities
├── package.json # Project dependencies
├── README.md # This file
├── CHANGELOG.md # Version history
└── LICENSE # MIT LicenseLicense
MIT
Contributing
Contributions are welcome! Feel free to submit issues or pull requests.
Roadmap
Future enhancements:
Class diagrams and State machines
Style customization (colors, fonts, line styles)
Export to multiple formats (PNG, SVG, PDF)
Available Tools
1 toolcreate_diagramB
Create various types of diagrams (flowchart, sequence, network, erd, custom) and save to a file.
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Data for the diagram, structure depends on type | |
| type | Yes | Type of diagram to generate | |
| filename | Yes | Name for the output .drawio file (extension added automatically) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully convey behavioral traits. It only states 'create' and 'save to a file', but fails to disclose side effects (e.g., file overwrite behavior), required permissions, error handling, or success/failure indicators. This is insufficient for a write operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that efficiently conveys the tool's purpose and key differentiator (various diagram types). No superfluous words; every part contributes to understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (3 params, nested objects, no output schema), the description is somewhat lacking. It does not explain return values, error conditions, or whether the file is created/overwritten. However, the missing details are partially compensated by the schema descriptions. Overall adequate but not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already describes each parameter adequately. The description adds little beyond grouping the concept, stating that data structure depends on type. This meets the baseline but does not significantly enhance understanding beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool creates various types of diagrams (flowchart, sequence, etc.) and saves to a file. It uses specific verb ('Create') and resource ('diagrams'), and includes examples of types. While it adequately conveys the purpose, it could be more explicit about the output file format, which is partially covered in the parameter schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives (no siblings). The description implies usage for diagram creation, but lacks context such as when it is appropriate (e.g., generating visual documentation) and does not mention prerequisites or constraints.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusion between tools. The tool's purpose is clearly defined as creating diagrams of various types.
The single tool name 'create_diagram' follows a clear verb_noun pattern. Consistency is inherent with one tool.
A single tool for diagram creation is too few; the scope implies needs like listing, editing, or exporting diagrams. This falls into the 'too few' category.
Only creation is covered, with no tools for reading, updating, deleting, or managing diagrams. The surface is severely incomplete for a diagram server.
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 Connectors
Generate cloud architecture diagrams, flowcharts, and sequence diagrams.
Create diagrams in chat, rendered as live interactive draw.io diagrams. 10,000+ searchable shapes.
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Generate, edit, and export data-architecture diagrams from your AI. Column lineage, PNG in chat.
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.13911,455MIT
- AlicenseNot gradedqualityCmaintenanceEnables creating and editing Draw.io diagrams via natural language, supporting shapes, connectors, and multi-line text.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to create, modify, and analyze diagrams using Draw.io (Diagrams.net) through MCP commands.
- 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.791ISC
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/thechandanbhagat/diagram-master'
If you have feedback or need assistance with the MCP directory API, please join our Discord server