Seamlessly create diagrams using the Python diagrams package DSL. This server allows you to generate AWS diagrams, sequence diagrams, flow diagrams, and class diagrams using Python code.
10K+
3 Tools
Version 4.43 or later needs to be installed to add the server automatically
Use cases
About
Seamlessly create diagrams using the Python diagrams package DSL. This server allows you to generate AWS diagrams, sequence diagrams, flow diagrams, and class diagrams using Python code.
Attribute | Details |
---|---|
Docker Image | mcp/aws-diagram |
Author | awslabs |
Repository | https://github.com/awslabs/mcp |
Dockerfile | https://github.com/awslabs/mcp/blob/main/src/aws-diagram-mcp-server/Dockerfile |
Docker Image built by | Docker Inc. |
Docker Scout Health Score | |
Verify Signature | COSIGN_REPOSITORY=mcp/signatures cosign verify mcp/aws-diagram --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub |
Licence | Apache License 2.0 |
Tools provided by this Server | Short Description |
---|---|
generate_diagram | Generate a diagram from Python code using the diagrams package. |
get_diagram_examples | Get example code for different types of diagrams. |
list_icons | List available icons from the diagrams package, with optional filtering. |
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 a PNG diagram without displaying it. 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.
CODE REQUIREMENTS:
COMMON PATTERNS:
IMPORTANT FOR CLINE: Always send the current workspace directory when calling this tool! The workspace_dir parameter should be set to the directory where the user is currently working so that diagrams are saved to a location accessible to the user.
Supported diagram types:
Returns: Dictionary with the path to the generated diagram and status information
Parameters | Type | Description |
---|---|---|
code | string | Python code using the diagrams package DSL. The runtime already imports everything needed so you can start immediately using with Diagram( |
filename | string optional | The filename to save the diagram to. If not provided, a random name will be generated. |
timeout | integer optional | The timeout for diagram generation in seconds. Default is 90 seconds. |
workspace_dir | string optional | The 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' subdirectory. |
get_diagram_examples
Get example code for different types of diagrams.
This tool provides ready-to-use example code for various diagram types. Use these examples to understand the syntax and capabilities of the diagrams package before creating your own custom diagrams.
USAGE INSTRUCTIONS:
EXAMPLE CATEGORIES:
Each example demonstrates different features of the diagrams package:
Parameters: diagram_type (str): Type of diagram example to return. Options: aws, sequence, flow, class, k8s, onprem, custom, all
Returns: Dictionary with example code for the requested diagram type(s), organized by example name
Parameters | Type | Description |
---|---|---|
diagram_type | string optional | Type of diagram example to return. Options: aws, sequence, flow, class, k8s, onprem, 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:
Example workflow:
This approach is more efficient than loading all icons at once, especially when you only need icons from specific providers or services.
Returns: Dictionary with available providers, services, and icons organized hierarchically
Parameters | Type | Description |
---|---|---|
provider_filter | string optional | Filter icons by provider name (e.g., "aws", "gcp", "k8s") |
service_filter | string optional | Filter icons by service name (e.g., "compute", "database", "network") |
{
"mcpServers": {
"aws-diagram": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/aws-diagram"
]
}
}
}
Manual installation
You can install the MCP server using:
Installation for