
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
diagram-master
Advanced tools
MCP Server for generating Draw.io compatible diagrams from natural language prompts
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.
create_diagram) for all diagram typesnpm install
Example:
export DRAWIO_OUTPUT_DIR=/path/to/diagrams # Linux/macOS
set DRAWIO_OUTPUT_DIR=C:\diagrams # Windows
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
{
"mcpServers": {
"diagram-master": {
"command": "node",
"args": ["D:\\TopSecret\\diagram-master\\index.js"]
}
}
}
{
"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.
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 dataData 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" }
]
}
}
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 }
]
}
}
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" }
]
}
}
Data Structure:
nodes: Array of nodes (id, label, type, x, y)connections: Array of connections (from, to, label)Data Structure:
shapes: Array of shapes (id, label, type, x, y, width, height)connectors: Array of connectors (from, to, label)The server automatically saves diagrams as .drawio files in the configured output directory.
Open these files directly in Draw.io.
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 License
MIT
Contributions are welcome! Feel free to submit issues or pull requests.
Future enhancements:
FAQs
MCP Server for generating Draw.io compatible diagrams from natural language prompts
The npm package diagram-master receives a total of 69 weekly downloads. As such, diagram-master popularity was classified as not popular.
We found that diagram-master demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.