← Back to directory
M

Mermaid MCP Server

Community
Generate Mermaid diagrams and charts dynamically with AI via MCP.
GitHub source repository ↗
★ 627 Stars Category · Dev Tools Popular Source revision 13497062a980
47FMRS · D
Reliability
7/20
Security and permissions
7/20
Maintenance
10/20
Documentation
10/20
Setup experience
13/20

mcp-mermaid is a practical MCP server with multiple transports, easy installation, and rich features. Suitable for developers wanting to integrate AI-based diagram generation, but input validation and privacy considerations are recommended.

Read the FMRS scoring method →

mcp-mermaid is an MCP server that enables AI models to generate Mermaid diagrams and charts dynamically. It fully supports all Mermaid features and allows configuration of background color and theme. It supports exporting to base64, SVG, Mermaid source, local files, and remote URLs, with Mermaid validation to aid multi-round output of correct syntax.

Tools

generate_mermaid
Generates a Mermaid diagram based on user input, with options for type, theme, background color, and output format.

Setup

  1. Ensure Node.js and npm are installed.
  2. Add the server configuration to your MCP client (e.g., Claude Desktop) as shown above.
  3. Restart the client and start using.
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-mermaid": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-mermaid"
      ]
    }
  }
}

Fit and risk

Best for

  • Developers needing AI assistance to produce technical documentation diagrams (e.g., architecture, flow).
  • Teams looking to integrate diagram generation into automated workflows.
  • AI users of desktop apps like Claude, VSCode, Cline, etc.

Not for

  • Batch generation of static diagrams (better use Mermaid CLI or libraries directly).
  • Scenarios requiring custom rendering beyond Mermaid's capabilities.
  • Users without Node.js or npm access.

Required permissions

  • Network access: Required if using remote Mermaid API or exporting URLs.
  • File system: Can write PNG files in the server directory when output type is 'file'.
  • Local ports: If using SSE or Streamable, needs to listen on local ports.

Risks and side effects

  • Mermaid syntax from user input could be malicious; filter inputs as needed.
  • Misconfiguration may overwrite or create unintended files.
  • Remote URL mode creates public links, potentially exposing diagram content; be mindful of privacy.

Troubleshooting

  1. Ensure npx is available and Node.js is up-to-date.
  2. Check MCP client configuration, especially the command and arguments.
  3. For SSE/Streamable, check port availability and firewall rules.
  4. Inspect service logs or use MCP Inspector for debugging.
  5. Verify network connectivity to remote APIs or URLs.

Use cases

Generate flowcharts, sequence diagrams, Gantt charts, etc., directly in AI conversations.
Save AI-generated diagrams as PNG files or share via URLs.
Quickly create visual diagrams in MCP-capable IDEs or chat tools.

Supported clients

Claude DesktopFull support