peng-shawn_mermaid-mcp-server

peng-shawn_mermaid-mcp-server

0

The Mermaid MCP Server is a tool that converts Mermaid diagram code to PNG images, supporting multiple themes and customizable options. It integrates with AI tools and uses Puppeteer for rendering.

Mermaid MCP Server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images. This server enables AI assistants and other applications to generate visual diagrams from textual descriptions using the Mermaid markdown syntax.

Features

  • Converts Mermaid diagram code to PNG images
  • Supports multiple diagram themes (default, forest, dark, neutral)
  • Customizable background colors
  • Uses Puppeteer for high-quality rendering
  • Implements the MCP protocol for seamless integration
  • Flexible output options

How It Works

Uses Puppeteer to render Mermaid diagrams to SVG, capturing a screenshot as PNG. The output is either returned directly or saved to disk.

API

  • generate: Converts Mermaid diagram code to a PNG
    • Parameters: code, theme, backgroundColor, name, folder

Publishing

This project uses GitHub Actions to automate publishing to npm. Includes both a recommended release script and a manual process.

FAQ

Doesn't Claude desktop already support mermaid via canvas?

Yes, but it doesn't support the theme and backgroundColor options. Plus, having a dedicated server makes it easier to create mermaid diagrams with different MCP clients.

Why do I need to specify CONTENT_IMAGE_SUPPORTED=false when using with Cursor?

Cursor doesn't support inline images in responses yet.