MCPSERV.CLUB
unravel-team

MermaidJS MCP Server

MCP Server

Create and render Mermaid diagrams with a simple CLI server

Stale(50)
0stars
1views
Updated Apr 27, 2025

About

A Model Context Protocol server that lets users save MermaidJS specifications and generate visual diagrams using the mmdc CLI. It provides two tools—save-diagram and visualize-diagram—to streamline diagram creation and rendering.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Overview

The Mcp Mermaidjs Server provides a lightweight, MCP‑compatible interface for generating and rendering MermaidJS diagrams. By exposing two straightforward tools— and —the server lets AI assistants like Claude store a Mermaid specification in memory and later produce a visual representation in the desired format (PNG, SVG, etc.) using the official command‑line utility. This eliminates the need for developers to embed Mermaid rendering logic directly in their applications, enabling a clean separation between diagram authoring and presentation.

The server solves the common pain point of turning raw Mermaid code into a polished image without manual tooling. Developers can programmatically pass a text specification to , which assigns an internal identifier. Subsequent calls to reference that identifier, optionally overriding output format or supplying custom CSS. Because the rendering is performed by , all of Mermaid’s latest syntax, themes, and diagram types (sequence, flowchart, Gantt, etc.) are supported out of the box. The result is a ready‑to‑use image that can be embedded in documentation, slides, or web pages.

Key capabilities include:

  • Persisted diagram storage: The tool keeps the specification in a server‑side cache, allowing multiple visualizations or edits without re‑submitting the text.
  • Flexible rendering options: Users can request PNG, SVG, or other formats supported by , and optionally supply CSS to customize appearance.
  • MCP integration: The server adheres to the Model Context Protocol, exposing resources and tools that can be discovered by any MCP‑compliant client. This means AI assistants can seamlessly invoke diagram creation as part of a larger workflow.
  • Command‑line driven: Built in Java, the server runs as an Uberjar and can be launched from any environment that supports Java, making it easy to embed in CI pipelines or containerized services.

Real‑world scenarios for this MCP server are plentiful. A product manager could ask Claude to draft a sequence diagram from natural language requirements, save it, and then generate an SVG for inclusion in a release deck. A documentation engineer might integrate the server into a static site generator, allowing authors to write Mermaid code in Markdown and have it rendered automatically. In educational settings, instructors can use the server to produce visual aids on demand during live coding sessions.

What sets this MCP implementation apart is its minimal footprint and tight coupling to the authoritative Mermaid CLI. By delegating rendering to , developers gain guaranteed compatibility with future Mermaid releases without needing to maintain a custom rendering engine. The server’s clear API—save then visualize—fits naturally into AI‑driven design loops, making diagram creation as effortless as any other text transformation.