Mermaid diagram

Updated

A Mermaid diagram is a diagram written in Mermaid, an open source, JavaScript based tool that renders diagrams from a simple text syntax. A few lines of text describe the nodes and their connections, and Mermaid draws the flowchart, sequence diagram or chart. It is one of the most widely used forms of diagram as code.

How Mermaid syntax works

Each diagram starts with a keyword for its type, followed by lines that define elements and links.

flowchart TD
  A[Order received] --> B{In stock?}
  B -- Yes --> C[Ship order]
  B -- No --> D[Notify customer]

flowchart TD asks for a flowchart drawn from top to bottom. Square brackets make a box, curly brackets make a decision, and arrows connect them, with optional labels on the arrows.

Types of Mermaid diagrams

Mermaid supports many diagram types, including:

Where Mermaid is used

Mermaid renders in many places where people already write Markdown, such as GitHub, documentation sites and note taking apps. That makes it popular for README files, technical documentation and design notes. AI assistants also often answer with Mermaid when asked for a diagram, because it is compact and easy to generate as text.

Advantages and limitations

Mermaid diagrams are quick to write, easy to keep in version control and consistent in style. The main limits are layout and editing. Positions are chosen automatically, so a large diagram can become hard to read, and changing one requires editing the text, which is unfamiliar to people outside engineering. A Mermaid block in a chat or a file is also static: nobody can drag a box, add a comment or continue the discussion on it.

Tips for readable Mermaid diagrams

  1. Keep each diagram small. Split a large system into several diagrams.

  2. Use clear node labels. Short identifiers with full text labels are easiest to maintain.

  3. Choose the direction. Top to bottom suits processes, left to right suits pipelines.

  4. Label decisions. Put the condition on each outgoing arrow.

Example

Sam documents a deployment pipeline in a README with six lines of Mermaid: build, test, a decision for whether tests pass, deploy to staging and deploy to production. When a security scan is added, he inserts one line and the diagram redraws.

Mermaid diagrams in MockFlow

The Mermaid diagram editor artifact brings Mermaid onto a MockFlow board, next to the rest of the team's work. If you would prefer not to write syntax, the AI diagram generator builds editable diagrams from a description, and AI apps can create boards through the MockFlow MCP server. See also text to diagram and whiteboard for developers.

MockFlow

Turn ideas into plans on one board.

No account needed
mockflow.com/new

Open a blank board in one click. Boards last 24 hours, so sign up to keep one.

MCPBrainstorm with MockFlow MCP

Add MockFlow as an MCP connector in Claude, Cursor, or any MCP-compatible AI assistant to generate flowcharts, mindmaps, architecture diagrams, and 16 types of visualizations.

Desktop App MCP Powerful
CLI Web MCP Developer
Web MCP Easiest

Built into the MockFlow Desktop App. AI creates visuals directly on your open canvas — no URLs, no waiting.

1
Open Desktop App → open a MockFlow project
2
In Claude Code / Cursor, run:
claude mcp add --transport http -s user mockflow-ideaboard http://localhost:21193/mcp
3
Ask: "Create a flowchart for..."

Best for: Designers, product teams, daily MockFlow users.

Download Desktop App →

Install from npm, log in via browser (OAuth), and boards are saved to your MockFlow account.

1
npm install -g @mockflow/ideaboard-mcp
2
mockflow-ideaboard-mcp login
3
mockflow-ideaboard-mcp

Best for: Developers using Claude Code, Cursor, or VS Code Copilot.

npm Package →

Add MockFlow as a connector in Claude.ai or ChatGPT. No installation. A new board is created and you get a shareable URL.

1
Open Claude.ai → Settings → Connectors
2
Paste this URL, then click Connect and sign in to MockFlow: https://app.mockflow.com/ideaboard/connector/mcp
3
Ask Claude to create a flowchart — done!

ChatGPT: use https://app.mockflow.com/ideaboard/mcp and save its boards to your account to keep them

Best for: Managers, marketers, anyone using Claude.ai or ChatGPT in the browser.

Welcome back
Don't have an account? Sign up

Faster ways in

Sign in with an account you already use.