What it does
diagramport takes Mermaid diagram syntax and returns it in the form requested: the validated syntax as text, a mermaid.ink share link (SVG or PNG), or a rendered image. Validation runs locally before any output. It checks that the first non-empty line starts with a known diagram type, such as graph, flowchart, sequenceDiagram or gantt, and that quotes and brackets are balanced. Invalid input is reported with the reason and is never passed to a renderer or link builder. Share links are built from the diagram text without any network call.
It suits workflows where an AI client needs to produce a diagram from Mermaid code through its MCP tool, generate_mermaid_diagram, which accepts a theme, a background colour and an outputType. The same binary also works as a CLI, where exit code 0 means success, 1 means invalid syntax or a failed render, and 2 means a usage error.
The binary runs as a stdio MCP server through its mcp subcommand, or as a CLI, and a container image is also available. The base64, svg and file output types render through a local command named in the DIAGRAMPORT_RENDERER_COMMAND environment variable. That command reads the diagram text on stdin and writes image bytes to stdout. file output is saved under DIAGRAMPORT_OUTPUT_DIR if set, otherwise to ./diagrams/.
Limitations and requirements
diagramport bundles no renderer. Rendering needs a Mermaid engine, typically with a headless browser, supplied by the operator and set through DIAGRAMPORT_RENDERER_COMMAND; without it, base64, svg and file outputs return an error. The validation is a structural sanity check, not a full Mermaid parse. svg_url and png_url links rely on the public mermaid.ink service to display the diagram.
Safety
Our team has not reviewed this resource. Only automated rules checked it; resources with high-risk signals are not published. These are signals, not a guarantee that installing it is safe. Try it in a sandbox project first.
- Runs code or changes an assistant's behaviour
Sources
- Official MCP Registry first seen 13 Nov 2026 · last seen 13 Nov 2026 · its page on the source
io.github.CloudCorpRecords/diagramport
Generate Mermaid diagrams and charts from Mermaid syntax, validated locally.
v0.1.0As shown on registry.modelcontextprotocol.io when we last read it