You just need a free Diagrams.so account. Then pick one of the two ways in below: connect a client (no key to handle), or create an API key for raw HTTP.

1. Get connected

For using Diagrams.so from Claude, Cursor, or your own code. Connect once, with nothing to copy or paste:
Enter your email, we email you a one-time code, then sign in in the browser that opens, enter the code, and press Approve. The credential is saved to ~/.diagrams-so/credentials.json and shared by the MCP server and both SDKs, so the MCP tools and DiagramsClient() just work from then on. See Authentication for how it works.
Pin @latest so npx doesn’t reuse an older cached client. Clients before the emailed-code login are rejected with an “update your client” message.

2. Generate your first diagram

Add the server to your client, restart it, and just ask in plain English:
“Generate an AWS 3-tier web app diagram (ALB, EC2 Auto Scaling, RDS Postgres), show the warnings, and export it as draw.io.”
The agent calls generate_diagramget_warningsexport_diagram for you. Run npx @diagrams-so/mcp@latest install to print ready-to-paste config for Claude Desktop and Cursor.
Generation is AI-backed and can take 30 seconds or more. On a plain curl there is no progress until it completes, so for live progress use POST /diagrams/stream. Edits and fixes typically take 10 to 20 seconds, and re-layout runs as an async job you poll. The SDKs and MCP server default to a 180-second timeout.
The response carries the diagram id, the native draw.io xml (open it at app.diagrams.net), any Well-Architected warnings you can fix, and your credit usage (generating spends credits; reads and exports are free).

3. Iterate

Edit with a prompt

POST /diagrams/{id}/edit, for example “add a CloudFront distribution in front of the ALB”.

Fix a warning

POST /diagrams/{id}/fix applies a recommended change.

Export

GET /diagrams/{id}/export?format=svg returns draw.io or SVG.

Full SDK walkthrough

Every method in the Python and TypeScript SDKs, over the same login.