mermaid
A lightweight Model Context Protocol (MCP) server that provides real-time Mermaid diagram syntax validation with minimal memory footprint.
claude mcp add --transport stdio freepeak-mermaid-mcp-server node /path/to/mermaid-mcp-server/server.js \ --env DEBUG="mermaid-mcp-server:*" \ --env NODE_ENV="development" \ --env MEMORY_LIMIT="128" \ --env PERFORMANCE_MONITORING="true"
How to use
This MCP server provides real-time and batch validation for Mermaid diagrams. It exposes a set of tools that let you validate single diagrams, perform real-time validation during editing, and run batch validation across multiple diagrams. You can validate a single diagram with validate_mermaid to get a quick pass/fail result along with an inferred diagram type and error details. For live editing scenarios, use mermaid_realtime_validate to receive enhanced feedback including the type of change and line number. When you need to process multiple diagrams at once, batch them with validate_mermaid_batch and inspect a concise summary plus individual results. You can also query server information and the supported diagram types via get_mermaid_info to monitor capabilities and performance metrics.
How to install
Prerequisites:
- Node.js v18.x or newer
- npm (included with Node.js)
- Git
Install and run the Mermaid MCP Server locally:
- Clone the repository:
git clone <repository-url>
cd mermaid-mcp-server
- Install dependencies:
npm install
- Start the server (development mode):
npm run dev
- If you want to run via MCP client configuration, ensure your client points to the server.js entry, e.g.:
- Command: node
- Args: ["/path/to/mermaid-mcp-server/server.js"]
- Environment: set appropriate variables as needed (see below)
Optional environment variables you may configure:
- DEBUG: Enable verbose debug logs (e.g. mermaid-mcp-server:*).
- NODE_ENV: Set to development or production.
- MEMORY_LIMIT: Limit the memory usage (in MB).
- PERFORMANCE_MONITORING: Enable performance metrics collection.
Additional notes
Tips and notes:
- The server is designed for lightweight, real-time Mermaid diagram validation with minimal memory footprint.
- Supported diagram types include Flowcharts, Sequence Diagrams, Class Diagrams, State Diagrams, ER Diagrams, Gantt, Mind Maps, Timelines, C4 Architecture, Sankey, Block, Architecture, and more.
- Use get_mermaid_info to inspect server status, uptime, and supported diagram types.
- For debugging startup issues, verify Node.js version (>= 18) and ensure dependencies are installed.
- If memory usage spikes, consider batch validation or restarting the server as needed and adjust MEMORY_LIMIT.
- Environment variables in MCP config can be tuned per deployment to balance logging, debugging, and performance.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.