Free Mermaid diagrams
for you and your agent.
Create, edit, and share diagrams in your browser, through the REST API, or with your agent over MCP. Keep drafts private and publish when you’re ready.
const source = "flowchart LR\n App --> API\n API --> Cache\n API --> Worker\n Worker --> Database";
const response = await fetch("https://www.mermaiddesk.com/api/v1/mermaid/render", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ source, format: "svg" }),
});
const svg = await response.text();Run on your server with Node.js 20 or later and a TypeScript runner. Replace YOUR_API_KEY with your key. Read the SVG from svg.
Rendering example diagram…
- Check Mermaid syntax
- Keep your diagrams private
- Export SVG, PNG & PDF
- Share public snapshots
From first draft
to published diagram.
Map your architecture, explain a pull request, or illustrate a runbook. Keep the source editable as your system changes.
- Give your agent diagram tools.
- Connect your agent through MCP to create and update diagrams. Validate the Mermaid source so your agent can find and fix syntax errors.
- Build diagrams into your workflow.
- Render SVG, PNG, or PDF from your code. Open any saved diagram in your browser to refine it.
- Share when you are ready.
- Publish a snapshot with a public link and downloads. Later edits stay private until you publish again.
Your code. Your agent. One key.
Connect through REST or MCP with the permissions you choose.
Add diagrams to your app.
Turn Mermaid source into files your app can use. Save diagrams privately or publish a snapshot to share.
Read the API guide- Create an API key in account settings. Select
MERMAID_RENDERto validate and render source. - Send the key in your
Authorization: Bearerheader. The example above returns SVG you can use in your app. - Add read and write permissions to save and edit diagrams. Add share permission to publish snapshots.
/api/v1/mermaid/renderConnect your agent.
Use an MCP client that supports Streamable HTTP and custom authorization headers.
Read the MCP guide- Server URL
https://www.mermaiddesk.com/api/mcp- Transport
- Streamable HTTP
- Header
Authorization: Bearer mdsk_…- Permissions
DIAGRAMS_READ,DIAGRAMS_WRITE,MERMAID_RENDER
Store your API key in the client’s secret settings. Use the key in place of mdsk_…. The key’s permissions control which tools appear. Add DIAGRAMS_SHARE to publish snapshots. MCP requires a bearer key. It does not support browser sign-in or OAuth.
See what your agent can do
list_diagrams/get_diagram— find and readcreate_diagram/update_diagram— save and editvalidate_mermaid/render_mermaid— check and renderexport_diagram— get the source or a diagram filepublish_diagram/revoke_diagram_publication— manage public snapshotsdelete_diagram— permanently delete a diagram
Edit the source. See the diagram.
Make a change below and see the result. Edit and export without an account.
Mermaid editor
Mermaid editor
Preview
Mermaid source
Give your agent
diagram tools.
Create a key, choose its permissions, and connect.