software-design-mermaid-mcp

software-design-mermaid-mcp

Enables visual drag-and-drop editing of Mermaid diagrams through Claude, allowing iterative refinement of software architecture designs.

Category
Visit Server

README

<div align="center">

๐ŸŽจ Mermaid Visual Editor for Claude

Stop describing diagrams. Start designing them.

Turn Claude into a visual software design partner with a drag-and-drop Mermaid editor that opens right in your browser.

Tests License: MIT MCP TypeScript Node

Getting Started ยท Features ยท How It Works ยท Contributing

</div>


<div align="center">

Visual diagram editor showing a microservice architecture with drag-and-drop nodes, subgraphs, edge labels, and live Mermaid preview

Claude generates the diagram, you refine it visually โ€” drag nodes, edit labels, draw connections, then submit back for the next iteration

</div>


The Problem

When designing software with Claude, you're stuck in a text-only loop:

You: "Add a cache layer between the API and database"
Claude: *regenerates entire Mermaid diagram from scratch*
You: "No, move the cache node to the left..."
Claude: *guesses what you mean, regenerates again*

It's like directing a painter blindfolded.

The Solution

This MCP server gives Claude a visual canvas. When Claude generates a diagram, it pops open a browser-based editor where you can:

  • Drag nodes exactly where you want them
  • Edit labels inline with a double-click
  • Draw connections between any nodes
  • Rearrange everything and submit back to Claude

Claude sees your visual changes and continues the conversation with full context. Design together, visually.

What is MCP? Model Context Protocol lets AI assistants use external tools. This server gives Claude the ability to open a visual diagram editor โ€” no plugins or extensions needed.


โšก Getting Started

Claude Code (recommended)

git clone https://github.com/wzh4464/software-design-mermaid-mcp.git
cd software-design-mermaid-mcp
npm install && npm run build
claude mcp add software-design-mermaid node $(pwd)/dist/server/index.js

Then just ask Claude:

> Design a microservice architecture for a todo app

Your browser opens automatically with the visual editor. Edit, submit, iterate. โœจ

<details> <summary><b>VS Code + Claude Extension</b></summary>

Add to your VS Code settings.json:

{
  "claude.mcpServers": {
    "software-design-mermaid": {
      "command": "node",
      "args": ["/absolute/path/to/software-design-mermaid-mcp/dist/server/index.js"]
    }
  }
}

</details>

<details> <summary><b>Claude Desktop</b></summary>

Add to claude_desktop_config.json:

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

</details>

<details> <summary><b>Cursor</b></summary>

Add to your Cursor MCP settings (.cursor/mcp.json):

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

</details>

<details> <summary><b>Windsurf / Cline / Other MCP Clients</b></summary>

Any MCP-compatible client can use this server. The configuration pattern is the same:

  • Command: node
  • Args: ["/absolute/path/to/software-design-mermaid-mcp/dist/server/index.js"]
  • Transport: stdio

Refer to your client's documentation for the exact config file location.

</details>


โœจ Features

Feature Description
๐Ÿ–ฑ๏ธ Drag-and-Drop Canvas Full React Flow editor with zoom, pan, minimap, grid snapping
๐Ÿ”ท 5 Shapes ร— 3 Edge Types Rectangle, rounded, diamond, circle, stadium + arrow, dotted, thick
๐Ÿ“ฆ Subgraphs & Auto-Layout Group nodes into nested subgraphs; dagre auto-arranges (TD/LR/BT/RL)
๐Ÿ“ Live Mermaid Preview See Mermaid code update in real-time as you edit
๐Ÿ”„ Multi-Round Iteration Edit โ†’ Submit โ†’ Claude refines โ†’ Edit again. True visual collaboration.
โช Undo / Redo Full history with Ctrl+Z / Ctrl+Y
โš™๏ธ Zero Config Auto-finds an open port and launches your browser

<details> <summary><b>See: Horizontal layout with subgraphs</b></summary>

Horizontal LR layout showing load balancer, backend cluster, and storage subgraphs

</details>


๐Ÿงฉ How It Works

  Claude                    MCP Server                 Browser Editor
    โ”‚                          โ”‚                            โ”‚
    โ”‚โ”€โ”€ show_diagram() โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚                            โ”‚
    โ”‚                          โ”‚โ”€โ”€ starts HTTP server โ”€โ”€โ”€โ”€โ”€>โ”‚
    โ”‚                          โ”‚โ”€โ”€ opens browser โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚
    โ”‚<โ”€โ”€ { url, success } โ”€โ”€โ”€โ”€โ”€โ”‚                            โ”‚
    โ”‚                          โ”‚                            โ”‚
    โ”‚                          โ”‚<โ”€โ”€ polls /api/diagram โ”€โ”€โ”€โ”€โ”€โ”‚
    โ”‚                          โ”‚โ”€โ”€ returns diagram โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚
    โ”‚                          โ”‚                            โ”‚
    โ”‚                          โ”‚          user drags nodes, โ”‚
    โ”‚                          โ”‚          edits labels,     โ”‚
    โ”‚                          โ”‚          draws connections โ”‚
    โ”‚                          โ”‚                            โ”‚
    โ”‚                          โ”‚<โ”€โ”€ POST /api/submission โ”€โ”€โ”€โ”‚
    โ”‚โ”€โ”€ get_diagram_feedback()>โ”‚                            โ”‚
    โ”‚<โ”€โ”€ updated mermaid code โ”€โ”‚                            โ”‚
    โ”‚                          โ”‚                            โ”‚
    โ”‚โ”€โ”€ show_diagram() โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚  (Claude sends new version)โ”‚
    โ”‚   ...iterate...          โ”‚                            โ”‚

MCP Tools

Tool What it does
show_diagram Opens the visual editor with a Mermaid flowchart
get_diagram_feedback Gets the user's visual edits back as Mermaid code
close_diagram Closes the editor session

๐Ÿ—๏ธ Architecture

TypeScript monorepo with npm workspaces:

software-design-mermaid-mcp/
โ”œโ”€โ”€ shared/          # Mermaid parser & serializer (bidirectional)
โ”œโ”€โ”€ src/             # MCP server (stdio) + HTTP server (REST API)
โ”œโ”€โ”€ editor/          # React Flow visual editor
โ””โ”€โ”€ dist/            # Pre-built artifacts
  • Parser: Full Mermaid flowchart syntax โ†’ structured FlowDiagram objects
  • Serializer: FlowDiagram โ†’ valid Mermaid code (round-trip safe)
  • Editor: React 19 + React Flow 12 with custom node/edge renderers

๐Ÿง‘โ€๐Ÿ’ป Development

npm install          # Install all workspace dependencies
npm test             # Run all tests (42 tests, 4 suites)
npm run build        # Build shared โ†’ server โ†’ editor
npm run dev:editor   # Editor dev mode with hot reload

๐Ÿค Contributing

Contributions welcome! Some ideas to get started:

  • ๐Ÿ“Š Sequence diagram support โ€” extend beyond flowcharts
  • ๐ŸŽจ Theme customization โ€” dark/light modes, color schemes
  • ๐Ÿ“ธ Export options โ€” PNG, SVG, PDF export from the editor
  • ๐Ÿ‘ฅ Collaborative editing โ€” multiple users on the same diagram
  • ๐Ÿ”ถ More node shapes โ€” hexagon, parallelogram, trapezoid

Please open an issue first to discuss what you'd like to change.


๐Ÿ“„ License

MIT โ€” use it however you want.


<div align="center">

If this saves you time designing software, consider giving it a โญ

Made with React Flow ยท MCP SDK ยท dagre

</div>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured