Skip to main content
Glama
mermaid-to-excalidraw-mcp

mermaid-to-excalidraw-mcp

by yannick-cw

mermaid-to-excalidraw-mcp

MCP server that converts Mermaid diagrams to styled Excalidraw files.

Generated with Claude Code. AI slop included, but it helps me every day :)

The Problem

When asking Claude to create diagrams, you have two bad options:

  1. Generate Excalidraw JSON directly - Works, but costs ~500 tokens per shape. A simple 5-node diagram = 2500+ tokens of JSON in Claude's response.

  2. Use existing mermaid-to-excalidraw - Token-efficient input, but strips all colors and requires a browser.

Related MCP server: mermaid-live-mcp

The Solution

This MCP server lets Claude write compact Mermaid (30 tokens) and outputs styled .excalidraw.md files directly to disk - no tokens wasted on JSON output.

You: "Create an architecture diagram: React -> API -> PostgreSQL + Redis"

Claude writes: ~50 tokens of Mermaid
Output: Styled diagram saved to file

Example flowchart

Setup

git clone https://github.com/yannick-cw/mermaid-to-excalidraw-mcp
cd mermaid-to-excalidraw-mcp && npm install && npm run build

Add to ~/.claude.json:

{
  "mcpServers": {
    "mermaid-excali": {
      "command": "node",
      "args": ["/absolute/path/to/mermaid-to-excalidraw-mcp/dist/index.js"]
    }
  }
}

Usage

Just ask Claude to create a diagram and specify where to save it:

"Create an ER diagram for a blog system with users, posts, and comments. Save to ~/diagrams/blog.excalidraw.md"

The output file opens directly in Obsidian (with Excalidraw plugin) or can be imported to excalidraw.com.

Features

Diagram types: Flowcharts, sequence diagrams, ER diagrams

Semantic colors - Add a directive to color nodes by type:

%%{excali: styles: {FE: ui, API: api, DB: db, Cache: cache}}%%
flowchart TD
    FE[React App] --> API[Node Service]
    API --> DB[(PostgreSQL)]
    API --> Cache[Redis]

Available styles: ui api db cache queue gateway external agent storage user orchestrator problem solution highlight

Connected arrows - shapes stay linked when you move them

Embedded source - original Mermaid preserved in the file for portability

More Examples

Sequence diagram

ER diagram

Inspired by

Available Tools

2 tools
convertA

Convert a Mermaid diagram to a styled Excalidraw file in Obsidian format. Supports flowcharts, sequence diagrams, and ER diagrams. Use %%{excali: styles: {nodeId: styleType}}%% directive for explicit styling. Style types: ui, api, db, cache, queue, gateway, external, agent, storage, user, orchestrator, problem, solution, highlight.

Inputs: mermaid (required), outputPath.

list_stylesB

List all available style types and their colors

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 2 tools

    Disambiguation4/5

    The two tools are clearly distinct: convert performs a transformation action, while list_styles retrieves metadata. There's no overlap in purpose. The only minor concern is that list_styles could arguably be a helper within convert, but as separate tools they're unambiguous.

    Naming Consistency5/5

    Both tools use a consistent verb-first snake_case pattern: convert and list_styles. The naming follows a predictable convention with concise, descriptive verbs that clearly indicate the action each tool performs.

    Tool Count2/5

    With only 2 tools for what appears to be a conversion-focused server, the surface feels quite thin. A tool like this would reasonably benefit from additional tools such as getting validation feedback, converting to different output formats, or inspecting diagrams before conversion. Two tools barely constitutes a functional server.

    Completeness3/5

    The core conversion workflow is covered (convert + style discovery), but there are notable gaps. There's no validate/preview tool to check a Mermaid diagram before converting, no way to batch convert multiple diagrams, and no handling for additional diagram types beyond the three mentioned. The surface works for basic usage but has dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that generates Mermaid diagrams with live browser preview, supports real-time rendering and SVG/PNG export.
      13
      -
    • F
      license
      A
      quality
      B
      maintenance
      An MCP server that generates standalone SVG architecture diagrams from text descriptions, running entirely on your machine with no dependencies or network access.
      8
      -