drio
Open app

Mermaid Validator

Source

A Model Context Protocol server that validates and renders Mermaid diagrams.

Catalog onlyCatalog onlySTDIO

Overview

Mermaid Validator is a Model Context Protocol server that validates and renders Mermaid diagrams, enabling LLMs to ensure the correctness of diagram syntax and produce visual representations.

To use the Mermaid Validator, configure your MCP client by adding it to your mcp servers file with the appropriate command and arguments to invoke the validator.

  • Validates Mermaid diagram syntax and returns rendered SVG output. - Integrates with the Model Context Protocol for seamless client communication. - Provides detailed error messages for invalid diagrams.
  1. Validating and rendering flowcharts for documentation.
  2. Ensuring the correctness of UML diagrams in software design.
  3. Generating visual representations of complex data flows.

Add to your AI client

Use these steps to connect Mermaid Validator in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "mcp-mermaid-validator-rtuin": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mermaid-validator-rtuin"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "mcp-mermaid-validator-rtuin": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mermaid-validator-rtuin"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "mcp-mermaid-validator-rtuin": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mermaid-validator-rtuin"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "mcp-mermaid-validator-rtuin": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mermaid-validator-rtuin"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-mermaid-validator-rtuin": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mermaid-validator-rtuin"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "mcp-mermaid-validator-rtuin": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-mermaid-validator-rtuin"
      ]
    }
  }
}

FAQ

Can Mermaid Validator handle all types of Mermaid diagrams?

Yes! It supports various diagram types defined in the Mermaid syntax.

Is there a limit to the complexity of diagrams?

While there is no strict limit, very complex diagrams may affect performance and rendering time.

How can I troubleshoot validation errors?

The validator provides detailed error messages to help identify and fix issues in the diagram syntax.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3237,"uuid":"1d7fef20-1671-4763-9b33-11d47c384181","name":"mcp-mermaid-validator","title":"Mermaid Validator","description":"A Model Context Protocol server that validates and renders Mermaid diagrams.","avatar_url":"","created_at":"2025-03-18T09:26:52.455Z","updated_at":"2025-03-18T14:08:39.434Z","status":"created","author_name":"rtuin","author_avatar_url":null,"tags":"mcp,mermaid-validator,diagram-rendering","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/rtuin/mcp-mermaid-validator","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":"9fee2b5e-b558-4820-8ca5-8cf1166704ef","tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]