mermaid2svg
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mermaid2svg
Convert mermaid markdown to svg as a web app, api and mcp server.
Handy for converting AI generated diagrams into SVG which can be inserted into FOR as an image.
Try it out on Huggingface spaces
Rendering is done in pure Python with mermaidx (no browser, Node.js or npm required):
import mermaidx
d = mermaidx.render(mermaid_code)
d.save("azure_architecture.svg")Install
pip install -r requirements.txt # or: pip install -e ".[all]"Related MCP server: Vizdown-MCP
1. FastAPI REST web service
uvicorn mermaid2svg.api:app --host 0.0.0.0 --port 8000 # or: mermaid2svg-apiInteractive docs at http://localhost:8000/docs. All render endpoints return image/svg+xml
(or HTTP 422 with a detail message for invalid Mermaid):
Method | Path | Body |
GET |
| – |
POST |
| JSON |
POST |
| raw |
POST |
| multipart upload, field name |
curl -X POST localhost:8000/render -H 'Content-Type: application/json' \
-d '{"code": "graph TD; A-->B"}' -o diagram.svg
curl -X POST localhost:8000/render/text --data-binary @diagram.mmd -H 'Content-Type: text/plain' -o diagram.svg
curl -X POST localhost:8000/render/file -F file=@diagram.mmd -o diagram.svg2. Gradio web app
python -m mermaid2svg.gradio_app # or: mermaid2svg-gradioOpen http://localhost:7860, paste Mermaid source (or upload a .mmd/.mermaid/.txt/.md file),
click Convert to SVG to preview the diagram and download the SVG.
3. MCP server
python -m mermaid2svg.mcp_server # stdio (default)
python -m mermaid2svg.mcp_server --transport streamable-http --port 8000Tools:
mermaid_to_svg(mermaid_code)– returns the SVG markup as a string.save_mermaid_svg(mermaid_code, filename="diagram.svg")– writes the SVG to the output directory (MERMAID2SVG_OUTPUT_DIR, default./output) and returns its path. The filename is sanitised so files cannot be written outside that directory.
Example client configuration (e.g. Claude Desktop / VS Code):
{
"mcpServers": {
"mermaid2svg": {
"command": "python",
"args": ["-m", "mermaid2svg.mcp_server"],
"env": { "MERMAID2SVG_OUTPUT_DIR": "/path/to/output" }
}
}
}Configuration
Variable | Default | Description |
|
| Bind address |
|
| Maximum Mermaid source length (chars) |
|
| Where the MCP |
Tests
pip install -e ".[test]"
pytestTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
Validate Mermaid syntax and get error details your coding agent can use to correct a diagram. Check the source again before adding it to your documentation. Validation works without saving a diagram. Render SVG, PNG, or PDF, save diagrams privately, and publish selected snapshots. Your existing agent writes and corrects the source; MermaidDesk checks and renders it. Validation checks syntax, not whether a diagram accurately describes a system. Connect through MCP with Streamable HTTP and a scoped bearer API key. Enable MERMAID_RENDER for validation and rendering. A REST API is also available. MCP setup: https://www.mermaiddesk.com/developers/mcp REST API guide: https://www.mermaiddesk.com/developers/api
Create and manage Mermaid.js flowcharts and diagrams with AI agents via MCP.
Generate PDF, Word (.docx) and PowerPoint (.pptx) documents from Markdown over MCP.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.1289 npm234MIT
- AlicenseAqualityDmaintenanceConverts Markdown files into professional diagrams such as flowcharts, mind maps, and architecture diagrams using Mermaid.js and custom SVG renderers. It enables users to list, render, and export visualizations in multiple formats including SVG, PNG, and PDF.3MIT
- AlicenseNot gradedqualityDmaintenanceProvides MCP tools to validate Mermaid diagram syntax, render diagrams to SVG, and get documentation links.97 npm16MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for rendering Mermaid diagrams to SVG and converting Markdown with callout blocks into styled PDF reports.MIT