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 分

    请在仓库或注册中心条目中声明许可证。