AWS Diagram MCP Server
Enables creation of AWS architecture diagrams using AWS service icons and components like Lambda, DynamoDB, API Gateway, and other AWS services through Python code generation.
Supports deployment and execution of the diagram generation server through Docker containers for creating AWS and other technical diagrams.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AWS Diagram MCP Server create a diagram for a serverless API with Lambda and DynamoDB"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AWS Diagram MCP Server
Model Context Protocol (MCP) server for AWS Diagrams
This MCP server that seamlessly creates 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.
Prerequisites
Install
uvfrom Astral or the GitHub READMEInstall Python using
uv python install 3.10Install GraphViz https://www.graphviz.org/
Related MCP server: diagrams-mcp
Installation
Cursor | VS Code |
Configure the MCP server in your MCP client configuration.
directly from Git:
{
"mcpServers": {
"aws-diagram-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"git+https://github.com/lukeburciu/aws-diagrams-mcp-server@main",
"aws-diagram-mcp-server"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
},
"autoApprove": [],
"disabled": false
}
}
}Features
The Diagrams MCP Server provides the following capabilities:
Generate Diagrams: Create professional diagrams using Python code
Multiple Diagram Types: Support for AWS architecture, sequence diagrams, flow charts, class diagrams, and more
Customization: Customize diagram appearance, layout, and styling
Security: Code scanning to ensure secure diagram generation
Quick Example
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 >> databaseDevelopment
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.shThis 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.
Available Tools
3 toolsgenerate_diagramA
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.
First use get_diagram_examples to understand the syntax and capabilities
Then use list_icons to discover all available icons. These are the only icons you can work with.
You MUST use icon names exactly as they are in the list_icons response, case-sensitive.
Write your diagram code following python diagrams examples. Do not import any additional icons or packages, the runtime already imports everything needed.
Submit your code to this tool to generate the diagram
The tool returns the path to the generated PNG file
For complex diagrams, consider using Clusters to organize components
Diagrams should start with a user or end device on the left, with data flowing to the right.
CODE REQUIREMENTS:
Must include a Diagram() definition with appropriate parameters
Can use any of the supported diagram components (AWS, K8s, etc.)
Can include custom styling with Edge attributes (color, style)
Can use Cluster to group related components
Can use custom icons with the Custom class
COMMON PATTERNS:
Basic: provider.service("label")
Connections: service1 >> service2 >> service3
Grouping: with Cluster("name"): [components]
Styling: service1 >> Edge(color="red", style="dashed") >> service2
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:
AWS architecture diagrams
Sequence diagrams
Flow diagrams
Class diagrams
Kubernetes diagrams
On-premises diagrams
Custom diagrams with custom nodes
Returns: Dictionary with the path to the generated diagram and status information
Inputs: code (required), filename, timeout, workspace_dir.
get_diagram_examplesA
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:
Select the diagram type you're interested in (or 'all' to see all examples)
Study the returned examples to understand the structure and syntax
Use these examples as templates for your own diagrams
When ready, modify an example or write your own code and use generate_diagram
EXAMPLE CATEGORIES:
aws: AWS cloud architecture diagrams (basic services, grouped workers, clustered web services, Bedrock)
sequence: Process and interaction flow diagrams
flow: Decision trees and workflow diagrams
class: Object relationship and inheritance diagrams
k8s: Kubernetes architecture diagrams
onprem: On-premises infrastructure diagrams
custom: Custom diagrams with custom icons
all: All available examples across categories
Each example demonstrates different features of the diagrams package:
Basic connections between components
Grouping with Clusters
Advanced styling with Edge attributes
Different layout directions
Multiple component instances
Custom icons and nodes
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
Inputs: diagram_type.
list_iconsA
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:
Call without filters to get a list of available providers
Call with provider_filter to get all services and icons for that provider
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 AWS services and icons
Third call: list_icons(provider_filter="aws", service_filter="compute") → Returns AWS compute icons
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
Inputs: provider_filter, service_filter.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose with no overlap: generate_diagram creates diagrams, get_diagram_examples provides example code, and list_icons lists available icons. The descriptions explicitly define their roles in a sequential workflow, making misselection unlikely.
All tool names follow a consistent verb_noun pattern (generate_diagram, get_diagram_examples, list_icons) with clear, descriptive verbs. There are no deviations in style or convention across the set.
With 3 tools, this is well-scoped for the server's purpose of generating AWS diagrams. Each tool earns its place by covering essential aspects: examples, icon discovery, and diagram generation, forming a complete workflow without bloat.
The tool set provides complete coverage for the diagram generation domain: get_diagram_examples for learning syntax, list_icons for resource discovery, and generate_diagram for execution. There are no obvious gaps, and the workflow guides agents from start to finish without dead ends.
Maintenance
Related MCP Connectors
Generate cloud architecture diagrams, flowcharts, and sequence diagrams.
Create workflow, sequence, architecture, and mind map diagrams via AI assistants.
Render, validate, encode/decode PlantUML diagram-as-code; 22 diagram types. Free, no auth.
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables creation of infrastructure and architecture diagrams as code using the Python diagrams library, supporting 15+ cloud providers, 500+ node types, custom icons, and flowcharts with multiple output formats.538 npm2MIT
- AlicenseNot gradedqualityCmaintenanceEnables generating cloud architecture diagrams, flowcharts, sequence diagrams, and more using three rendering engines: mingrammer/diagrams, Mermaid, and PlantUML.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables generating GCP architecture, sequence, flow, and class diagrams using natural language or Python code via the diagrams library.1Apache 2.0
- AlicenseAqualityDmaintenanceGenerates GCP architecture diagrams, sequence diagrams, flow charts, and class diagrams using Python diagrams DSL via MCP.31Apache 2.0