Claude Mermaid

Developer toolsDesign and media

MCP Server to previewing mermaid diagrams with live reload.

Your AI app calls the Claude Mermaid MCP server, which does the developer tools and design and media work and sends the result back to the chat.

About Claude Mermaid

Claude Mermaid is a community MCP server from veelenga, filed in our directory under developer tools and design and media. MCP Server to previewing mermaid diagrams with live reload.

Claude Mermaid runs as a remote server at https://fronteir.ai/mcp/veelenga-claude-mermaid, so there is nothing to install: your AI app connects over streamable HTTP, and most remote servers ask you to sign in with OAuth the first time.

The README for Claude Mermaid lists tools such as diagram, preview_id, format and theme, which your AI app can call once the server is connected.

At a glance

Publisher
veelenga (community)
Runs
As a hosted remote server
Written in
TypeScript
License
MIT
GitHub stars
225

Tools Claude Mermaid gives your AI app

  • diagram(string, required), Mermaid diagram code.
  • preview_id(string, required), Identifier for this preview session. Use different IDs for multiple concurrent diagrams (e.g., architecture, flow).
  • format(string, default svg), One of svg, png, pdf. Live preview is available only for svg.
  • theme(string, default default), One of default, forest, dark, neutral.
  • background(string, default white), Background color. Examples: transparent, white, #F0F0F0.
  • size(number, default 800), Maximum diagram width or height in pixels.
  • width, height (number, deprecated), Accepted for compatibility; the larger value is used as size.
  • scale(number, default 2), Scale factor for higher quality output.
  • save_path(string, required), Destination path (e.g., ./docs/diagram.svg).

Tool names as the Claude Mermaid README lists them. Your AI app shows the live list once Claude Mermaid is connected.

How to set up Claude Mermaid

  1. Nothing to install: Claude Mermaid is a remote server, so all you need is an AI app that accepts a remote MCP URL.
  2. Check the Claude Mermaid README for keys or settings; the registry lists none that Claude Mermaid requires.
  3. Add Claude Mermaid to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Claude Mermaid tools to confirm the connection.
  5. Run one read-only task with Claude Mermaid first, such as a call to diagram, before you allow anything that writes or sends.

Claude Mermaid compared with similar servers

  • Embody - MCP Server for TouchDesigner by dylanroscover has fewer GitHub stars than Claude Mermaid (225 against 225); both are community servers, and Embody - MCP Server for TouchDesigner runs on your own machine and Claude Mermaid runs as a remote server.
  • BifrostMCP by biegehydra has fewer GitHub stars than Claude Mermaid (225 against 225); both are community servers, and BifrostMCP runs on your own machine and Claude Mermaid runs as a remote server. The BifrostMCP README lists 1 tools to Claude Mermaid's 9.
  • Glif by glifxyz has fewer GitHub stars than Claude Mermaid (225 against 225); both are community servers, and both run remotely.

Before you connect Claude Mermaid

  • Give Claude Mermaid its own sign-in or token with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Claude Mermaid tool call until you trust what it does with them.
  • Treat text that Claude Mermaid fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Claude Mermaid on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Claude Mermaid

How marketing and sales teams put Claude Mermaid to work, by company size. Pick the size closest to yours and start Claude Mermaid on one use case.

Small business

  • A small business with a developer can use Claude Mermaid to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Claude Mermaid to explain and fix a marketing site issue without context switching between tools.
  • A small business can use Claude Mermaid to resize and adapt one design for every channel instead of hiring for each version.
  • Claude Mermaid runs as a remote server, so a small team can connect it in a few minutes with no install to maintain.

Mid-market

  • Growth engineers can use Claude Mermaid to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Claude Mermaid to keep scripts and automations documented and versioned as they change.
  • Creative teams can connect Claude Mermaid so agents produce variants for testing while designers keep control of the master files.
  • Start with diagram and preview_id, the tools Claude Mermaid lists first, and add more once the team trusts the results.

Enterprise

  • Enterprise engineering teams can roll out Claude Mermaid with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Claude Mermaid so web and marketing engineering share one reviewed way of working with AI.
  • Enterprises can use Claude Mermaid with brand rules and approved assets only, so generated work stays inside the brand system.
  • Claude Mermaid is a community server, so have security review the code and pin a version before Claude Mermaid touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Claude Mermaid README

From veelenga/claude-mermaid on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Claude Mermaid MCP Server

MCP server for rendering Mermaid diagrams in Claude Code with live reload functionality and a built-in skill for expert guidance.

Automatically renders diagrams in your browser with real-time updates as you refine them. Perfect for iterative diagram development and documentation workflows.

✨ Features

  • 🔄 Live Reload - Diagrams auto-refresh in your browser as you edit
  • 🪄 Artifact Mode - Optionally publish diagrams as shareable Claude artifacts instead of running a local server
  • 🎨 Multiple Save Formats - Export to SVG, PNG, or PDF
  • 🌈 Themes - Choose from default, forest, dark, or neutral themes
  • 📐 Customizable - Control dimensions, scale, and background colors
  • 🪄 Interactive Preview - Pan diagrams by dragging, zoom with browser controls, reset position with one click
  • ⬇️ Browser Export - Download diagrams as SVG or PNG directly from the preview
  • 🗂️ Multiple Previews - Use preview_id to work on multiple diagrams simultaneously
  • 💾 Persistent Working Files - Live previews are stored under ~/.config/claude-mermaid/live
  • 🤖 Built-in Skill - Includes a Claude skill with best practices and expert guidance for creating diagrams

Architecture

Project Architecture Diagram
User Workflow Diagram
Dependencies Diagram

🚀 Quick Start

1. Install

Plugin Install (Recommended)

In Claude Code, add the marketplace and install the plugin:

/plugin marketplace add veelenga/claude-mermaid
/plugin install claude-mermaid@claude-mermaid

Then restart Claude Code to activate the plugin.

From npm:

npm install -g claude-mermaid

From source:

git clone https://github.com/veelenga/claude-mermaid.git
cd claude-mermaid
npm install && npm run build && npm install -g .
2. Verify Installation

Plugin install: The MCP server is configured automatically. Just verify:

/mcp

You should see mermaid in the MCP server list.

npm install: Configure the MCP server manually:

claude mcp add --scope user mermaid claude-mermaid

Then verify:

claude mcp list

You should see mermaid: claude-mermaid - ✓ Connected

🔌 Other MCP Client Configurations

While this server is optimized for Claude Code, it can work with any MCP-compatible client. Here's how to configure it for other popular tools:

Codex

Add to your Codex MCP settings file (~/.codex/mcp_settings.json):

{
  "mcpServers": {
    "mermaid": {
      "command": "claude-mermaid"
    }
  }
}

Or configure via Codex CLI:

codex mcp add mermaid claude-mermaid
Cursor

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

{
  "mcpServers": {
    "mermaid": {
      "command": "claude-mermaid"
    }
  }
}

Or use Cursor's settings UI:

  1. Open Cursor Settings (Cmd/Ctrl + ,)
  2. Navigate to MCP Servers
  3. Add a new server with command: claude-mermaid
VSCode with Cline Extension

If using the Cline extension for VSCode:

  1. Open VSCode settings (Cmd/Ctrl + ,)
  2. Search for "Cline MCP"
  3. Add to MCP Settings JSON:
{
  "mcpServers": {
    "mermaid": {
      "command": "claude-mermaid"
    }
  }
}
Windsurf

Add to Windsurf's MCP configuration file:

{
  "mcpServers": {
    "mermaid": {
      "command": "claude-mermaid"
    }
  }
}

Configuration location varies by platform:

  • macOS: ~/Library/Application Support/Windsurf/mcp.json
  • Linux: ~/.config/windsurf/mcp.json
  • Windows: %APPDATA%\Windsurf\mcp.json
Gemini CLI

Add to Gemini CLI's MCP configuration file (~/.gemini/mcp.json):

{
  "mcpServers": {
    "mermaid": {
      "command": "claude-mermaid"
    }
  }
}

Or use the Gemini CLI to configure:

gemini config mcp add mermaid --command claude-mermaid
Other MCP Clients

For any MCP-compatible client, use the standard configuration:

{
  "mcpServers": {
    "mermaid": {
      "command": "claude-mermaid"
    }
  }
}

The command claude-mermaid should be available in your PATH after installation.

Note: Some clients may require the full path to the executable:

  • Find the path: which claude-mermaid (Unix/macOS) or where claude-mermaid (Windows)
  • Use absolute path in config: "command": "/path/to/claude-mermaid"

💡 Usage

Simply ask Claude Code to create Mermaid diagrams naturally. When installed as a plugin, the built-in mermaid-diagrams skill provides expert guidance, best practices, and automatic workflow management.

Basic Examples
"Create a Mermaid diagram showing the user authentication flow"
"Draw a sequence diagram for the payment process"
"Generate a flowchart for the deployment pipeline"
Advanced Examples

With custom formatting:

"Create a dark theme architecture diagram with transparent background"
"Generate a forest theme flowchart and save to ./docs/flow.svg"

With specific output format:

"Create an ER diagram and save as PDF to ./docs/schema.pdf"
"Save the flowchart as PNG to ./docs/flow.png"

Note: Browser always shows SVG for live preview, while saving to your chosen format.

Iterative refinement:

"Create a class diagram for the User module"
// Browser opens with live preview
"Add the Address and Order classes with relationships"
// Diagram updates automatically in browser!
Complete Example
"Create a flowchart and save to ./docs/auth-flow.svg:

graph LR
    A[User Login] --> B{Valid Credentials?}
    B -->|Yes| C[Access Granted]
    B -->|No| D[Access Denied]
    C --> E[Dashboard]
    D --> F[Try Again]

    style A fill:#e1f5ff
    style C fill:#d4edda
    style D fill:#f8d7da
"

The diagram will be saved to ./docs/auth-flow.svg and opened in your browser with live reload enabled.

🔧 Tools and Parameters

There are two tools exposed by the MCP server:

  1. mermaid_preview, render and open a live preview
  • diagram (string, required), Mermaid diagram code
  • preview_id (string, required), Identifier for this preview session. Use different IDs for multiple concurrent diagrams (e.g., architecture, flow).
  • format (string, default svg), One of svg, png, pdf. Live preview is available only for svg.
  • theme (string, default default), One of default, forest, dark, neutral.
  • background (string, default white), Background color. Examples: transparent, white, #F0F0F0.
  • size (number, default 800), Maximum diagram width or height in pixels.
  • width, height (number, deprecated), Accepted for compatibility; the larger value is used as size.
  • scale (number, default 2), Scale factor for higher quality output.
  1. mermaid_save, save the current live diagram to a path
  • save_path (string, required), Destination path (e.g., ./docs/diagram.svg).
  • preview_id (string, required), Must match the preview_id used in mermaid_preview.
  • format (string, default svg), One of svg, png, pdf. If the live working file for this format doesn’t exist yet, it is rendered on demand before saving.

🎯 How Live Reload Works

  1. First render: Opens diagram in browser at http://localhost:3737/{preview_id}
  2. Make changes: Edit the diagram through Claude Code
  3. Auto-refresh: Browser detects changes via WebSocket and reloads
  4. Status indicator: Green dot = connected, Red dot = reconnecting

The live server uses ports 3737-3747 and automatically finds an available port.

Live Preview Controls
  • Pan: Click and drag the diagram to move it around
  • Zoom: Use browser zoom (Ctrl/Cmd + +/- or pinch-to-zoom on trackpad)
  • Reset Position: Click the ⊙ button in the status bar to recenter the diagram
  • Export: Click the ⬇ button to download as SVG or PNG
Notes
  • Live preview is available for svg format only; PNG/PDF are rendered without live reload.
  • For sequence diagrams, Mermaid does not support style directives inside sequenceDiagram.

🪄 Artifact mode

Instead of the local live server, mermaid_preview can write a self-contained HTML page that Claude publishes as a Claude artifact. Updates republish to the same URL, so the link is easy to share.

Ask for it in plain words, for example "show this diagram as an artifact". To make it the default, set CLAUDE_MERMAID_PREVIEW=artifact in the server's env, or export it in your shell for plugin installs.

  • The page has pan, zoom and copy SVG controls. No server is started and no browser tab is opened.
  • Only the svg format gets an artifact page.
  • It needs a host with the Artifact tool, such as Claude Code.

🖥️ Standalone server

You can start the preview server without an AI agent using the --serve flag:

claude-mermaid --serve

This opens the diagram gallery in your browser with all previously rendered diagrams. Useful for browsing and exporting diagrams outside of a Claude Code session.

🛠️ Development

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Watch mode for development
npm run dev

# Start the MCP server directly
npm start

📝 Troubleshooting

Error: Cannot find package 'puppeteer':

This is a rare environment-specific issue. Try these solutions:

  1. Install claude-mermaid globally:

    npm install -g claude-mermaid
    
  2. Reinstall the plugin in Claude Code:

    /plugin uninstall claude-mermaid
    /plugin install claude-mermaid@claude-mermaid
    

Server not connecting:

# Check if server is installed
claude-mermaid -v

# Reinstall if needed
npm install -g claude-mermaid

# Verify MCP configuration
claude mcp list

Permission denied error:

# Make sure the binary is executable
chmod +x $(which claude-mermaid)

Port already in use:

  • The server uses ports 3737-3747
  • It will automatically find an available port
  • Check if another process is using these ports: lsof -i :3737-3747

Diagrams not rendering or live reload not working:

The server logs to ~/.config/claude-mermaid/logs/:

  • mcp.log - Tool requests and diagram rendering
  • web.log - HTTP/WebSocket connections and live reload

Enable debug logging in your MCP config:

{
  "mcpServers": {
    "mermaid": {
      "command": "claude-mermaid",
      "env": {
        "CLAUDE_MERMAID_LOG_LEVEL": "DEBUG"
      }
    }
  }
}

Then check the logs:

# View MCP operations
tail -f ~/.config/claude-mermaid/logs/mcp.log

# View WebSocket connections
tail -f ~/.config/claude-mermaid/logs/web.log

Available log levels: DEBUG, INFO (default), WARN, ERROR, OFF

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT - see LICENSE file for details

🔗 Links

👀 See Also

If you like this project, you might also be interested in

  • preview-skills, preview skills for visualizing files in the browser (markdown, csv, json, mermaid and more)

Hosted deployment

A hosted deployment is available on Fronteir AI.

Questions about Claude Mermaid

What is the Claude Mermaid MCP server?

MCP Server to previewing mermaid diagrams with live reload. Claude Mermaid is maintained by veelenga on GitHub at veelenga/claude-mermaid, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I add Claude Mermaid to Claude Code?

Claude Mermaid is a remote server, so you add its URL instead of installing a package: run claude mcp add --transport http claude-mermaid https://fronteir.ai/mcp/veelenga-claude-mermaid in your terminal. In other apps, add the Claude Mermaid URL as a remote or custom connector.

Does Claude Mermaid need an API key?

The registry lists no required keys for Claude Mermaid. Check the Claude Mermaid README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Claude Mermaid an official MCP server?

No. Claude Mermaid is a community server maintained by veelenga. Community servers can be excellent; read the code and the open issues before you give Claude Mermaid access to company data.

What license is Claude Mermaid under?

Claude Mermaid is released under the MIT license, according to its GitHub repository. The license covers the code of Claude Mermaid; the service it connects to has its own terms.