Skip to main content

An MCP server that seamlessly creates diagrams using the Python diagrams package DSL

Reason this release was yanked:

Superceeded by diagram agent skill in the deploy-on-aws plugin https://github.com/awslabs/agent-plugins/tree/main/plugins/deploy-on-aws

Project description

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.

Tests

Prerequisites

  1. Install uv from Astral or the GitHub README
  2. Install Python using uv python install 3.10
  3. Install GraphViz https://www.graphviz.org/

Installation

Kiro Cursor VS Code
Add to Kiro Install MCP Server Install on VS Code

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 Diagrams MCP Server provides the following capabilities:

  1. Generate Diagrams: Create professional diagrams using Python code
  2. Multiple Diagram Types: Support for AWS architecture, sequence diagrams, flow charts, class diagrams, and more
  3. Customization: Customize diagram appearance, layout, and styling
  4. 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 >> database

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


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awslabs_aws_diagram_mcp_server-1.0.20.tar.gz (103.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awslabs_aws_diagram_mcp_server-1.0.20-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file awslabs_aws_diagram_mcp_server-1.0.20.tar.gz.

File metadata

File hashes

Hashes for awslabs_aws_diagram_mcp_server-1.0.20.tar.gz
Algorithm Hash digest
SHA256 dd480d79c15294320079a1f24a5e8a5977a3ad6db800f049aea5cf2bde89d800
MD5 6ac69300be8c0656a86ddb2fefe78ce0
BLAKE2b-256 cc2282cc415653eb79e9e307aa600fe9d0cd06947a64db03676e3e756b028244

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_aws_diagram_mcp_server-1.0.20.tar.gz:

Publisher: release.yml on awslabs/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file awslabs_aws_diagram_mcp_server-1.0.20-py3-none-any.whl.

File metadata

File hashes

Hashes for awslabs_aws_diagram_mcp_server-1.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 7625c31a11d6de5fa928260206080131a55cfc30610e836e97d96a5976157ee7
MD5 a022ba66405fc7c4cac3839d716cecbd
BLAKE2b-256 702b5a6fa0d102264f867856c665a5caf9985a693be7f84166deb6139c877063

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_aws_diagram_mcp_server-1.0.20-py3-none-any.whl:

Publisher: release.yml on awslabs/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page