
Architecture Diagrams
io.github.apatilgtn由 GitHub 帳號 apatilgtn 發布v1.2.0更新於 Oct 29, 2026
AWS, Azure and GCP architecture diagrams with official icons, reviews, Terraform and GCP import
概覽
產生、審查並匯入 AWS、Azure 與 GCP 架構圖,使用官方圖示,可輸出為 PNG、SVG、PDF 或 JPG。
- 可以做什麼
- 搜尋與瀏覽官方雲端服務圖示庫及內建參考架構範本
- 驗證架構圖規格並算繪成 PNG、SVG、PDF 或 JPG,附內嵌預覽
- 執行啟發式 Well-Architected 審查,回傳 0–100 分數、等級與問題建議
- 從 Terraform plan 或 state JSON,以及 Google Cloud Asset Inventory 匯出檔建立架構圖,保留真實資源名稱
- 回報伺服器版本、Graphviz 狀態、圖示數量、輸出目錄與各項限制
- 適用情境
- 適合讓助理繪製或記錄雲端架構、把現有 Terraform 或執行中的 Google Cloud 專案轉成架構圖,或對設計方案做一次快速的結構性審查。
- 執行需求
- 透過 uvx 或 npx 以 stdio 在本機執行(npm 套件會經由 uv 或 pipx 啟動 PyPI 套件)。需要 Python 3.11+ 與 Graphviz。選用環境變數可設定輸出資料夾(ARCH_DIAGRAM_OUTPUT_DIR)與允許讀取 Terraform 檔案的資料夾(ARCH_DIAGRAM_INPUT_ROOTS)。匯入 GCP 清單需要 Cloud Asset Inventory 匯出檔與 roles/cloudasset.viewer 權限。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Architecture Diagrams,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Architecture Diagram MCP Server
arch-diagram-mcp is an MCP server that generates, reviews and imports cloud architecture diagrams for
AWS, Azure and Google Cloud. It uses the official provider icons, about 1,800 in all, including
Kubernetes, on-prem and SaaS services such as PostgreSQL, Redis, Kafka and Nginx. Diagrams render
through Graphviz to PNG, self-contained SVG, PDF or JPG.
You can design new architectures, or diagram what already exists: from Terraform, or straight from a running Google Cloud project's own inventory, with the real resource names, however it was created.
Quick start. Install Graphviz, then add the server to your MCP client with any of these:
For example, in Claude Code: claude mcp add architecture-diagrams -s user -- uvx arch-diagram-mcp.
It is also listed in the MCP Registry as
io.github.apatilgtn/architecture-diagrams.
Using it as a developer? Start with the developer guide. It covers connecting Claude Code, VS Code, Cursor or Claude Desktop, on your machine or to a shared team server, and gives example prompts. The rest of this README is for running and configuring the server.
Samples
These are the bundled templates and the Terraform example, rendered exactly as the server produces them.
The score is from review_architecture. Click a diagram for the full-size image.
To regenerate them, run python scripts/render_samples.py.
The server has also been tested end to end on Google Cloud: a private bucket with signed URLs, and a private Cloud Run service with two layers of auth. See docs/CLOUD_TESTING.md for how it was tested, what was checked and the bug it found.
Tools
There is also one prompt, design_architecture(provider, workload, requirements). It walks the model
through choosing a template, searching icons, validating, rendering and reviewing.
Bundled templates
aws_three_tieraws_serverless_event_drivenazure_webapp_hub_spokeazure_aks_microservicesgcp_serverless_datagcp_gke_microservices
Every template is tested to validate, to render, and to have no critical- or high-severity review findings.
Diagram spec
Review rules
The rules only see what the diagram shows. Treat findings as review prompts, not proof of a misconfiguration.
Terraform import
terraform show -json plan.out > plan.json gives the best result, because the plan includes the
configuration's references.
- Mapped resources: about 140 AWS, Azure and GCP resource types become nodes.
- Boundaries: VPC/VNet, subnet, resource group and Container Apps environment resources become nested clusters. Nodes are placed in the most specific boundary they reference, either directly or through a NIC.
- Edges: references between resources become edges, and module outputs are resolved.
- Inferred edges: links that pass through plumbing resources become dashed edges, oriented edge → compute → messaging → data. Plumbing resources include listeners, target groups, NICs, role assignments, Front Door origins and backend services.
- Unmapped types: the result lists them, so you can see what was left out.
Inventory import (Google Cloud)
For infrastructure that is already running, however it was created (console, gcloud, scripts,
Terraform, Pulumi), export the project's inventory and pass it to diagram_from_inventory:
--gcp-asset-types prints the 54 asset types the importer uses. Asking only for those keeps the
export small: a test project went from 4.4 MB to 535 KB with the same diagram. The caller needs
roles/cloudasset.viewer and the Cloud Asset API enabled.
- Names: every node keeps its real name. A second line adds detail, such as the database version, machine type, ingress setting, replica count or cron schedule.
- Boundaries: Project › VPC › Subnet › GKE cluster › Namespace. Shared VPC networks owned by another project are drawn under that project. Cloud Run with direct VPC egress sits in its subnet.
- Edges from configuration:
- Cloud SQL, secret, KMS, Pub/Sub, bucket and Redis references in annotations and environment variables;
- URLs matched to the Cloud Run service or function that owns them (push subscriptions, Scheduler targets, env vars);
- the load balancer chain (forwarding rule › proxy › URL map › backend › NEG, bucket or MIG), with path rules, CDN and Cloud Armor;
- Eventarc triggers, dead-letter topics, BigQuery and Cloud Storage subscriptions, VPC connectors.
- Noise left out: GKE system namespaces and nodes, MIG member VMs (drawn as one MIG), Cloud Functions' own Run services, build and staging buckets, routes, firewalls and RBAC objects.
- Filters:
projectsandregionsare hard limits.labels(for example{"app": "payments"}) selects resources plus the ones they connect to (include_neighbors, on by default). - Limits: calls that exist only in application code can't be seen. The result returns the spec,
so you can add those edges and re-render. External hosts found in env vars are listed in
external_hosts.
Accepted formats: gcloud asset list JSON (recommended), gcloud asset export newline-delimited
JSON, and gcloud asset search-all-resources --read-mask='*' JSON. Azure Resource Graph and AWS
inventories are planned.
Install
Requires Python 3.11+ and Graphviz.
Register with Claude Code (stdio)
Run as a shared HTTP service
Clients connect to https://<host>/mcp with Authorization: Bearer <token>. GET /healthz is
unauthenticated and works as a probe. The server runs stateless, so it scales horizontally behind a
load balancer. All replicas must share ARCH_DIAGRAM_URL_SIGNING_KEY so any replica can serve any link.
Authentication
Token mode. Several named tokens can be active at once. To rotate, add the new token, roll out clients, then remove the old one. Each token must be at least 16 characters.
OIDC mode. The server validates JWTs against the issuer's published signing keys (JWKS, found by
discovery or set with ARCH_DIAGRAM_OIDC_JWKS_URI). It checks:
- signature (asymmetric algorithms only: no HS*, no
none); issandaud;expandnbf, with 60 s leeway;- optional
ARCH_DIAGRAM_OIDC_REQUIRED_SCOPES.
Roles come from the roles claim (Entra app roles) and the scp scope claim:
- Reader: search, templates, validate, review.
- Author: also render, and import Terraform or cloud inventories. Author implies Reader.
- If neither role variable is set, any valid token gets full access.
The server publishes RFC 9728 metadata at /.well-known/oauth-protected-resource, and every 401
response points to it, so MCP clients can discover the authorization server.
Entra ID example:
- Register an API app with Application ID URI
api://arch-diagrams. - Set
accessTokenAcceptedVersion: 2in its manifest. - Add app roles
Diagrams.ReaderandDiagrams.Author, and assign them to groups. - Configure the server:
Entra ID has no dynamic client registration. Clients either use a pre-registered client app, or pass
a token they already hold, e.g. az account get-access-token --resource api://arch-diagrams.
Artifact storage
Over HTTP, responses contain download URLs instead of server file paths:
- Object keys:
<prefix>/<yyyy>/<mm>/<dd>/<sha256(caller)[:16]>/<file>. Files are separated per caller, and keys never contain user names. - Link lifetime: set by
ARCH_DIAGRAM_URL_TTL_S, default 1 h, maximum 7 days. - Cleanup:
ARCH_DIAGRAM_DELETE_LOCAL_AFTER_UPLOAD=trueremoves local copies once a cloud upload succeeds. For cloud objects, use a bucket lifecycle rule. - Served SVGs: sent with
Content-Security-Policy: sandboxandnosniff. - Terraform paths:
diagram_from_terraform(path=...)is disabled over HTTP, so remote callers can't read server files.
Configuration (environment)
Security model
- Spec validation: ids, colours and styles are pattern-checked, and size limits apply.
- Text escaping: titles, node labels and cluster labels are always written as literal strings,
never as Graphviz HTML labels. Edge labels are HTML-escaped. A label therefore can't inject DOT
statements, such as an
image=attribute that reads local files. - Rendering: Graphviz runs as a subprocess with a hard timeout, and partial output is deleted on failure.
- Output files: file names are sanitised, timestamped and uniquely suffixed. Retention cleanup only touches files the server generated.
- Terraform input: file reads are confined to
ARCH_DIAGRAM_INPUT_ROOTSand size-limited. - HTTP:
- Static tokens are compared in constant time against every configured token.
- OIDC JWTs are fully validated, and key-confusion and
alg: nonetokens are rejected (both are tested). - Per-tool RBAC applies, and every audit line records the caller.
- The server refuses to bind to a public address without authentication.
- DNS-rebinding protection uses Host/Origin allow-lists.
- The container runs as a non-root user.
- SVG output: icons are embedded, so the files don't leak local paths and render anywhere.
Layout
License
Apache-2.0. The bundled provider icons come from the diagrams library and remain subject to their owners' terms.
來源:README.md,提交 5bf6e79
工具
0版本歷史
1- v1.2.0最新Oct 29, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分