Skip to main content
Glama

fcp-drawio

MCP server for creating and editing draw.io diagrams through intent-level commands.

What It Does

fcp-drawio lets LLMs build architecture diagrams, flowcharts, and system maps by describing what they want -- not how to draw it. The LLM sends high-level operations like add svc AuthService theme:blue and connect AuthService -> UserDB, and fcp-drawio renders them into fully styled draw.io XML, positioning shapes with near:/dir: heuristics and collision avoidance by default -- or hands off to an ELK auto-layout pass on demand via the layout op. Built on the FCP framework.

Related MCP server: drawio-mcp

Quick Example

drawio([
  'add svc AuthService theme:blue',
  'add db UserDB theme:green near:AuthService dir:right',
  'connect AuthService -> UserDB label:queries',
])

Response:

+svc AuthService @(200,200 140x60) blue
+db UserDB @(400,200 120x80) green
~AuthService->UserDB "queries" solid
digest: 3s 1e 0g

This produces a draw.io diagram with a blue rounded-rectangle service node, a green database cylinder, and a labeled edge between them -- all positioned automatically.

Available MCP Tools

Tool

Purpose

drawio(ops)

Batch mutations -- add shapes, connect, style, group, layout

drawio_query(q)

Inspect the diagram -- map, list, describe, connections, find

drawio_session(action)

Lifecycle -- new, open, save, checkpoint, undo, redo

drawio_help()

Full reference card

Component Library

Type

Shape

Use For

svc

Rounded rect

Services, components

db

Cylinder

Databases, storage

api

Hexagon

APIs, gateways

queue

Parallelogram

Queues, streams

cloud

Cloud

External services

actor

Person

Users, personas

doc

Document

Files, reports

box

Rectangle

Generic

decision

Diamond

Decisions, conditions

circle

Ellipse

States, events

process

Double-bordered rect

Predefined processes

triangle

Triangle

Warnings, deltas

Themes

Apply color themes to any shape: blue, green, red, orange, purple, yellow, gray, dark.

Installation

Requires Node >= 22.

npm install @ostk-ai/fcp-drawio

MCP Client Configuration

{
  "mcpServers": {
    "drawio": {
      "command": "node",
      "args": ["node_modules/@ostk-ai/fcp-drawio/dist/index.js"]
    }
  }
}

Architecture

4-layer architecture:

MCP Server (Intent Layer)
  src/server/ -- Parses op strings, resolves refs, dispatches
        |
Semantic Model (Domain Brain)
  src/model/ -- In-memory entity graph, event sourcing
        |
Layout
  Default: near/dir positioning heuristics + collision-pushing
  On demand: `layout` op runs elkjs (layered/force/tree, flow:TB/LR/BT/RL)
        |
Serialization (XML)
  src/serialization/ -- Semantic model <-> mxGraphModel XML

Supporting modules:

  • src/parser/ -- Operation string parser

  • src/lib/ -- Component library, themes, stencils, draw.io CLI integration

See docs/examples/ for example diagrams (including the multiplayer game backend) and docs/ for design documents.

Development

npm install
npm run build     # tsc
npm test          # vitest, 498 tests
npm run test:watch
npm run dev       # tsc --watch

License

MIT

Available Tools

4 tools
drawioA

Execute drawio operations. Each op string follows the FCP verb DSL.

SHAPES: add TYPE LABEL [theme:T] [near:REF dir:DIR] [at:X,Y] [size:WxH] [label:"Display Name"] remove REF | remove @SELECTOR define NAME base:TYPE [theme:T] [badge:"text"] [size:WxH]

CONNECTIONS: connect SRC ARROW TGT [label:"text"] [style:STYLE] [exit:FACE entry:FACE] disconnect SRC -> TGT

APPEARANCE: style REF [fill:#HEX] [stroke:#HEX] [font:#HEX] [fontSize:N] [bold] [italic] label REF "new text" | label SRC -> TGT "new text" badge REF "text" [pos:POSITION]

POSITION: move REF to:X,Y | to:REGION | near:REF dir:DIR resize REF to:WxH swap REF REF layout @all algo:layered|force|tree dir:TB|LR|BT|RL [spacing:N] orient TB|LR|BT|RL

ORGANIZATION: group REF REF ... as:"Group Name" ungroup "Group Name"

STRUCTURE: page add|switch|remove|list "Name" layer create|switch|show|hide|list "Name"

META: checkpoint NAME title "Diagram Title" load list | load PACK

VISUAL: export [inline|file] [fmt:png|svg|pdf] [width:N] [height:N] [page:N] [as:PATH]

NODE TYPES: box plain rectangle (generic) svc rounded rectangle (services, components) circle ellipse (states, events) decision diamond (decisions, conditions) db cylinder (databases, storage) api hexagon (apis, gateways) cloud cloud (external services) actor person shape (users, personas) doc document shape (files, reports) queue parallelogram (queues, streams) triangle triangle (warnings, deltas) process double-bordered rect (predefined processes)

THEMES (FILL / STROKE): blue #dae8fc / #6c8ebf green #d5e8d4 / #82b366 red #f8cecc / #b85450 yellow #fff2cc / #d6b656 orange #ffe6cc / #d79b00 purple #e1d5e7 / #9673a6 gray #f5f5f5 / #666666 dark #1a1a2e / #16213e (light text) white #ffffff / #000000

EDGE STYLES: solid, dashed (- - -), dotted (· · ·), animated, thick, curved, orthogonal Arrows: -> (directed), <-> (bidirectional), -- (undirected) Arrow heads: arrow, open-arrow, diamond, circle, crow-foot, none

SELECTORS: @type:TYPE, @group:NAME, @connected:REF, @recent, @recent:N, @all, @orphan, @page:NAME, @layer:NAME

RESPONSE PREFIXES:

  • shape created ~ edge created/modified

  • shape modified - shape/edge removed ! group operation @ layout/position change

CONVENTIONS:

  • Labels are unique identifiers - no ID management needed

  • Position auto-computed if omitted (near last created shape)

  • near:REF dir:DIRECTION places relative to existing shape

  • All XML structure, IDs, and geometry handled by the tool

  • Call drawio_help for full reference with examples

Inputs: ops (required).

drawio_helpA

Returns the drawio FCP reference card.

Inputs: no named parameters.

drawio_queryA

Query drawio state. Read-only.

Inputs: q (required).

drawio_sessionC

drawio lifecycle: new, open, save, checkpoint, undo, redo.

Inputs: action (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 4 tools

    Disambiguation4/5

    The four tools have distinct purposes: drawio performs all diagram operations, drawio_help provides reference, drawio_query is read-only, and drawio_session manages lifecycle. However, the monolithic drawio tool bundles many actions into one, causing potential ambiguity for the agent when selecting the exact operation needed.

    Naming Consistency5/5

    All tool names follow a consistent 'drawio_<suffix>' pattern (drawio, drawio_help, drawio_query, drawio_session), making it predictable and easy to navigate.

    Tool Count2/5

    With only 4 tools for a complex diagramming domain, the count is too low. The main drawio tool alone encapsulates dozens of operations (shapes, connections, appearance, layout, etc.), which should ideally be split into multiple focused tools to avoid overloading the agent.

    Completeness4/5

    The monolithic drawio tool covers a broad range of operations: shapes, connections, styles, grouping, pages, layers, export, etc. Minor gaps might exist (e.g., importing), but the overall functionality is comprehensive for creating and editing diagrams.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to programmatically create and manage flowcharts, ERDs, and swimlane diagrams. It provides tools for manipulating diagram structures, performing auto-layouts, and exporting to Mermaid or Markdown formats.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables LLMs to create and open diagrams in draw.io using XML, Mermaid, or CSV formats, by building a URL with compressed content and opening it in the browser.
      3
      85 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for generating diagrams, charts, and visualizations using Gemini image generation on Vertex AI. Supports auto-detection of diagram types, multiple style modes, and iterative refinement.
      3
      67 npm
      1
      MIT