Mermaid MCP Server

Python MCP Server abstracting the official mermaid-cli for ease of use

Local serverstdioPython

What is the Mermaid MCP Server?

Python MCP Server abstracting the official mermaid-cli for ease of use

What you get

A Model Context Protocol (MCP) server for validating Mermaid diagrams.

Python MCP server for validating Mermaid diagrams and (optionally) rendering them as PNG images. It uses the Mermaid CLI tool to perform the validation and rendering.

Configuration and credentials

Important: This MCP server requires Node.js to be installed on your system, even if you're only using the server component (not the client). The server internally calls npx @mermaid-js/mermaid-cli as a subprocess to perform diagram validation and rendering.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
validate_mermaid_diagramValidates a Mermaid diagram and returns validation results

How to install the Mermaid MCP Server

{
  "mcpServers": {
    "mermaid-mcp-server-andrewginns": {
      "command": "npx",
      "args": ["-y", "@mermaid-js/mermaid-cli"],
      "env": {
        "MCP_TRANSPORT": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

Important: This MCP server requires Node.js to be installed on your system, even if you're only using the server component (not the client). The server internally calls npx @mermaid-js/mermaid-cli as a subprocess to perform diagram validation and rendering.

VariableDescriptionRequired
MCP_TRANSPORTConfiguration value read at startup.Optional

Example prompts to try

  • “Use Mermaid to validate mermaid diagram.”

Frequently asked questions

It validates Mermaid diagram syntax using the Mermaid CLI. Returns `is_valid: true/false` and a detailed error message if validation fails.