Use a Mermaid MCP server to render and review AI diagram edits
Connect a coding assistant to Flowgraph's MCP server for Mermaid validation, rendering, icon search, and version-aware edits to saved diagrams.
A Mermaid MCP server gives a compatible assistant tools for working with diagrams. Instead of returning only a block of code, the assistant can validate the source, render a preview, and, with the right access, update a saved diagram.
The important workflow is proposal, validation, review, and then an intentional save. Connecting a tool does not make every diagram change correct.
Connect the remote service
Flowgraph Studio exposes MCP at https://flowgraph.studio/mcp. Create a key in Account settings → Render API, then configure your client's remote HTTP connection with that endpoint and an Authorization: Bearer <key> header. In Claude Code, that is one command:
claude mcp add --transport http flowgraph https://flowgraph.studio/mcp \
--header "Authorization: Bearer $FLOWGRAPH_API_KEY"
Other clients (Cursor, VS Code, and so on) take the same endpoint and header in their own settings; the Render API section of Account settings shows a JSON configuration you can adapt. Keep the key in the client's supported secret mechanism. Confirm which tools the client discovers before asking it to make changes.
render_diagram uses one render from the account's monthly API allowance, and validate_mermaid uses one when the code is valid; search_icons is free. Reading and changing saved diagrams needs Pro or Pro Max and a key created with Read and change saved diagrams ticked. Without that option a key can only render, which is the right choice when the assistant only needs previews.
Start with a diagram that can be inspected
Try a request such as:
Create a flowchart showing a browser calling an API, the API publishing a job, and a worker saving the result. Validate the Mermaid and show the preview before saving anything.
The tools include validate_mermaid, render_diagram, and search_icons. The server also exposes a rich-node syntax resource. These help the assistant check syntax and select actual icon identifiers rather than guessing names.
Validation catches render errors. You still need to inspect whether the diagram accurately describes the requested system. In this example, the API-to-worker relationship should be asynchronous through the queue; a direct arrow could communicate a different design.
Update a saved diagram with its current version
Workspace-capable tools include list_diagrams, get_diagram, create_diagram, and update_diagram. An update requires the baseVersion last read from the server.
If another editor changes the diagram after that read, the update can be rejected as a conflict. Ask the assistant to fetch the latest version, reapply the specific intended change, and show the difference. Blindly resending stale content would defeat the purpose of version-aware editing.
A diagram the assistant creates or changes appears in the app within a minute, and the previous state stays in version history, so any change can be undone there. History is useful for recovery, but it is not a substitute for reviewing a meaningful change.
Use a precise editing request
“Make this better” leaves too much ambiguity. Prefer:
Add a queue between API and Worker. Keep the existing node IDs and unrelated labels. Explain any other changes before saving.
Then inspect the rendering and source. Check arrow direction, labels, and whether the assistant removed anything unexpectedly.
The API reference lists every tool and limit. For the diagram language itself, the flowchart guide is a useful companion. The strongest automation loop is one where the tool handles repetitive work and the reviewer can still understand the result.
More guides
- Animate a Mermaid diagram as a short technical explanationTurn a static Mermaid flow into a captioned explanation. Plan the story, select GIF or video output, and check that animation preserves the system's meaning.
- Explain an Azure background-job architecture with MermaidDraw an illustrative Azure job-processing architecture with API, queue, worker, and storage boundaries. Explain acknowledgment, completion, and failure handling.
- Build a consistent technical carousel with a reusable brand kitCreate readable technical carousel slides using a reusable brand kit. Keep colors, typography, diagrams, and export checks consistent across the series.