Three ways to get a diagram from Claude
| Way | What you get | Editable? | Setup |
|---|---|---|---|
| Ask for Mermaid | Diagram text, often shown as a preview | Only by editing the text | None |
| Ask for an SVG | A picture | Not really | None |
| Connect a diagram tool (MCP) | A link that opens a real, editable board | Yes, by dragging and clicking | One minute |
1. Ask for Mermaid text
Mermaid is a short text format for diagrams. Ask "Write this as a Mermaid flowchart" and Claude writes something like:
flowchart TD
A[Request received] --> B{Approved?}
B -->|yes| C[Send invoice]
B -->|no| D[Reply with reasons]
Good for README files and docs that render Mermaid. The downside: to move one box, you edit text and hope the layout behaves.
2. Ask for an SVG picture
Claude can write an SVG drawing directly. It is quick for a one off image, but positions are hand placed by the model, so arrows can overlap and fixing one detail means asking again.
3. Connect a diagram tool through MCP
This is the most useful for real work. Add a diagram MCP server once, and Claude can hand you a link that opens the diagram in a whiteboard, laid out properly and ready to edit.
To connect Chalkline in claude.ai or the Claude desktop app, open Settings, then Connectors, then Add custom connector, and enter https://chalkline.in/mcp. In Claude Code, run:
claude mcp add --transport http chalkline https://chalkline.in/mcp
It is free, needs no key, and keeps nothing on a server. More setup options are in use Chalkline with AI.
Prompts that work well
Be specific about three things: the kind of diagram, the direction and the content.
| Instead of | Try |
|---|---|
| "Diagram our checkout" | "Draw a top to bottom flowchart of our checkout: cart, address, payment, confirmation. Add a branch for a failed payment." |
| "Show the login" | "Make a sequence diagram of a login with a browser, an API and a database, including a wrong password." |
| "Database diagram" | "Here are my CREATE TABLE statements. Draw the ER diagram with crow's foot notation." (paste the SQL) |
| "Explain this code visually" | "Turn this Python function into a flowchart." (paste the function) |
| "Chart the numbers" | "Make a bar chart of this CSV, with months on the x axis." (paste the data) |
Changing a diagram after Claude draws it
You have two options, and you can mix them:
- Ask in words: "Make the error path red", "Add a cache between the API and the database", "Switch it to left to right."
- Open the link and edit by hand: drag boxes, change colours, add notes, switch between the hand drawn and clean look, then export to PNG, SVG, PDF or PowerPoint.
Fixing common problems
Claude answers with text instead of a diagram. Name the tool: "Use Chalkline to draw this as a flowchart."
The diagram is too big to read. Ask for fewer steps per diagram, or split it: "Draw only the payment part."
Boxes have long sentences in them. Ask for labels of three to five words, and put details in notes.
The connector does not appear. Check that it is switched on for the conversation, in the tools or connectors menu under the message box.
Which diagram to ask for
| You want to show | Ask for |
|---|---|
| Steps and decisions | A flowchart |
| Messages between systems over time | A sequence diagram |
| Tables and their links | An ER diagram |
| The situations something can be in | A state diagram |
| Ideas around one topic | A mind map |
| How the parts of a system connect | A system design diagram |
To understand what is happening behind the scenes, read MCP servers for diagrams.