mermaider
MCP server to efficiently check all Mermaid diagram types for syntax errors
claude mcp add --transport stdio vtomilin-mermaider npx -y @vtomilin/mermaider /home/user/etc/Firefox.json
How to use
The mermaider MCP server provides a dedicated tool called validate_syntax that uses a headless browser context to verify Mermaid diagram syntax across all diagram types. It relies on puppeteer-core to connect to an installed browser (e.g., Chrome/Chromium or Firefox) and reuses a single browser page for subsequent syntax checks to minimize startup latency. This approach avoids spawning a new browser process for each request, enabling faster and more deterministic validation results than some alternatives that invoke the mmdc CLI for every call.
To use the server, run the MCP client configuration that points to mermaider. The typical invocation runs the mermaider package via npx, with a configuration object that specifies browser settings (if needed). The primary capability is the validate_syntax tool, which takes Mermaid diagram code and returns syntax validation feedback. If the diagram is valid, you’ll receive a success response; if there are syntax errors, you’ll get a detailed error message indicating where the problem occurs. This setup is designed to be responsive for interactive LLM-assisted diagram generation workflows inside editors like VSCode or in Cursor/Windsuf-style environments.
How to install
Prerequisites
- Node.js installed on the host system (recommended: latest LTS)
- npm (comes with Node.js) or corepack if you prefer pnpm/yarn
- A compatible browser installed locally (Chrome/Chromium or Firefox) for Puppeteer to connect to
Installation steps
- Verify Node.js and npm are available
node -v
npm -v
- Install and run mermaider via npx (the MCP client will pass a configuration file or inline JSON)
npx -y @vtomilin/mermaider '{"executablePath": "/path/to/browser", "browser": "firefox"}'
- If using a specific browser, ensure the configuration points to the installed executable in the JSON config (as per the examples in the README). For VSCode or other MCP clients, you can embed the same JSON in the server config, for example:
{
"mcpServers": {
"mermaider": {
"command": "npx",
"args": ["-y", "@vtomilin/mermaider", "/path/to/Firefox.json"]
}
}
}
- Optional: create a dedicated environment or container that has Node.js and Puppeteer-compatible browser installed to ensure consistent behavior across environments.
Additional notes
Notes and tips:
- The server expects a browser to be available locally; Puppeteer will download its own browser by default if not provided, which can be large and introduce variability. Prefer supplying an existing browser via the configuration to keep startup predictable.
- Use a secondary or dedicated browser for mermaider to avoid impacting your primary browser sessions.
- If you see issues with certain Mermaid features, ensure your browser version is compatible with mermaid-js/mermaid and Puppeteer.
- The mermaider tool is designed for low-latency syntax checking by reusing a single browser page; if you need to reset state, restarting the MCP server will recreate the browser context.
- When integrating with editors or IDEs, you can feed code blocks or prompt outputs directly to mermaider for immediate syntax feedback.
Related MCP Servers
mcp-graphql
Model Context Protocol server for GraphQL
mcp-google-map
A powerful Model Context Protocol (MCP) server providing comprehensive Google Maps API integration with LLM processing capabilities.
systemprompt-code-orchestrator
MCP server for orchestrating AI coding agents (Claude Code CLI & Gemini CLI). Features task management, process execution, Git integration, and dynamic resource discovery. Full TypeScript implementation with Docker support and Cloudflare Tunnel integration.
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
mcp -js
MCP server that exposes YepCode processes as callable tools for AI platforms. Securely connect AI assistants to your YepCode workflows, APIs, and automations.