AWS CDK MCP Server

raw JSON →
1.0.15 verified Fri May 01 auth: no python

An AWS CDK MCP server that provides guidance on AWS Cloud Development Kit best practices, infrastructure as code patterns, and security compliance with CDK Nag. It offers tools to validate infrastructure designs, explain CDK Nag rules, analyze suppressions, generate Bedrock Agent schemas, and discover Solutions Constructs patterns. Current version: 1.0.15. Release cadence: active development, minor releases as needed.

pip install awslabs-cdk-mcp-server
error ModuleNotFoundError: No module named 'awslabs_cdk_mcp_server'
cause Package not installed or import path uses hyphen instead of underscore.
fix
Run 'pip install awslabs-cdk-mcp-server' and import as 'awslabs_cdk_mcp_server'.
error ImportError: cannot import name 'CdkMcpServer' from 'awslabs_cdk_mcp_server'
cause Symbol might be renamed or not exported at top level.
fix
Use 'from awslabs_cdk_mcp_server import run_server' instead, or check the package __init__.py.
error RuntimeError: AWS region not configured
cause AWS_REGION environment variable not set or profile missing region.
fix
Set AWS_REGION environment variable or configure a region in your AWS profile.
breaking Python 3.10 or higher is required. Using Python <3.10 will cause import errors.
fix Upgrade Python to 3.10+ or use a compatible environment.
gotcha Package import path uses underscores: 'awslabs_cdk_mcp_server' (not hyphens). Common mistake leads to ModuleNotFoundError.
fix Import with underscores: from awslabs_cdk_mcp_server import ...
deprecated The 'require_approval' parameter may be renamed or removed in future versions. Check latest docs.
fix Use 'require_confirmation' if available in newer versions, or monitor changelog.

Starts the CDK MCP server. The server listens for MCP requests to validate CDK stacks, explain Nag rules, etc. Requires AWS credentials configured.

from awslabs_cdk_mcp_server import run_server
import os

# Set up AWS credentials via environment variables (or use default session)
os.environ.setdefault("AWS_REGION", "us-east-1")

# Start the MCP server
run_server(
    aws_region=os.environ.get("AWS_REGION", ""),
    profile="default",
    require_approval=True
)