Skip to main content
Glama
diagrams-so

diagrams-so

Official

@diagrams-so/mcp

CI Smithery

The Diagrams.so MCP server — generate, edit, and manage cloud architecture diagrams from any MCP client (Claude Desktop, Claude Code, Cursor). It's a thin stdio client over the public Diagrams.so API (/api/v2); every tool is one REST call.

Quick start

Needs Node ≥ 18. No API key to copy: you connect by approving in a browser.

# 1. add the server to Claude Code
claude mcp add diagrams-so -- npx -y @diagrams-so/mcp

# 2. connect this machine (a browser opens, press Approve)
npx @diagrams-so/mcp login

Restart your client, then ask: "Generate an AWS 3-tier web app diagram and show me the warnings." Run /mcp if you want to confirm all 23 tools registered first.

Using it a lot? Install once and the command gets shorter:

npm i -g @diagrams-so/mcp
diagrams-so login

The server talks to production (https://api.diagrams.so/api/v2) by default. Point it at a local or self-hosted API with DIAGRAMS_API_BASE.

Using Claude Desktop or Cursor instead of the CLI? See Add it to your MCP client. Prefer a one-click, no-terminal install? See One-click install (MCPB).

Add the server to your client config (below) with DIAGRAMS_LOGIN_EMAIL set to your email, then just ask for a diagram. Because the machine isn't connected yet, the first tool call emails you a one-time sign-in code and replies with a link. Open it, enter the code, press Approve, and ask again. Nothing to install or type.

Related MCP server: fcp-drawio

Generating a diagram from Claude

login only connects the machine. It never generates anything itself, so there is no generate command to type in a terminal. You write the prompt in your assistant's normal chat box and it calls the tools for you.

Client

Where you type the prompt

Claude Code

the terminal chat, same place you ask anything else

Claude Desktop

the normal message box

Cursor

the chat or composer panel

MCP servers load at startup, so restart your client after adding it. Then run /mcp and confirm diagrams-so shows 23 tools.

Now just ask, in plain English:

Generate an AWS three-tier web app with an ALB, EC2 Auto Scaling and RDS Multi-AZ. Show me the design warnings, then export it as draw.io.

Behind that one sentence the assistant calls generate_diagram, then get_warnings, then export_diagram. You never name a tool or write JSON.

More things worth asking, once you have a diagram:

The warnings mention no encryption in transit. Fix that one and show me the new score.

Add a CloudFront distribution in front of the ALB.

Re-export it as SVG so I can drop it in the README.

Every plan has unlimited diagrams and edits. Nothing is metered; there is only a per-minute rate limit. The Paid plan adds no watermark and draw.io export. Free diagrams can be private.

On the Paid plan the .drawio file the assistant saves opens at app.diagrams.net or in the desktop app, fully editable: it is real draw.io XML, not a picture. On the Free plan the tools return a watermarked image (SVG) instead, and say so; the editable draw.io file needs the Paid plan.

Prefer not to use an assistant at all? diagrams.so/create has the same thing as a web page: type the prompt in the box. No install, no login, no MCP.

Tools (23)

Create & change (mutating)

Tool

What it does

generate_diagram

Create a diagram from a prompt → id + warnings + score + draw.io XML (Paid) or a watermarked image link (Free)

edit_diagram

Apply a natural-language change (new version)

fix_warning

Resolve one Well-Architected warning

relayout_diagram

AI re-arrange the layout (async; asks for confirm=true)

import_diagram

Import existing draw.io XML as a new diagram

update_diagram

Rename / change visibility / replace XML

revert_diagram

Revert to an earlier version

delete_diagram

Soft-delete a diagram (destructive)

fork_template

Copy a public/library diagram into your account (private)

Read

Tool

What it does

get_diagram

Fetch a diagram's score + XML (Paid) or a watermarked image link (Free)

list_diagrams

List your diagrams (cursor-paginated)

get_warnings

Well-Architected findings for a diagram

export_diagram

Raw svg (every plan; watermarked on Free) or drawio (Paid; on Free you get the watermarked SVG)

list_versions

Version history (with is_current)

get_version

A specific version's score + XML (Paid) or a watermarked image link (Free)

get_relayout_status

Poll an async re-layout job

search_gallery

Search public community + curated library diagrams

enhance_prompt

Turn a rough idea into a detailed prompt

clarify_prompt

Get clarifying questions for a vague prompt

get_usage

Your plan and usage

get_usage_history

Past tasks (action, diagram, surface) with filters + a live session tally

whoami

Account, plan, scopes, live/test mode

list_capabilities

Valid diagram types / providers / export formats

Every tool is unlimited on every plan. delete is destructive, and relayout asks for confirm=true before it replaces the layout.

CLI

Commands

Installing the package puts diagrams-so on your PATH. The longer diagrams-so-mcp name still works, and npx @diagrams-so/mcp <command> works without installing anything.

npm i -g @diagrams-so/mcp

diagrams-so login          # connect this machine (a browser opens, press Approve)
diagrams-so whoami         # which account is this machine connected as
diagrams-so logout         # remove the local credential
diagrams-so install        # print client config to paste

Environment

Var

Required

Default

DIAGRAMS_API_KEY

❌

— (CI and headless only; login is the normal path)

DIAGRAMS_API_BASE

❌

https://api.diagrams.so/api/v2 (production; override for local/self-hosted)

DIAGRAMS_API_TIMEOUT_MS

❌

450000 (per-request safety-net; sits above the API's full server-side timeout ladder)

DIAGRAMS_BROWSER

❌

— (login opens your default browser; set e.g. Google Chrome when your Diagrams.so session lives in a non-default browser)

DIAGRAMS_NO_BROWSER

❌

— (set to any value to stop login opening a browser; the URL is always printed)

DIAGRAMS_NO_AUTO_LOGIN

❌

— (set to any value to disable in-tool connect; unauthenticated tools then just say to run login)

DIAGRAMS_LOGIN_EMAIL

❌

— (address for in-tool connect: the one-time sign-in code is emailed there; without it, unauthenticated tools say to run login instead of starting a connect)

Add it to your MCP client

The published package runs straight from npm, so there is no path to fill in and no key in the config. Run npx @diagrams-so/mcp install to print these blocks for your client.

Claude Code (CLI)

claude mcp add diagrams-so -- npx -y @diagrams-so/mcp
npx @diagrams-so/mcp login

Claude Desktop / Cursor (claude_desktop_config.json / mcp.json)

{
  "mcpServers": {
    "diagrams-so": {
      "command": "npx",
      "args": ["-y", "@diagrams-so/mcp"]
      // optional: "env": { "DIAGRAMS_API_BASE": "http://localhost:8000/api/v2" } for a local API
    }
  }
}

Connect either by running npx @diagrams-so/mcp login once, or, with DIAGRAMS_LOGIN_EMAIL set, by asking for a diagram and following the link the first tool call gives you (the sign-in code arrives by email). Set DIAGRAMS_API_KEY instead only for CI and headless machines, where no browser can open.

Restart the client, then ask: "Generate an AWS 3-tier web app diagram and show me the warnings."

One-click install (MCPB)

Download diagrams-so.mcpb from the latest release and drag it into Claude Desktop. No terminal, and it no longer asks for an API key: install it, then connect on first use by clicking the link the first tool call gives you.

Building the bundle yourself is a contributor step, see Developing locally.

Smithery

The server is listed at smithery.ai/servers/diagrams-so/mcp, which installs it for you and lists all 23 tools with their parameters:

npx -y smithery mcp add diagrams-so/mcp

Same package, same login step. It's the MCPB bundle Smithery installs, not the npm package, so the version shown there follows releases rather than npm dist-tags.

Verify it works

DIAGRAMS_API_KEY=dgz_live_your_key node test-smoke.mjs

Runs the full flow (connect → list tools → whoami → generate → warnings → fix → export → error handling).

Continuous integration & releases

Workflow

Trigger

What it does

CI (ci.yml)

every push / PR

npm ci + npm run build on Node 18/20/22, then a free smoke (scripts/ci-smoke.mjs) that launches the built server and asserts all 23 tools register. No API calls.

Live smoke (live-smoke.yml)

nightly + manual

the full end-to-end flow (test-smoke.mjs) against the real API. Calls the real API, so it runs only when the DIAGRAMS_API_KEY secret is set.

Release (release.yml)

tag vX.Y.Z

build → npm prune --omit=dev → pack diagrams-so.mcpb → attach to a GitHub Release. Publishes to npm too if an NPM_TOKEN secret is set.

Cut a release:

# bump "version" in package.json + manifest.json to match, commit, then:
git tag v1.2.0 && git push origin v1.2.0

The tag must match package.json's version (the workflow enforces this). The .mcpb bundle appears on the GitHub Release; manual workflow_dispatch produces it as a downloadable artifact without publishing (handy for testing a bundle).

Repo secrets/variables (optional): DIAGRAMS_API_KEY (live smoke), NPM_TOKEN (npm publish), DIAGRAMS_API_BASE variable (non-prod live-smoke target).

Notes

  • stdout is the MCP channel — the server logs only to stderr.

  • Errors come back as clean MCP tool errors carrying the API's code, HTTP status, and request_id.

  • The server never talks to internal services or the database — only the public /api/v2.

  • Long-running tools stay alive past client timeouts. generate / edit / fix / relayout / enhance_prompt / clarify_prompt emit a notifications/progress every 10s while running, so MCP clients that reset their request timeout on progress (resetTimeoutOnProgress) won't abort a slow generation at the SDK's 60s default. If your client doesn't reset on progress, raise its per-call timeout for these tools.

Developing locally

Only needed if you are changing the server itself. Users should install from npm, see Quick start.

git clone https://github.com/RedHold/diagrams-mcp-app-core.git
cd diagrams-mcp-app-core
npm install                  # installs deps and builds dist/ via the prepare hook
node scripts/ci-smoke.mjs    # all 23 tools register; no API calls

# point a client at your working copy
claude mcp add diagrams-so-dev -- node "$(pwd)/dist/index.js"

# build the MCPB bundle
npm run build && npx @anthropic-ai/mcpb pack
  • Code: Apache-2.0. See NOTICE.

  • Service: this server is a client for the Diagrams.so API. Use of the API is governed by the Terms of Service and Acceptable Use Policy; the code license grants no rights to the API itself.

  • Privacy: the server runs locally, connects only to api.diagrams.so, and contains no telemetry. Credentials from login are stored at ~/.diagrams-so/credentials.json with owner-only permissions. See the Privacy Policy.

  • Plans: every plan has unlimited diagrams and edits, with a per-minute rate limit. Paid adds no watermark and draw.io export; Free diagrams can be private. Test-mode keys act on your real account.

  • Trademarks: Diagrams.so and the Diagrams.so logo are trademarks of RedHold LLC. This license does not grant permission to use them, except to accurately describe the package's origin. See the Trademark Policy.

  • Security: report vulnerabilities to security@diagrams.so per SECURITY.md.

Available Tools

23 tools
clarify_promptClarify a vague promptA
Read-only

Get 1–3 clarifying questions (and a suggested diagram type) for a vague prompt, before generating. Free.

Inputs: prompt (required).

delete_diagramDelete a diagramA
Destructive

Delete (soft-delete) a diagram you own. It stops appearing in list_diagrams and can no longer be fetched. Confirm with the user before calling — this is destructive.

Inputs: diagram_id (required).

edit_diagramEdit a diagramA

Apply a natural-language change to an existing diagram (e.g. 'add a Redis cache'). Creates a new version and returns the updated XML. Costs credits. Confirm with the user before calling — it mutates the diagram.

Inputs: diagram_id (required), edit_prompt (required).

enhance_promptEnhance a promptC
Read-only

Turn a rough idea into a detailed generation prompt. Free.

Inputs: prompt (required), cloud_provider.

export_diagramExport a diagramA
Read-only

Export a diagram as a raw file: drawio (open at app.diagrams.net) or svg. Returns the file content directly. Exports are free on every plan. Free-plan SVG exports carry a watermark.

Inputs: diagram_id (required), format.

fix_warningFix one warningA

Resolve a single Well-Architected warning (from get_warnings), leaving the rest of the diagram untouched. Creates a new version. Costs credits.

Inputs: message (required), diagram_id (required), component, warning_type.

fork_templateFork a public diagramA

Copy a PUBLIC gallery diagram or curated library template into your own account (private) so you can edit it. Returns the new diagram id.

Inputs: diagram_id (required).

generate_diagramGenerate a diagramA

Create a new cloud architecture diagram from a natural-language prompt. Returns the diagram id, its draw.io XML, Well-Architected warnings, score, and credits used. Costs credits.

Inputs: prompt (required), opinionated, diagram_type, cloud_provider.

get_diagramGet a diagramA
Read-only

Fetch a diagram by id — returns its title, draw.io XML, and Well-Architected score.

Inputs: diagram_id (required).

get_relayout_statusPoll a re-layout jobA
Read-only

Check the status of an async re-layout job started by relayout_diagram. Returns pending/done/failed; when done+applied it includes the re-laid XML + fresh warnings/score. Free.

Inputs: job_id (required), diagram_id (required).

get_usageGet usage & creditsA
Read-only

Show your current plan, credits remaining, and per-action cost estimates. Free.

Inputs: no named parameters.

get_usage_historyCredit consumption historyA
Read-only

List how much credit each past task (generate/edit/fix/relayout) charged — newest first, with the diagram it touched and the surface (api/sdk/mcp) that ran it. Use this to answer 'how much did each task cost?'. Also shows a running tally of tasks performed in THIS session. Free (read-only).

Inputs: limit, since, until, action, +3 more.

get_versionGet a diagram versionA
Read-only

Fetch a specific version's XML + Well-Architected score (e.g. to inspect before reverting). Free.

Inputs: diagram_id (required), version_id (required).

get_warningsGet Well-Architected warningsA
Read-only

List the Well-Architected findings for a diagram (each has type, component, message). Free.

Inputs: diagram_id (required).

import_diagramImport a diagramA

Import an existing draw.io (mxGraphModel/mxfile) XML document as a new diagram in your account. Validated and sanitized. Free (no AI).

Inputs: xml (required), title, diagram_type, cloud_provider.

list_capabilitiesList capabilitiesA
Read-only

Discover the valid diagram types, cloud providers, and export formats the API supports — so you pass valid values to generate_diagram / export_diagram. Free.

Inputs: no named parameters.

list_diagramsList my diagramsA
Read-only

List your diagrams (newest first, cursor-paginated). Returns id, title, cloud, type.

Inputs: limit, cursor.

list_versionsList diagram versionsA
Read-only

List a diagram's version history (ascending; is_current marks the live one). Use with revert_diagram / get_version.

Inputs: diagram_id (required), limit, cursor.

relayout_diagramRe-arrange layout with AIA

Automatically re-arrange a diagram's layout for readability (async). Starts the job and waits for it to finish, returning the re-laid XML + fresh warnings/score. Every re-layout costs credits based on the tokens it uses (like edit/fix) and requires confirm=true. If the job is still running when the wait elapses, returns a job_id you can poll with get_relayout_status.

Inputs: diagram_id (required), confirm.

revert_diagramRevert to a versionA

Revert a diagram to an earlier version (from list_versions). Pass either version_id or version_number. Free (no AI).

Inputs: diagram_id (required), version_id, version_number.

update_diagramUpdate a diagramA

Update a diagram's metadata or XML: rename it, change visibility (public/private — paid plans for private), or replace its XML. Pass only the fields you want to change. Free (no AI).

Inputs: diagram_id (required), xml, title, is_public.

whoamiWho am IA
Read-only

Show the account, plan, scopes, and live/test mode of the configured API key. Free.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 23 tools

    Disambiguation5/5

    Each tool targets a distinct object/action: diagram CRUD vs versioning vs warnings vs relayout vs gallery vs usage/prompt helpers. Although update_diagram and edit_diagram are near-synonyms, their descriptions distinguish direct metadata/XML changes from AI natural-language edits, so an agent should not confuse them.

    Naming Consistency4/5

    Almost all names are snake_case verb_noun pairs (list_diagrams, get_version, fork_template, list_capabilities), with whoami as the only notable deviation from the object-bearing pattern. This is a minor exception to an otherwise consistent convention.

    Tool Count3/5

    At 23 tools this sits in the 16-25 range that feels heavy; the API covers many subdomains (diagram lifecycle, AI generation, warnings, relayout, gallery, usage) but several helper tools (whoami, get_usage, get_usage_history, clarify_prompt, enhance_prompt) could arguably be consolidated. Still, most tools map to a distinct operation.

    Completeness5/5

    The set covers the full diagram lifecycle: create (generate/import/fork), read (get/list), update (update/edit), delete, revert, version history, export, and warnings. There are no obvious dead ends; prompt helpers and usage tracking round out the workflow.

    Maintenance

    ActivitySlowing
    ResponsivenessMixed handling

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that generates professional infrastructure diagrams using the Python diagrams DSL, with first-class Azure support and GitHub Copilot integration for natural language diagram generation.
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      MCP server that enables LLMs to create and edit draw.io diagrams using high-level intent commands, with automatic layout and styling.
      4
      6 npm
      4
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      MCP server for creating and editing diagrams using draw.io. Allows generating diagrams from Mermaid or XML, searching shapes, and opening them in draw.io for export.
      2
      0
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for generating architecture diagrams with official vendor icons from natural language descriptions. Provides tools to validate specs, render diagrams, search icon catalog, and list available services.
      1
      MIT