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
访问服务器

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>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选