drawio-mcp-server
MCP ServerFreeDraw.io Model Context Protocol (MCP) Server
Capabilities12 decomposed
mcp protocol bridge for draw.io diagram operations
Medium confidenceImplements the Model Context Protocol (MCP) specification to expose Draw.io as a callable tool interface for LLM clients like Claude Desktop and oterm. The server receives structured tool calls from MCP clients, translates them into Draw.io operations via a WebSocket-connected browser extension, and returns structured responses back through the MCP protocol. Uses the @modelcontextprotocol/sdk (v1.10.1) for protocol implementation and event-driven message routing through Node.js EventEmitter.
Uses event-driven architecture with decoupled message bus (bus_request_stream and bus_reply_stream) to separate MCP protocol handling from WebSocket communication, enabling bidirectional LLM-to-Draw.io integration without direct API access
First MCP server for Draw.io, enabling native integration with Claude and other MCP clients without requiring custom API wrappers or REST middleware
websocket-based real-time browser extension communication
Medium confidenceOperates a uWebSockets.js server on port 3000 that maintains persistent WebSocket connections with the Draw.io MCP Browser Extension, enabling real-time bidirectional message exchange. Commands from MCP clients are queued and sent to the extension, which executes them in the Draw.io DOM context and returns results asynchronously. The event bus (Node.js EventEmitter) decouples incoming MCP requests from outgoing WebSocket messages, allowing multiple concurrent diagram operations.
Uses uWebSockets.js (high-performance C++ WebSocket library) with event-driven message bus decoupling to handle concurrent MCP requests without blocking browser extension communication, enabling non-blocking async operation queuing
Faster and more responsive than polling-based approaches; event-driven architecture prevents head-of-line blocking when multiple diagram operations are queued simultaneously
browser extension protocol handshake and connection management
Medium confidenceManages WebSocket connection lifecycle with the Draw.io MCP Browser Extension, including initial handshake, connection validation, and graceful disconnection handling. When the extension connects, the server validates the connection, registers event listeners for incoming messages, and begins routing MCP requests to the extension. On disconnection, the server cleans up event listeners and queues pending operations for retry or failure notification to MCP clients.
Implements explicit handshake validation with the browser extension to ensure protocol compatibility before routing MCP requests, preventing invalid operations on incompatible extension versions
Handshake validation catches version mismatches early; cleaner than silent failures when extension protocol changes
tool registry and dynamic tool exposure to mcp clients
Medium confidenceMaintains a registry of available tools (add-rectangle, update-cell-properties, delete-cell, etc.) with their schemas, descriptions, and input/output specifications. When an MCP client connects, the server exposes this tool registry through the MCP protocol, allowing clients to discover available operations and their parameters. Tools are dynamically loaded from the tool system and registered with their zod schemas, enabling MCP clients to understand tool capabilities without hardcoding.
Exposes tool registry through MCP protocol with full schema information, enabling LLM clients to understand tool capabilities and constraints without external documentation
Dynamic tool discovery is more flexible than hardcoded tool lists; schema exposure enables LLM agents to generate valid tool calls without trial-and-error
diagram element inspection and metadata retrieval
Medium confidenceProvides tools to query the current state of a Draw.io diagram without modifying it: get-selected-cell retrieves properties of the currently selected element, get-shape-categories lists available shape libraries, get-shapes-in-category enumerates shapes within a category, and get-shape-by-name finds specific shapes by name. These tools execute read-only queries through the WebSocket connection to the browser extension, which accesses the Draw.io DOM to extract metadata and return structured JSON responses.
Implements read-only query tools that execute in the Draw.io DOM context through the browser extension, providing direct access to diagram metadata without requiring diagram export or serialization
Faster than exporting and parsing diagram XML; provides real-time access to current diagram state without round-tripping through file I/O
diagram element creation with schema-validated properties
Medium confidenceProvides tools to create diagram elements (rectangles, circles, diamonds, text, connectors) with validated properties using zod schema validation. Tools like add-rectangle, add-circle, add-diamond, add-text, and add-connector accept structured input parameters (position, size, style, label, connections) that are validated against predefined schemas before being sent to the Draw.io extension. The extension executes the creation in the Draw.io DOM and returns the created element's ID and properties.
Uses zod schema validation to enforce input correctness before WebSocket transmission, preventing invalid diagram operations from reaching the browser extension and reducing round-trip error handling
Schema validation at the server layer catches errors early and provides clear error messages to LLM clients; faster than trial-and-error approaches where invalid operations are sent to Draw.io and rejected
diagram element modification and property updates
Medium confidenceProvides tools to modify existing diagram elements after creation: update-cell-properties changes properties of a selected or specified element (label, style, position, size), delete-cell removes elements from the diagram, and style-cell applies predefined or custom styling. Modifications are sent through the WebSocket connection to the browser extension, which updates the Draw.io DOM and returns confirmation with updated element state. Uses event-driven message routing to queue modifications and handle asynchronous responses.
Separates element creation from modification into distinct tools, allowing LLM agents to create a diagram structure first, then refine properties in a second pass without re-creating elements
Enables iterative diagram refinement without full diagram regeneration; more efficient than recreating elements when only properties change
connector and relationship creation with validation
Medium confidenceProvides the add-connector tool to create connections between diagram elements with validated source and target element IDs. The tool accepts source element ID, target element ID, and optional label/style properties, validates the IDs exist, and sends the connector creation request through WebSocket to the Draw.io extension. The extension creates the connector in the DOM and returns the connector's ID and properties, enabling programmatic relationship mapping in diagrams.
Validates element IDs before sending connector creation request, preventing orphaned connectors and ensuring diagram structural integrity at the server layer
Server-side validation prevents invalid connectors from being created in Draw.io; reduces error handling complexity in LLM agents by failing fast with clear error messages
event-driven message bus for asynchronous operation coordination
Medium confidenceImplements a Node.js EventEmitter-based message bus with two primary event streams: bus_request_stream for commands flowing from MCP clients to Draw.io, and bus_reply_stream for results flowing back from the browser extension to MCP clients. This decouples the MCP protocol layer from WebSocket communication, allowing multiple concurrent tool calls to be queued and processed asynchronously without blocking. Requests are assigned unique IDs (via nanoid v5.1.5) to correlate responses with requests.
Uses Node.js EventEmitter as a lightweight message bus to decouple MCP protocol handling from WebSocket communication, enabling non-blocking concurrent operation processing without external message queue infrastructure
Simpler than external message brokers (RabbitMQ, Redis) for single-server deployments; enables concurrent operations without adding operational complexity
structured logging with request tracing
Medium confidenceIntegrates pino v9.6.0 logging library to provide structured JSON logging with request ID correlation. Each MCP request and WebSocket message is logged with its unique ID, operation type, timestamp, and result status. Logs include both request entry points and response completion, enabling end-to-end tracing of diagram operations through the system. Logging is configurable and outputs to stdout/stderr with optional file rotation.
Uses pino's structured JSON logging with request ID correlation to enable end-to-end tracing of diagram operations across MCP and WebSocket layers without external instrumentation
Structured JSON logging is more queryable and machine-parseable than text logs; request ID correlation enables tracing without distributed tracing infrastructure
tool schema definition and validation with zod
Medium confidenceDefines all MCP tool inputs using zod v3.24.3 schemas, providing runtime validation and type safety for tool parameters. Each tool (add-rectangle, update-cell-properties, etc.) has a corresponding zod schema that validates input types, required fields, and value constraints (e.g., numeric ranges for coordinates). Invalid inputs are rejected with detailed error messages before being sent to the Draw.io extension, ensuring only valid operations reach the browser.
Uses zod schemas to provide runtime validation with detailed error messages, enabling LLM clients to understand and correct invalid tool parameters without trial-and-error
Zod validation is more flexible than TypeScript types alone; provides runtime safety for LLM-generated parameters that may not match expected types
unique id generation for diagram elements
Medium confidenceUses nanoid v5.1.5 to generate unique, URL-safe IDs for diagram elements created through the MCP server. Each new element (rectangle, circle, connector, etc.) is assigned a unique ID that persists for the element's lifetime in the diagram. IDs are also used to correlate asynchronous MCP requests with WebSocket responses, enabling request-response matching in the event bus.
Uses nanoid for collision-resistant ID generation with URL-safe encoding, enabling safe serialization in logs and WebSocket messages without escaping
nanoid is faster and more collision-resistant than UUID v4; URL-safe encoding eliminates need for escaping in JSON and URLs
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with drawio-mcp-server, ranked by overlap. Discovered automatically through the match graph.
Playwright MCP Server
Automate browsers and run web tests via Playwright MCP.
playwright-mcp
Playwright MCP server
ECharts
** - Generate visual charts using [ECharts](https://echarts.apache.org) with AI MCP dynamically, used for chart generation and data analysis.
@drawio/mcp
Official draw.io MCP server for LLMs - Open diagrams in draw.io editor
playwright-mcp
Playwright MCP server
mcp-chrome
Chrome MCP Server is a Chrome extension-based Model Context Protocol (MCP) server that exposes your Chrome browser functionality to AI assistants like Claude, enabling complex browser automation, content analysis, and semantic search.
Best For
- ✓AI engineers building LLM agents that need to generate technical diagrams
- ✓Teams automating documentation workflows with diagram generation
- ✓Developers integrating Draw.io into MCP-compatible AI applications
- ✓Interactive diagram generation workflows requiring sub-second feedback
- ✓Multi-step diagram construction where each step depends on previous results
- ✓Applications needing real-time synchronization between LLM decisions and diagram state
- ✓Production deployments requiring reliable extension communication
- ✓Applications needing graceful degradation when extension is unavailable
Known Limitations
- ⚠Requires Draw.io MCP Browser Extension to be installed and running — cannot operate standalone
- ⚠WebSocket communication adds ~100-200ms latency per operation due to browser extension round-trip
- ⚠Limited to operations exposed through the tool system — arbitrary Draw.io API calls not supported
- ⚠WebSocket connection requires browser extension to be actively running — disconnection breaks all operations
- ⚠Port 3000 must be available and accessible from the browser context
- ⚠No built-in reconnection logic — connection loss requires manual restart
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: Apr 22, 2026
About
Draw.io Model Context Protocol (MCP) Server
Categories
Alternatives to drawio-mcp-server
Are you the builder of drawio-mcp-server?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →