An MCP server that seamlessly creates infrastructure diagrams for any cloud provider using the Python diagrams package DSL
Project description
Infrastructure Diagram MCP Server
Model Context Protocol (MCP) server for Multi-Cloud Infrastructure Diagrams
This MCP server seamlessly creates diagrams using the Python diagrams package DSL. This server allows you to generate professional infrastructure diagrams for any cloud provider (AWS, GCP, Azure), Kubernetes, on-premises, hybrid, and multi-cloud architectures using Python code.
Prerequisites
- Install
uvfrom Astral or the GitHub README - Install Python using
uv python install 3.10 - Install GraphViz https://www.graphviz.org/
Installation
Configure the MCP server in your MCP client configuration (e.g., for Kiro, edit ~/.kiro/settings/mcp.json):
{
"mcpServers": {
"awslabs.aws-diagram-mcp-server": {
"command": "uvx",
"args": ["awslabs.aws-diagram-mcp-server"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
},
"autoApprove": [],
"disabled": false
}
}
}
Windows Installation
For Windows users, the MCP server configuration format is slightly different:
{
"mcpServers": {
"awslabs.aws-diagram-mcp-server": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uv",
"args": [
"tool",
"run",
"--from",
"awslabs.aws-diagram-mcp-server@latest",
"awslabs.aws-diagram-mcp-server.exe"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1"
}
}
}
}
or docker after a successful docker build -t awslabs/aws-diagram-mcp-server .:
{
"mcpServers": {
"awslabs.aws-diagram-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"awslabs/aws-diagram-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
Features
The Infrastructure Diagram MCP Server provides the following capabilities:
- Multi-Provider Support: Create diagrams for AWS, GCP, Azure, Kubernetes, on-premises, and hybrid/multi-cloud architectures
- 2000+ Icons: Access to icons across all major cloud providers and services
- Multiple Diagram Types: Infrastructure architecture, sequence diagrams, flow charts, class diagrams, and more
- Rich Examples: Pre-built templates for AWS, GCP, Azure, K8s, hybrid, and multi-cloud patterns
- Customization: Customize diagram appearance, layout, styling, colors, and connections
- Security: Built-in code scanning to ensure secure diagram generation
- Flexible Output: Save diagrams to PNG format in your workspace directory
Quick Examples
AWS Serverless Application
from diagrams import Diagram
from diagrams.aws.compute import Lambda
from diagrams.aws.database import Dynamodb
from diagrams.aws.network import APIGateway
with Diagram("Serverless Application", show=False):
api = APIGateway("API Gateway")
function = Lambda("Function")
database = Dynamodb("DynamoDB")
api >> function >> database
GCP Microservices
from diagrams import Diagram, Cluster
from diagrams.gcp.compute import CloudRun
from diagrams.gcp.network import LoadBalancing
from diagrams.gcp.database import SQL
with Diagram("GCP Microservices", show=False):
lb = LoadBalancing("load balancer")
with Cluster("Services"):
services = [CloudRun("api"), CloudRun("worker")]
db = SQL("database")
lb >> services >> db
Azure Web App
from diagrams import Diagram
from diagrams.azure.web import AppService
from diagrams.azure.database import SQLServer
from diagrams.azure.storage import BlobStorage
with Diagram("Azure Web App", show=False):
AppService("web") >> SQLServer("db") >> BlobStorage("storage")
Multi-Cloud Architecture
from diagrams import Diagram, Cluster
from diagrams.aws.compute import EC2
from diagrams.gcp.compute import CloudRun
from diagrams.azure.web import AppService
with Diagram("Multi-Cloud Setup", show=False):
with Cluster("AWS"):
aws = EC2("primary")
with Cluster("GCP"):
gcp = CloudRun("backup")
with Cluster("Azure"):
azure = AppService("cdn")
aws >> [gcp, azure]
Development
Testing
The project includes a comprehensive test suite to ensure the functionality of the MCP server. The tests are organized by module and cover all aspects of the server's functionality.
To run the tests, use the provided script:
./run_tests.sh
This script will automatically install pytest and its dependencies if they're not already installed.
Or run pytest directly (if you have pytest installed):
pytest -xvs tests/
To run with coverage:
pytest --cov=awslabs.aws_diagram_mcp_server --cov-report=term-missing tests/
For more information about the tests, see the tests README.
Development Dependencies
To set up the development environment, install the development dependencies:
uv pip install -e ".[dev]"
This will install the required dependencies for development, including pytest, pytest-asyncio, and pytest-cov.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file infrastructure_diagram_mcp_server-0.0.1.tar.gz.
File metadata
- Download URL: infrastructure_diagram_mcp_server-0.0.1.tar.gz
- Upload date:
- Size: 193.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51ea42891a5290ad6d51c349a661a0806961823f2b09cd57dbcaf74f691fd3e2
|
|
| MD5 |
7353463e4379ff12e4768ec74e32467a
|
|
| BLAKE2b-256 |
d073d78ee334c68e51b297b78b66a3915267a40c0c47f480e1b694baa60fd85a
|
File details
Details for the file infrastructure_diagram_mcp_server-0.0.1-py3-none-any.whl.
File metadata
- Download URL: infrastructure_diagram_mcp_server-0.0.1-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
318169c6ca99dcf6a7c9a2635264a3559891e5f84d5f9ccc1274f2a95b24a667
|
|
| MD5 |
661f4812f2e0efbf23069a6f787b7c29
|
|
| BLAKE2b-256 |
dc05c1fb5691ed3093d3cfa35ef6912799c25c77a7e84e60201e1c9b1afc7f18
|