Back to Home
andrewmoshu icon

diagram-mcp-server

by andrewmoshu

Overview

Generates infrastructure diagrams from Python code or Infrastructure-as-Code (IaC) files across various cloud providers and on-premises environments.

Installation

Run Command
uvx infrastructure-diagram-mcp-server

Environment Variables

  • FASTMCP_LOG_LEVEL
  • CFLAGS
  • LDFLAGS
  • INCLUDE
  • LIB

Security Notes

The server uses `exec()` to run user-provided Python code in the `generate_diagram` function. While a code scanner (`bandit` and custom checks for dangerous functions like `exec`, `eval`, `os.system`, `subprocess`) is implemented to detect and reject potentially malicious code, relying on a detection mechanism for arbitrary code execution is inherently risky. A sophisticated bypass could lead to remote code execution. Additionally, `urllib.request.urlretrieve` can fetch content from arbitrary URLs if allowed by the code, posing potential supply chain or SSRF risks.

Similar Servers

Stats

Interest Score89
Security Score3
Cost ClassHigh
Avg Tokens5000
Stars30
Forks3
Last Update2026-01-17

Tags

diagramsinfrastructurecloudiacautomation