Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

drawio-mcp-server

MCP.Pizza Chef: lgazo

The drawio-mcp-server is an MCP server that integrates Draw.io (Diagrams.net) diagramming capabilities into AI agentic systems. It enables seamless connection to Draw.io, allowing programmatic creation, modification, and management of diagrams. The server supports intelligent analysis of diagram components, facilitating advanced AI workflows that incorporate visual modeling and automation. This server empowers developers to build sophisticated AI-enhanced diagramming tools and workflows within the MCP ecosystem.

Use This MCP server To

Create and modify Draw.io diagrams programmatically via MCP commands Retrieve detailed diagram component data for AI processing Automate diagram updates within AI-driven workflows Integrate visual modeling into AI agentic systems Enable AI agents to analyze and reason about diagram structures Build collaborative diagram editing tools with AI assistance

README

Draw.io MCP server

Let's do some Vibe Diagramming with the most wide-spread diagramming tool called Draw.io (Diagrams.net).

Build project

Introduction

The Draw.io MCP server is a Model Context Protocol (MCP) implementation that brings powerful diagramming capabilities to AI agentic systems. This integration enables:

  • Seamless Draw.io Integration: Connect your MCP-powered applications with Draw.io's rich diagramming functionality
  • Programmatic Diagram Control: Create, modify, and manage diagram content through MCP commands
  • Intelligent Diagram Analysis: Retrieve detailed information about diagrams and their components for processing by AI agents
  • Agentic System Development: Build sophisticated AI workflows that incorporate visual modeling and diagram automation

As an MCP-compliant tool, it follows the standard protocol for tool integration, making it compatible with any MCP client. This implementation is particularly valuable for creating AI systems that need to:

  • Generate architectural diagrams
  • Visualize complex relationships
  • Annotate technical documentation
  • Create flowcharts and process maps programmatically

The tool supports bidirectional communication, allowing both control of Draw.io instances and extraction of diagram information for further processing by AI agents in your MCP ecosystem.

Requirements

To use the Draw.io MCP server, you'll need:

Core Components

  • Node.js (v18 or higher) - Runtime environment for the MCP server
  • Draw.io MCP Browser Extension - Enables communication between Draw.io and the MCP server

MCP Ecosystem

  • MCP Client (e.g., MCP Inspector) - For testing and debugging the integration
  • LLM with Tools Support - Any language model capable of handling MCP tool calls (e.g., GPT-4, Claude 3, etc.)

Optional for Development

  • pnpm - Preferred package manager
  • Chrome DevTools - For debugging when using --inspect flag

Note: The Draw.io desktop app or web version must be accessible to the system where the MCP server runs.

Installation

Connecting with Claude Desktop

  1. Install Claude Desktop

  2. Open or create the configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. Update it to include this server:

Using npm
{
   "mcpServers":{
      "drawio":{
         "command":"npx",
         "args":[
            "-y",
            "drawio-mcp-server"
         ]
      }
   }
}
Using pnpm
{
   "mcpServers":{
      "drawio":{
         "command":"pnpm",
         "args":[
            "dlx",
            "drawio-mcp-server"
         ]
      }
   }
}
  1. Restart Claude Desktop

Connecting with oterm

This is an alternative MCP client in case you like terminal and you plan to connect to your own Ollama instance.

The configuration is usually in: ~/.local/share/oterm/config.json

Using npm
{
	"mcpServers": {
		"drawio": {
			"command": "npx",
			"args": [
			  "-y",
        "drawio-mcp-server"
			]
		}
	}
}
Using pnpm
{
	"mcpServers": {
		"drawio": {
			"command": "pnpm",
			"args": [
			  "dlx",
        "drawio-mcp-server"
			]
		}
	}
}

Browser Extension Setup

In order to control the Draw.io diagram, you need to install dedicated Browser Extension.

  1. Open Draw.io in your browser
  2. Install the Draw.io MCP Browser Extension from a web store or use other means

Chrome Web Store Firefox add-ons

3. Ensure it is connected, the Extension icon should indicate green signal overlay

Extension connected

Features

The Draw.io MCP server provides the following tools for programmatic diagram interaction:

Diagram Inspection Tools

  • get-selected-cell Retrieves the currently selected cell in Draw.io with all its attributes Returns: JSON object containing cell properties (ID, geometry, style, value, etc.)

  • get-shape-categories Retrieves available shape categories from the diagram's library Returns: Array of category objects with their IDs and names

  • get-shapes-in-category Retrieves all shapes in a specified category from the diagram's library Parameters:

    • category_id: Identifier of the category to retrieve shapes from Returns: Array of shape objects with their properties and styles
  • get-shape-by-name Retrieves a specific shape by its name from all available shapes Parameters:

    • shape_name: Name of the shape to retrieve Returns: Shape object including its category and style information

Diagram Modification Tools

  • add-rectangle Creates a new rectangle shape on the active Draw.io page with customizable properties:

    • Position (x, y coordinates)
    • Dimensions (width, height)
    • Text content
    • Visual style (fill color, stroke, etc. using Draw.io style syntax)
  • add-edge Creates a connection between two cells (vertexes) Parameters:

    • source_id: ID of the source cell
    • target_id: ID of the target cell
    • text: Optional text label for the edge
    • style: Optional style properties for the edge
  • delete-cell-by-id Removes a specified cell from the diagram Parameters:

    • cell_id: ID of the cell to delete
  • add-cell-of-shape Adds a new cell of a specific shape type from the diagram's library Parameters:

    • shape_name: Name of the shape to create
    • x, y: Position coordinates (optional)
    • width, height: Dimensions (optional)
    • text: Optional text content
    • style: Optional additional style properties

Related Resources

Troubleshooting

Prompt examples

Contributing

Architecture

Development

drawio-mcp-server FAQ

How do I connect the drawio-mcp-server to my MCP client?
You configure your MCP client to communicate with the drawio-mcp-server endpoint, enabling diagram commands and data exchange.
Can the drawio-mcp-server modify existing diagrams?
Yes, it supports programmatic creation and modification of Draw.io diagrams through MCP commands.
What types of diagram data can the server provide?
The server can retrieve detailed information about diagram components, such as shapes, connectors, and metadata, for AI analysis.
Is the drawio-mcp-server compatible with multiple LLM providers?
Yes, it works with models from Open AI, Anthropic Claude, and Google Gemini, facilitating broad AI integration.
Does the server support real-time collaboration features?
While primarily focused on programmatic control, it can be integrated into collaborative workflows with additional tooling.
What programming languages or environments can interact with the drawio-mcp-server?
Any environment that supports MCP protocol communication, including JavaScript, Python, and others, can interact with the server.
How secure is the communication between the MCP client and drawio-mcp-server?
The MCP protocol includes built-in principles for secure, scoped, and observable interactions, ensuring safe communication.
Can the drawio-mcp-server be extended to support custom diagram types?
Yes, developers can extend the server to handle custom diagram elements and workflows within the MCP framework.