Diagrams MCP

io.github.mskry由 GitHub 帳號 mskry 發布v0.1.2更新於 Nov 2, 2026

Generate cloud architecture diagrams, flowcharts, and sequence diagrams.

已驗證Streamable HTTP可網頁執行雲端與基礎設施媒體與設計

概覽

AI 產生的概覽

透過 mingrammer/diagrams、Mermaid 與 PlantUML 產生雲端架構圖、流程圖、時序圖與 UML 圖,並以圖片形式回傳。

可以做什麼
  • 探索圖節點:列出雲端供應商、服務類別與節點類別,並依關鍵字跨供應商搜尋節點。
  • 以 Python 程式碼算繪基於 mingrammer/diagrams 的雲端架構圖。
  • 算繪 Mermaid 定義,例如流程圖、時序圖、類別圖、ER 圖、狀態圖與甘特圖。
  • 算繪 PlantUML 定義,例如時序圖、類別圖、元件圖、活動圖與部署圖。
  • 跨雲比較服務:尋找對等節點並列出基礎設施角色分類。
  • 讀取 diagram、edge、cluster、Mermaid 與 PlantUML 語法的參考資源。
適用情境
適合讓助理把描述的系統直接畫成圖:AWS、GCP、Azure 或 Kubernetes 架構圖、流程圖、時序圖或 UML,不必手動繪製。
執行需求
可使用託管的遠端端點,或透過 uvx 或 pip 在本機安裝(Python)。本機算繪需要 Graphviz;Mermaid CLI(Node.js)以及 Java 加 PlantUML 為選用,僅在需要對應引擎時安裝。未宣告需要帳號或 API 金鑰。
安裝前請注意
render_diagram 會在沙箱子程序中執行 Python 指令碼,執行前應檢查產生的程式碼。託管端點會接收你的圖表程式碼與定義;若內容敏感,請改用本機模式。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Diagrams MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.mskry%2Fdiagrams-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "diagrams": {
      "type": "http",
      "url": "https://diagrams-mcp-production.up.railway.app/mcp"
    }
  }
}

README

diagrams-mcp-server

[PyPI] [CI]

MCP server for generating cloud architecture diagrams, flowcharts, sequence diagrams, and more — powered by three rendering engines: mingrammer/diagrams, Mermaid, and PlantUML.

[Example diagram]

Getting Started

Local Installation

Prerequisites

Graphviz is required for the default local/in-process rendering mode. Mermaid CLI and PlantUML are optional — install them only if you need those specific rendering engines locally.

DependencyRequired forInstall
Graphvizrender_diagram (cloud architecture)brew install graphviz
Mermaid CLIrender_mermaid (flowcharts, sequence, etc.)npm install -g @mermaid-js/mermaid-cli
Java + PlantUMLrender_plantuml (UML diagrams)brew install openjdk + download plantuml.jar
Install the server

Via uvx (recommended):

bash
uvx diagrams-mcp-server

Via pip:

bash
pip install diagrams-mcp-server

From source:

bash
pip install git+https://github.com/ByteOverDev/diagrams-mcp.git
Configure your MCP client
Claude Desktop

Add to your claude_desktop_config.json (Settings → Developer → Edit Config):

uvx (recommended):

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "uvx",      "args": ["diagrams-mcp-server"]    }  }}

pip:

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "diagrams-mcp-server"    }  }}
Claude Code (CLI)

Run:

bash
claude mcp add diagrams-mcp -- uvx diagrams-mcp-server

Or add to your .mcp.json:

uvx (recommended):

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "uvx",      "args": ["diagrams-mcp-server"]    }  }}

pip:

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "diagrams-mcp-server"    }  }}
Cursor

Add to your .cursor/mcp.json:

uvx (recommended):

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "uvx",      "args": ["diagrams-mcp-server"]    }  }}

pip:

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "diagrams-mcp-server"    }  }}
Windsurf

Add to your ~/.codeium/windsurf/mcp_config.json:

uvx (recommended):

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "uvx",      "args": ["diagrams-mcp-server"]    }  }}

pip:

json
{  "mcpServers": {    "diagrams-mcp": {      "command": "diagrams-mcp-server"    }  }}
VS Code

Add to your .vscode/mcp.json:

uvx (recommended):

json
{  "servers": {    "diagrams-mcp": {      "type": "stdio",      "command": "uvx",      "args": ["diagrams-mcp-server"]    }  }}

pip:

json
{  "servers": {    "diagrams-mcp": {      "type": "stdio",      "command": "diagrams-mcp-server"    }  }}

Available Tools

Discovery

  • list_providers() → list[str] — List all diagram providers (aws, gcp, k8s, azure, onprem, etc.)
  • list_services(provider) → list[str] — List service categories within a provider (e.g. aws → compute, database, network)
  • list_nodes(provider, service) → list[dict] — List node classes for a provider.service pair with import paths
  • search_nodes(query) → list[dict] — Search for nodes by keyword across all providers (e.g. "postgres", "lambda")

Rendering

  • render_diagram(code) → Image (PNG) — Execute a Python script using mingrammer/diagrams in a sandboxed subprocess. Returns a rendered cloud architecture diagram.
  • render_mermaid(definition) → Image (PNG/SVG) — Render a Mermaid diagram definition (flowcharts, sequence, class, ER, state, Gantt, and more).
  • render_plantuml(definition) → Image (PNG) — Render a PlantUML diagram definition (sequence, class, component, activity, state, deployment).

Cross-Provider Equivalence

  • find_equivalent(node, target_provider?) → dict — Find equivalent services across cloud providers (e.g. EC2 → ComputeEngine on GCP).
  • list_categories() → list[dict] — List all 30 infrastructure role categories with mapped nodes across providers.

Resources

The server provides reference documentation accessible via MCP resource URIs:

URIDescription
diagrams://reference/diagramDiagram constructor parameters, defaults, and usage
diagrams://reference/edgeEdge operators, labels, styling, and chaining
diagrams://reference/clusterCluster nesting, styling, and graph attributes
diagrams://reference/mermaidMermaid syntax examples for 6 diagram types
diagrams://reference/plantumlPlantUML syntax examples for 6 diagram types

Examples

Cloud Architecture (mingrammer/diagrams)

"Draw an AWS architecture with an ALB routing to two ECS services, backed by RDS and ElastiCache"

python
from diagrams import Diagram, Clusterfrom diagrams.aws.network import ALBfrom diagrams.aws.compute import ECSfrom diagrams.aws.database import RDS, ElastiCache
with Diagram("ECS Service", direction="LR"):    lb = ALB("ALB")
    with Cluster("ECS Cluster"):        services = [ECS("Web"), ECS("API")]
    lb >> services    services[0] >> ElastiCache("Cache")    services[1] >> RDS("Database")

Flowchart (Mermaid)

"Create a flowchart showing a CI/CD pipeline"

[Mermaid flowchart]

Sequence Diagram (PlantUML)

"Show the authentication flow between a client, API gateway, and auth service"

[PlantUML sequence diagram]

plantuml
@startumlClient -> "API Gateway": POST /login"API Gateway" -> "Auth Service": Validate credentials"Auth Service" --> "API Gateway": JWT token"API Gateway" --> Client: 200 OK + tokenClient -> "API Gateway": GET /data (Bearer token)"API Gateway" -> "Auth Service": Verify token"Auth Service" --> "API Gateway": Valid"API Gateway" --> Client: 200 OK + data@enduml

Development

bash
# Clone and installgit clone https://github.com/ByteOverDev/diagrams-mcp.gitcd diagrams-mcppip install -e ".[dev]"
# Run testspytest
# Lint and formatruff check .ruff format .
# Run the MCP server locally (stdio mode)diagrams-mcp-server

Split Facade/Renderer Mode

For hosted deployments, the MCP server can run as a lightweight facade that delegates render work to a separate renderer service. This keeps the always-on MCP process small while Graphviz, Chromium, Mermaid CLI, Java, and PlantUML live only in the renderer image.

bash
# Terminal 1: renderer serviceRENDERER_HOST=0.0.0.0 RENDERER_PORT=8001 diagrams-renderer-server
# Terminal 2: HTTP MCP facade delegating to the rendererFASTMCP_TRANSPORT=http \FASTMCP_HOST=0.0.0.0 \FASTMCP_PORT=8000 \DIAGRAMS_RENDERER_MODE=remote \DIAGRAMS_RENDERER_URL=http://127.0.0.1:8001 \diagrams-mcp-server

Docker/Railway examples are included:

FilePurpose
Dockerfile.facadeSlim MCP facade image without renderer-only binaries
Dockerfile.rendererRenderer image with Graphviz, Chromium, Mermaid CLI, Java, and PlantUML
railway.facade.tomlExample Railway facade service config
railway.renderer.tomlExample Railway renderer service config

Key environment variables:

VariablePurpose
DIAGRAMS_RENDERER_MODE=remoteMakes the facade use the HTTP renderer service
DIAGRAMS_RENDERER_URLRenderer base URL, for example http://diagrams-renderer.railway.internal:8080
DIAGRAMS_IMAGE_STORE_DIROptional file-backed temporary image store directory
BASE_URLOptional public base URL used when returning absolute download links

Supported Providers

The render_diagram tool supports all providers from the mingrammer/diagrams library, including:

AWS, GCP, Azure, Kubernetes, On-Premise, AlibabaCloud, OCI, OpenStack, DigitalOcean, Elastic, Outscale, Generic, and Custom nodes.

Use list_providers() and search_nodes(query) to discover available nodes.

License

MIT

來源:README.md,提交 121aa4b

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 75%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。