Skip to content

(aws-diagram-mcp-server):Diagram generation fails with "Diagram file was not created" error when using multiple connections #957

@gunhee1314

Description

@gunhee1314

Describe the bug

The awslabs.aws-diagram-mcp-server fails to generate diagrams when the number of connections between nodes
exceeds approximately 5-6 connections. The tool returns a generic error message "Diagram file was not created.
Check your code for errors" without providing specific details about what caused the failure.

Expected Behavior

The diagram generation should work with a reasonable number of connections (10-15+ connections) as shown in
existing examples and documentation. Complex AWS architectures typically require multiple connections to
accurately represent the relationships between services.

Current Behavior

• ✅ Works: Simple diagrams with 1-5 connections
• ❌ Fails: Diagrams with 6+ connections
• ❌ Fails: Cross-cluster connections (connections between nodes in different clusters)
• ❌ Fails: Complex connection patterns

Error message received:
{
"status": "error",
"path": null,
"message": "Diagram file was not created. Check your code for errors."
}

Reproduction Steps

Working example (5 connections):

python
with Diagram("Working Example", show=False, direction="TB", graph_attr={"size": "6,8!"}):
    users = User("Users")
    alb = ALB("ALB")
    web_2a = EC2("Web 2a")
    web_2c = EC2("Web 2c")
    was_2a = EC2("WAS 2a")
    was_2c = EC2("WAS 2c")

    # 5 connections - WORKS
    users >> alb
    alb >> web_2a
    alb >> web_2c
    web_2a >> was_2a
    web_2c >> was_2c

Failing example (7 connections):

python
with Diagram("Failing Example", show=False, direction="TB", graph_attr={"size": "6,8!"}):
    users = User("Users")
    alb = ALB("ALB")
    web_2a = EC2("Web 2a")
    web_2c = EC2("Web 2c")
    was_2a = EC2("WAS 2a")
    was_2c = EC2("WAS 2c")
    rds_2a = RDS("RDS 2a")
    rds_2c = RDS("RDS 2c")

    # 7 connections - FAILS
    users >> alb
    alb >> web_2a
    alb >> web_2c
    web_2a >> was_2a
    web_2c >> was_2c
    was_2a >> rds_2a
    was_2c >> rds_2c

Cross-cluster connection failure:

python
with Diagram("Cross-cluster Failure", show=False, direction="TB"):
    users = User("Users")

    with Cluster("Load Balancers"):
        alb = ALB("ALB")

    with Cluster("Web Servers"):
        web = EC2("Web")

    # Cross-cluster connection - FAILS
    users >> alb  # Works (external to cluster)
    alb >> web    # FAILS (cluster to cluster)

Possible Solution

No response

Additional Information/Context

No response

OS

macOS

Server

aws-diagram-mcp-server

Server Version

No response

Region experiencing the issue

ap-northeast-2

Other information

Installation method: uvx
Python environment: Default system Python with uvx

Service quota

  • I have reviewed the service quotas for this construct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions