home / mcp / aws cdk mcp server

AWS CDK MCP Server

Provides prescriptive CDK guidance, security checks, and Bedrock/GenAI tooling for CDK-based infrastructure.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "akm-2018-tmp_cdk_mcp_server": {
      "command": "uv",
      "args": [
        "awslabs.cdk-mcp-server@latest"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      }
    }
  }
}

This MCP Server provides guidance and tooling to build and operate AWS CDK-based infrastructure with best practices, security checks, and GenAI/Bedrock integration support. It helps you choose the right patterns, validate security rules, and generate OpenAPI schemas for Bedrock agents, all while offering practical workflows for CDK development and deployment.

How to use

You start by initializing your CDK project and then decide the approach that best fits your needs. Use prescriptive CDK guidance for common patterns, leverage GenAI CDK constructs for AI workloads, or implement custom resources when you have unique requirements. As you progress, you can generate Bedrock Agent schemas if you work with Bedrock actions that use Lambda functions, and you can validate security rules with CDK Nag integration. If you are using Lambda layers, you can consult the Lambda Layers documentation provider for best practices and examples.

When you are ready to deploy, synthesize your CDK app to ensure it builds correctly, review any CDK Nag warnings, fix issues or add suppressions with documented justifications, and then deploy to your target environment. The workflow supports starting from a CDK init, selecting a pattern, implementing the chosen approach, generating necessary schemas, and finally synthesizing and deploying.

How to install

Prerequisites you need to install before using this MCP Server and developing CDK apps are listed here. Install the required runtime environments and tooling to ensure smooth setup and execution.

{
  "mcpServers": {
    "cdk_mcp": {
      "command": "uv",
      "args": ["awslabs.cdk-mcp-server@latest"],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Additional configuration and runtime options

Two recommended ways to run the MCP server locally are provided. You can run via the UV runtime tool or via Docker. Both configurations expose the same server features and will enable you to interact with MCP tooling for CDK guidance, patterns, and integrations.

{
  "mcpServers": {
    "cdk_mcp": {
      "command": "uv",
      "args": ["awslabs.cdk-mcp-server@latest"],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    },
    "cdk_mcp_docker": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "FASTMCP_LOG_LEVEL=ERROR",
        "awslabs/cdk-mcp-server:latest"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Available tools

CDKGeneralGuidance

Get prescriptive guidance for building AWS applications with CDK, including recommended patterns and decision flows.

GetAwsSolutionsConstructPattern

Find vetted architecture patterns that combine AWS services using Solutions Constructs for common scenarios.

SearchGenAICDKConstructs

Discover GenAI CDK constructs by name or features to accelerate AI/ML workloads.

GenerateBedrockAgentSchema

Create OpenAPI schemas for Bedrock Agent action groups and convert code files to compatible specifications.

LambdaLayerDocumentationProvider

Access comprehensive Lambda layer documentation and implementation best practices.

ExplainCDKNagRule

Provide detailed explanations and guidance for CDK Nag security and compliance rules.

CheckCDKNagSuppressions

Validate suppressions in your CDK code to ensure no unauthorized exclusions exist.