trackmcp
Back to directory
iishyfishyy

mermaid-live-mcp

View on GitHub

mermaid-live-mcp

12 stars TypeScriptOthers Updated Jun 14, 2026
claudecursordiagramsmcpmcp-servermermaidmodel-context-protocolwindsurf

Documentation

mermaid-live-mcp

MCP server for generating Mermaid diagrams with live browser preview. Renders diagrams in real-time and supports SVG/PNG export.

Install

Claude Desktop

Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):

json
{
  "mcpServers": {
    "mermaid": {
      "command": "npx",
      "args": ["-y", "mermaid-live-mcp"]
    }
  }
}

Cursor

Add to `.cursor/mcp.json` in your project root:

json
{
  "mcpServers": {
    "mermaid": {
      "command": "npx",
      "args": ["-y", "mermaid-live-mcp"]
    }
  }
}

Claude Code

bash
claude mcp add mermaid -- npx -y mermaid-live-mcp

Windsurf

Add to `~/.codeium/windsurf/mcp_config.json`:

json
{
  "mcpServers": {
    "mermaid": {
      "command": "npx",
      "args": ["-y", "mermaid-live-mcp"]
    }
  }
}

Tools

ToolDescription
`generate_mermaid`Generate a diagram from Mermaid syntax and open a live preview in the browser
`update_diagram`Replace a diagram's Mermaid syntax and re-render the live preview
`list_diagrams`List all diagrams generated in the current session
`export_diagram`Write a diagram's SVG to disk

How it works

When you ask your AI assistant to create a diagram, `mermaid-live-mcp` will:

1. Parse the Mermaid syntax

2. Open a browser tab with a live preview

3. Render the diagram as SVG in real-time via WebSocket

4. Provide download buttons for SVG and PNG export

Updates to a diagram are pushed instantly to the browser — no page refresh needed.

Supported diagram types

All Mermaid diagram types are supported, including flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, git graphs, mindmaps, timelines, and more.

Development

bash
pnpm install
pnpm build

Project structure

PackageDescription
`packages/mcp-server`MCP server (published as `mermaid-live-mcp`)
`packages/preview`Live browser preview via WebSocket
`packages/core`Diagram parsing, layout, and SVG rendering
`packages/cli`Command-line interface

License

MIT

Frequently asked questions

What is mermaid-live-mcp?

mermaid-live-mcp is mermaid-live-mcp

How do I install mermaid-live-mcp?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is mermaid-live-mcp open source?

Yes — it is hosted on GitHub at https://github.com/iishyfishyy/mermaid-live-mcp and has 12 stars.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP