Skip to content
Connect an agent
Get started

Quick start

Connect an AI agent, ask it for a diagram in plain words, and have a checked picture in about five minutes. It is for anyone who has just added Plotwork to Claude Code, Cursor, VS Code, or Claude Desktop, and for anyone who wants diagrams in a Markdown file instead.

For
  • Claude Code
  • Cursor
  • VS Code
  • Claude Desktop
Claude Codeclaude mcp add plotwork -- npx -y @buun_group/plotwork-mcp@0.1.0-beta.10
  • 18MCP tools
  • 130API operations across 104 paths

TL;DR

QuestionAnswer
What is Plotwork?A small text language for twenty kinds of diagram (flow, sequence, database schema, git graph, Gantt chart, class, state, timeline, user journey, mind map, treemap, pie chart, quadrant chart, layered architecture, C4, matrix, Sankey, XY chart, tree, and swimlane), and a renderer. Your agent writes the text, Plotwork checks it and draws it. You never draw boxes by hand.
What do I do first?Connect your agent once, then paste the first prompt in step 2.
What do I say to the agent?Plain words: what the diagram shows and who it is for. You do not name tools. Copy a prompt from this page or from the examples.
What comes back?The diagram text, any mistakes with line and hint, a plain-text outline to check the meaning, and the picture in light and dark.
How do I see the picture?Ask the agent to save it as a file, put it in a Markdown file, or, on the hosted server, publish a link. Step 4 has the words to use.
How do I change it?Say what is wrong, such as "put a cache between the API and the database". The agent edits the text and draws again.
No agent?Write a diagram fence in a Markdown file and send the file to the HTTP API, which answers with the picture files to save. This needs the Pro plan and an API key. See step 8.

1. Connect your agent

Do this once per client. The quickest way is the local server: it runs on your machine, needs Node 22 or newer, and needs no key and no account.

For Claude Code:

sh
claude mcp add plotwork -- npx -y @buun_group/plotwork-mcp@0.1.0-beta.10

Then run /mcp inside Claude Code. plotwork should be listed as connected. For Cursor, VS Code, Claude Desktop, the hosted server, and sign-in without a key, follow Connecting an agent.

Check it worked by asking your agent: "Which Plotwork tools do you have?" It should name draw_diagram, get_diagram_syntax, draw_from_pattern, and others. If it names none, see Troubleshooting.

2. Ask for your first diagram

Paste this into your agent:

text
Use Plotwork to draw a diagram of how a login request is checked. A user sends an email and password to an Auth API. The API looks the user up in a Users database. If the password is correct a session is issued, otherwise the API answers 401 Unauthorized. Draw it, then tell me in one sentence what it shows.

Here is what happens, step by step. You see these as tool calls in your client.

StepToolWhat it does
1get_diagram_syntaxThe agent reads the language once.
2draw_diagramThe agent sends the diagram text. If the text has mistakes, Plotwork returns every one with its line, column, and a hint, and draws nothing.
3draw_diagram againThe agent fixes each mistake and calls again until the text is valid. A valid diagram comes back with warnings (such as a suggested icon), an outline, and the picture.
4noneThe agent compares the outline with your request and answers.

You did not write any diagram text. The agent did.

3. Read what the agent wrote

This is the kind of text the agent sends. It is plain, one statement per line, and you can read it and edit it by hand.

How a login request is checked: 6 nodes, 5 connections. A user signs in through an API that checks the password against a database and answers with a session or an error.
LineMeaning
flow "Title" direction=downThe first line names the kind (flow, sequence, or schema) and gives a title. direction says which way it reads.
node id type "Label"One box. The id is how arrows refer to it. The type (person, service, database, decision, terminal, and more) picks the icon and the shape.
a -> b : "label"An arrow from a to b, with an optional label. --> draws a dashed arrow.
group id "Name" { ... }A box around other nodes, for a network, a tier, or a team. See the examples.

The full language, kind by kind, is in Writing diagrams.

4. See the picture

The agent gets the picture as SVG text. Your client shows it as text unless the agent saves or publishes it, so ask for what you want:

You wantSay
A file to open"Save the light and dark SVGs to docs/diagrams/login.svg and docs/diagrams/login.dark.svg." Open the file in a browser or in VS Code.
The diagram in a README or doc"Add this diagram to README.md under a Login heading, and render it." The agent uses sync_markdown, and GitHub shows the picture and switches to dark mode on its own. See Markdown and GitHub.
A link to paste in chat or a pull request"Publish it and give me the link." This needs the hosted server; it returns a public link and a Markdown image to paste.
A private copy for your team"Publish it to the Platform organisation." Members of the organisation see it after signing in. Nobody else can.

A large diagram, about 30 nodes or more, comes back without its picture so that the answer fits what a client can read. The check and the outline still arrive. Ask for a file or a link and you get the picture.

5. Change it

Say what is wrong in words. The agent edits the text and draws again. These all work:

text
Add a Redis cache between the API and the database, and show that the API reads from it first.
text
Rename "Auth API" to "Identity service", and put the service and the database in a group called "Backend".
text
Use AWS icons: API Gateway for the entry point, Lambda for the service, and DynamoDB for the database.
text
Make it read left to right, and add a step after "Session issued" that sends a welcome email.
text
Number the steps.
text
Animate the flow.

You can also edit the text yourself and tell the agent: "I changed the diagram, check it and draw it again."

6. Start from something that exists

You do not need a blank page. These prompts start from a checked pattern or from Mermaid you already have:

text
Draw a three-tier network on Azure with a load balancer in front, and call the app tier "Billing API".
text
Convert this Mermaid flowchart to Plotwork, tell me what was lost, and draw it.
text
Replace the Mermaid diagrams in README.md with Plotwork diagrams and give me the files to write.

More prompts, each with the tool it leads to, are in Prompts and recipes. Ready-made diagrams you can copy are in the examples.

7. If something is not right

SymptomCauseFix
The agent writes a Mermaid diagram or ASCII artIt did not call the toolsSay "Use Plotwork" in the prompt, or add the rules file to your project.
The agent keeps fixing the same mistakeThe hint is not being appliedAsk it to read the error out loud, then to read the language again with get_diagram_syntax.
No picture in the answerThe diagram is large, or the client hides tool outputAsk for a file or a link, as in step 4.
The picture is too wide to readMany boxes in one rowSay "make it read top to bottom" or "split it into two diagrams".
The icons are genericThe agent did not look up product namesSay "choose icons for every service with map_icons".

8. Without an agent: Markdown and the HTTP API

The text is the same without an agent. Write a diagram fence in any Markdown file, using text like the example in step 3:

Markdown
```diagramflow "Login request"node user person  "User"node api  service "Auth API"node db   database "Users DB"user -> api : "POST /login"api  -> db  : "look up user" role=data```

The command line draws every fence of a file on your machine, with no account or key:

sh
npx -y @buun_group/plotwork@0.1.0-beta.13 sync notes.md

Over HTTP, Plotwork draws the fences of a document in one call, POST /v1/markdown/sync, the HTTP form of the sync_markdown tool. Calling the drawing routes of the API directly needs the Pro plan and an API key from app.plotwork.dev (opens in a new tab). Send the whole file and its path. The command reads the key from the environment variable PLOTWORK_API_KEY:

sh
jq -n --rawfile markdown notes.md '{markdown: $markdown, documentPath: "notes.md"}' |  curl -s -X POST https://api.plotwork.dev/v1/markdown/sync \    -H "X-API-Key: $PLOTWORK_API_KEY" \    -H "content-type: application/json" \    -d @- > result.json

result.json holds the rewritten document in markdown, the light and dark SVG files in files, each with its path and content, and a report with the line and a hint for every mistake. Plotwork writes nothing itself: save markdown over notes.md and each entry of files at its path. Send "mode": "check" as well and the call changes nothing and says in changed whether a picture is stale, which is the form to run in CI. How the picture block works and where it shows is in Markdown and GitHub.

Next steps

DocWhy
Examples to copyEight ready diagrams with the prompt for each: a login flow, services, a sequence, a schema, AWS, a release pipeline, numbered steps, and a data flow that moves
Writing diagramsFlow, sequence, and schema diagrams, groups, icons, and cloud architecture, with a guide for each of the seven other kinds
Prompts and recipesWhat to say and which tool answers
Hosted diagramsPublish a link to a diagram
OrganisationsShare a private diagram library with your team

See also

DocWhy
Connecting an agentClient settings, sign-in, and troubleshooting
MCP serverThe tools and how they behave
Language referenceEvery word the language accepts
How a diagram is drawnWhat happens between your text and the picture