Home / MCP / Mermaid Diagram Generator Server
Flask-based MCP server that renders Mermaid diagrams from Mermaid syntax using mermaid-cli.
Configuration
View docs{
"mcpServers": {
"mermaid_mcp": {
"command": "python",
"args": [
"server.py"
]
}
}
}You can run a lightweight Flask server that converts Mermaid syntax into rendered diagrams on demand. This MCP server is useful for automating diagram generation in documentation, dashboards, and development workflows without embedding rendering logic directly into your client apps.
Start the server locally and connect to it from your MCP client to generate diagrams on demand. You provide Mermaid syntax, optional theme and background, and you receive a PNG image of the rendered diagram. Use it to integrate diagram rendering into documentation pipelines, CI checks, or interactive tooling.
pip install -r requirements.txtnpm install -g @mermaid-js/mermaid-clipython server.py
```
By default, the server runs on http://localhost:5000.The server creates a local temporary storage directory named temp_files within the project folder to hold intermediate files. This avoids permission issues with system temp directories, works well in virtual environments, and automatically cleans up files older than 30 minutes.