Get the FREE Ultimate OpenClaw Setup Guide →

diagram-master

MCP for Draw.io

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio thechandanbhagat-diagram-master node index.js

How to use

diagram-master is an MCP server that generates Draw.io compatible diagrams from natural language prompts using a single unified tool called create_diagram. It supports flowcharts, sequence diagrams, ERDs, network diagrams, and fully custom diagrams, all outputting valid Draw.io XML files that can be opened directly in Draw.io. To use it, run the server and invoke create_diagram with the appropriate type and data payload. The server is designed to output .drawio files to a configured directory and can be accessed by your AI assistants or automation pipelines to produce diagrams from prompts or structured prompts.

Once running, you can request diagrams by supplying a payload that includes the diagram type (flowchart, sequence, erd, network, or custom), a target filename, and a data object describing the diagram structure. For example, a flowchart requires steps and connections, a sequence diagram requires participants and interactions, and an ERD requires entities and relationships. The tool ensures the resulting file is Draw.io compatible and ready for import or editing in the Draw.io interface.

How to install

Prerequisites:

  • Node.js (LTS version) and npm installed on your system
  • Access to a terminal/command prompt
  1. Clone the repository or download the project files

  2. Install dependencies

npm install
  1. Run the MCP server
node index.js
  1. (Optional) Configure per-environment output directory by setting DRAWIO_OUTPUT_DIR in your environment or within your hosting environment. This controls where the generated .drawio files are saved.

  2. If you intend to integrate with Claude Desktop or other clients, prepare the appropriate mcpServers configuration snippet as shown in the README usage examples and load it into the client.

Additional notes

Tips and considerations:

  • By default, the server outputs Draw.io compatible XML; ensure your downstream tooling expects .drawio files.
  • If you want to customize where files are saved, set DRAWIO_OUTPUT_DIR in your environment before starting the server.
  • For large diagrams, consider structuring the data to avoid overly large payloads in a single request.
  • When using the CLI or integration with Claude Desktop, ensure the file path provided in the args points to the diagram generator entry point (index.js) in your deployment environment.
  • If you encounter path or permission errors, verify file write permissions to the output directory and that the node process has access to that path.

Related MCP Servers

Sponsor this space

Reach thousands of developers