infrastructure-diagram-mcp-server

v0.0.4.3
infrastructure-diagram-mcp-server Checked 2 days ago Published 10 months ago

An MCP server that seamlessly creates infrastructure diagrams for any cloud provider using the Python diagrams package DSL

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

generate_diagram

Generate a diagram from Python code using the diagrams package. This tool accepts Python code as a string that uses the diagrams package DSL and generates both PNG and editable .drawio files. The code is executed with show=False to prevent automatic display. USAGE INSTRUCTIONS: Never import. Start writing code immediately with `with Diagram(` and use the icons you found with list_icons. 1. First use get_diagram_examples to understand the syntax and capabilities 2. Then use list_icons to discover all available icons. These are the only icons you can work with. 3. You MUST use icon names exact…

ParameterTypeDescription
code *stringPython code using the diagrams package DSL. The runtime already imports everything needed so you can start immediately using `with Diagram(`
filenameThe filename to save the diagram to. If not provided, a random name will be generated.
timeoutintegerThe timeout for diagram generation in seconds. Default is 90 seconds.
workspace_dirThe user's current workspace directory. CRITICAL: Client must always send the current workspace directory when calling this tool! If provided, diagrams will be saved to a 'generated-diagrams' subdirec…

get_diagram_examples

Get example code for different types of diagrams. This tool provides ready-to-use example code for various diagram types across all major cloud providers, on-premises, hybrid, and multi-cloud architectures. Use these examples to understand the syntax and capabilities of the diagrams package before creating your own custom diagrams. USAGE INSTRUCTIONS: 1. Select the diagram type you're interested in (or 'all' to see all examples) 2. Study the returned examples to understand the structure and syntax 3. Use these examples as templates for your own diagrams 4. When ready, modify an example or wr…

ParameterTypeDescription
diagram_typeType of diagram example to return. Options: aws, gcp, azure, k8s, onprem, hybrid, multicloud, sequence, flow, class, custom, all

list_icons

List available icons from the diagrams package, with optional filtering. This tool dynamically inspects the diagrams package to find available providers, services, and icons that can be used in diagrams. USAGE INSTRUCTIONS: 1. Call without filters to get a list of available providers 2. Call with provider_filter to get all services and icons for that provider 3. Call with both provider_filter and service_filter to get icons for a specific service Example workflow: - First call: list_icons() → Returns all available providers - Second call: list_icons(provider_filter="aws") → Returns all…

ParameterTypeDescription
provider_filterFilter icons by provider name (e.g., "aws", "gcp", "k8s")
service_filterFilter icons by service name (e.g., "compute", "database", "network")

parse_k8s_manifest

Parse Kubernetes YAML manifests and extract resources and their relationships. This tool parses K8s manifests and returns structured data about resources and connections. After receiving the parsed data, use list_icons to find appropriate icons, then generate_diagram. SUPPORTED INPUTS: - Single YAML file path: "/path/to/deployment.yaml" - Directory path: "/path/to/k8s-manifests/" (parses all .yaml/.yml files) - Inline YAML content: Paste the YAML directly (supports multi-document with ---) SUPPORTED RESOURCES: - Workloads: Pod, Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob -…

ParameterTypeDescription
input_source *stringFile path to YAML file/directory, OR inline YAML content (multi-document supported with --- separators)

parse_helm_chart

Parse a Helm chart and extract K8s resources and their relationships. This tool parses Helm charts and returns structured data about resources and connections. After receiving the parsed data, use list_icons to find appropriate icons, then generate_diagram. INPUTS: - chart_path: Directory containing Chart.yaml, or path to .tgz packaged chart - values_file: Optional values.yaml override file - values_inline: Optional inline YAML values as a string HELM CLI: - If `helm` is available on PATH, uses `helm template` for accurate rendering - If unavailable, falls back to basic Go template parsing…

ParameterTypeDescription
chart_path *stringPath to Helm chart directory (containing Chart.yaml) or .tgz file
namespacestringTarget namespace for templating
release_namestringHelm release name for templating
values_filePath to values.yaml override file
values_inlineInline YAML values to override chart defaults (as a YAML string)

parse_terraform

Parse Terraform configurations and extract resources and their relationships. This tool parses Terraform HCL files and returns structured data about resources and connections. After receiving the parsed data, use list_icons to find appropriate icons, then generate_diagram. SUPPORTED INPUTS: - Single .tf file: "/path/to/main.tf" - Directory: "/path/to/terraform/" (parses all .tf files) - Inline HCL: Paste Terraform code directly SUPPORTED PROVIDERS: - AWS (aws_*): EC2, Lambda, S3, RDS, VPC, EKS, etc. - GCP (google_*): Compute Engine, Cloud Run, GKE, BigQuery, etc. - Azure (azurerm_*): VMs, A…

ParameterTypeDescription
input_source *stringPath to .tf file, directory containing .tf files, OR inline HCL content