
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A Python Model Context Protocol server that validates Mermaid diagrams and optionally renders them as PNG images.
Mermaid MCP Server is cataloged as an MCP server attributed to andrewginns. A Python Model Context Protocol server that validates Mermaid diagrams and optionally renders them as PNG images. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Mermaid MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
No, by default the tool does not return the base64-encoded image in order to preserve context length in LLM conversations.
README.md · f45a7e9e04ad · Fetched 2026-11-13 10:15:08 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
A Model Context Protocol (MCP) server for validating Mermaid diagrams.
Implements a minimal Python wrapper over https://github.com/mermaid-js/mermaid-cli for simpler out of the box use.
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.
The server provides LLMs with structured validation results including:
is_valid: true/false) indicating whether the Mermaid diagram syntax is correctThis enables LLMs to programmatically validate Mermaid diagram syntax, understand specific errors to provide helpful corrections, and optionally receive visual confirmation of the rendered output.
Also provides a simple Pydantic-AI MCP Client to invoke the MCP server using a Gemini model for testing.
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.
npm install -g @mermaid-js/mermaid-cli# Install Mermaid CLI globally
npm install -g @mermaid-js/mermaid-cli
# Verify installation
npx @mermaid-js/mermaid-cli --version
To use this server with an MCP client (like Claude Desktop), add the following configuration to your MCP settings:
Note: Make sure you have Node.js and Mermaid CLI installed (see Prerequisites above) before configuring the MCP server.
Clone this repository
Add this to your MCP client configuration file (e.g., claude_desktop_config.json):
{
"mcpServers": {
"mermaid-validator": {
"command": "uv",
"args": ["run", "/path/to/mermaid_mcp_server.py"],
}
}
}
uv to run the serveruv runMCP_TRANSPORT: Set to "stdio" for standard input/output communication{
"mcpServers": {
"mermaid-validator": {
"command": "uv",
"args": ["run", "/path/to/mermaid_mcp_server.py"],
"env": {
"MCP_TRANSPORT": "stdio",
}
}
}
}
The Python wrapper significantly simplifies the usage of the Mermaid CLI by abstracting away complex file handling and command-line arguments:
# Create input file
echo "graph TD; A-->B" > diagram.mmd
# Create puppeteer config file
echo '{"args": ["--no-sandbox", "--disable-setuid-sandbox"]}' > puppeteer-config.json
# Run mermaid-cli with multiple arguments
npx @mermaid-js/mermaid-cli -i diagram.mmd -o output.png --puppeteerConfigFile puppeteer-config.json
# Handle output file and cleanup
# Simple function call with diagram text
result = await validate_mermaid_diagram("graph TD; A-->B")
# All file handling, configuration, and cleanup is automatic
# Returns structured result with validation status and base64-encoded image
.mmd input files.png output files and converts them to base64 stringsnpx @mermaid-js/mermaid-cli command with all necessary flagsThis abstraction allows users to focus on diagram validation and rendering without dealing with the underlying file system operations and command-line complexities.
This repository can be used standalone to test the functionality of the Mermaid MCP validator programmatically.
See the Prerequisites section above for required dependencies (Node.js, Mermaid CLI, and Python with uv).
Use the provided Makefile for streamlined setup:
# Install all dependencies (Python + Node.js + Mermaid CLI)
make install
# Run validation tests
make test
If you prefer manual setup:
uv syncnpm install -g @mermaid-js/mermaid-cli.env.example to .env and fill in your API keyuv run mermaid_mcp_server.pyThe server exposes a tool for validating Mermaid diagrams:
validate_mermaid_diagram: Validates a Mermaid diagram and returns validation resultsdiagram_text (required): The Mermaid diagram text to validatereturn_image (optional, default: false): Whether to return the base64-encoded PNG imageImportant: By default, the tool does not return the base64-encoded image (return_image=false) to preserve context length in LLM conversations. Base64-encoded images can be very long strings (often 10KB-100KB+) that significantly impact the available context for the conversation.
When to use each setting:
return_image=false (default): Use for diagram validation only. Fast and context-efficient.return_image=true: Use only when you specifically need the rendered image data. Warning: This will consume significant context length.# Validation only (recommended for most cases)
result = await validate_mermaid_diagram("graph TD; A-->B")
# Returns: MermaidValidationResult(is_valid=True, error_message=None, diagram_image=None)
# Validation with image (use sparingly)
result = await validate_mermaid_diagram("graph TD; A-->B", return_image=True)
# Returns: MermaidValidationResult(is_valid=True, error_message=None, diagram_image="iVBORw0KGgoAAAANSUhEUg...")
The project includes convenient testing commands:
# Run all tests
make test
# Or run the test script directly
uv run test_pydantic.py
The test script uses Pydantic AI with Gemini models to validate the MCP server functionality.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Mermaid MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mermaid-mcp-server-andrewginns)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.