awslabs.cdk-mcp-server 0.0.11704__py3-none-any.whl → 0.0.31004__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,7 +125,7 @@ def format_rule_info(rule_info: Optional[Dict[str, str]]) -> str:
125
125
  A formatted markdown string.
126
126
  """
127
127
  if not rule_info:
128
- return "Rule information not found."
128
+ return 'Rule information not found.'
129
129
 
130
130
  result = f'# {rule_info["rule_id"]}\n\n'
131
131
  result += f'## Cause\n\n{rule_info["cause"]}\n\n'
@@ -275,10 +275,10 @@ def check_cdk_nag_suppressions(
275
275
  code = f.read()
276
276
  except Exception as e:
277
277
  return {'error': f'Failed to read file: {str(e)}', 'status': 'error'}
278
-
278
+
279
279
  # Ensure code is not None at this point
280
280
  if code is None:
281
- code = "" # Default to empty string if somehow still None
281
+ code = '' # Default to empty string if somehow still None
282
282
 
283
283
  # Define patterns to look for
284
284
  patterns = [
@@ -364,7 +364,10 @@ def list_available_constructs(construct_type: Optional[str] = None) -> List[Dict
364
364
 
365
365
 
366
366
  def process_directory_files(
367
- dir_path: str, construct_type: str, constructs: List[Dict[str, Any]], parent: Optional[str] = None
367
+ dir_path: str,
368
+ construct_type: str,
369
+ constructs: List[Dict[str, Any]],
370
+ parent: Optional[str] = None,
368
371
  ):
369
372
  """Process files in a directory and add them to the constructs list.
370
373
 
@@ -400,7 +403,7 @@ def process_directory_files(
400
403
 
401
404
  # Get description from fixed mapping or use default
402
405
  descriptions = get_construct_descriptions()
403
- description = descriptions.get(display_name, "")
406
+ description = descriptions.get(display_name, '')
404
407
 
405
408
  # If no fixed description, fall back to current behavior
406
409
  if not description:
@@ -484,12 +484,14 @@ def generate_bedrock_schema_from_file(
484
484
  f'{module_name}_simplified', simplified_path
485
485
  )
486
486
  if spec is None:
487
- raise ImportError(f"Could not find spec for module: {module_name}_simplified")
488
-
487
+ raise ImportError(
488
+ f'Could not find spec for module: {module_name}_simplified'
489
+ )
490
+
489
491
  simplified_module = importlib.util.module_from_spec(spec)
490
492
  if spec.loader is None:
491
- raise ImportError(f"Module spec has no loader: {module_name}_simplified")
492
-
493
+ raise ImportError(f'Module spec has no loader: {module_name}_simplified')
494
+
493
495
  spec.loader.exec_module(simplified_module)
494
496
 
495
497
  # Get app and generate schema
@@ -33,11 +33,11 @@ async def fetch_pattern_list() -> List[str]:
33
33
  List of pattern names (e.g., ['aws-lambda-dynamodb', 'aws-apigateway-lambda', ...])
34
34
  """
35
35
  global _pattern_list_cache
36
-
36
+
37
37
  # Initialize cache if it's None
38
38
  if _pattern_list_cache is None:
39
39
  _pattern_list_cache = {'timestamp': None, 'data': []}
40
-
40
+
41
41
  # Check cache first
42
42
  if (
43
43
  _pattern_list_cache['timestamp'] is not None
@@ -135,7 +135,7 @@ async def get_pattern_info(pattern_name: str) -> Dict[str, Any]:
135
135
  # Update cache
136
136
  if _pattern_details_cache is None:
137
137
  _pattern_details_cache = {}
138
-
138
+
139
139
  _pattern_details_cache[pattern_name] = {'timestamp': datetime.now(), 'data': pattern_info}
140
140
 
141
141
  return pattern_info
@@ -1,6 +1,6 @@
1
- # AWS CDK Best Practices Guide
1
+ # AWS CDK General Guidance
2
2
 
3
- This guide provides essential best practices for AWS CDK development, focusing on when to use specific constructs and tools.
3
+ This guide provides essential guidance for AWS CDK development, focusing on when to use specific constructs and tools.
4
4
 
5
5
  ## Getting Started with CDK
6
6
 
@@ -20,7 +20,7 @@ Proper initialization ensures:
20
20
  - Appropriate tsconfig/package.json configuration
21
21
  - Necessary boilerplate files
22
22
 
23
- This foundation helps avoid common issues and ensures compatibility with AWS CDK best practices.
23
+ This foundation helps avoid common issues and ensures compatibility with the AWS CDK ecosystem.
24
24
 
25
25
  ## Development Workflow
26
26
 
@@ -1,5 +1,9 @@
1
1
  from importlib import resources
2
2
 
3
3
 
4
- with resources.files('awslabs.cdk_mcp_server.static').joinpath('CDK_GENERAL_GUIDANCE.md').open('r') as f:
4
+ with (
5
+ resources.files('awslabs.cdk_mcp_server.static')
6
+ .joinpath('CDK_GENERAL_GUIDANCE.md')
7
+ .open('r') as f
8
+ ):
5
9
  CDK_GENERAL_GUIDANCE = f.read()
@@ -1,44 +1,55 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.cdk-mcp-server
3
- Version: 0.0.11704
3
+ Version: 0.0.31004
4
4
  Summary: 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. This server offers tools to validate infrastructure designs, explain CDK Nag rules, analyze suppressions, generate Bedrock Agent schemas, and discover Solutions Constructs patterns.
5
- Requires-Python: >=3.13
5
+ Requires-Python: >=3.10
6
6
  Requires-Dist: aws-lambda-powertools>=2.30.0
7
7
  Requires-Dist: httpx>=0.27.0
8
8
  Requires-Dist: mcp[cli]>=1.6.0
9
9
  Requires-Dist: pydantic>=2.10.6
10
10
  Description-Content-Type: text/markdown
11
11
 
12
- # CDK MCP Server
12
+ # AWS CDK MCP Server
13
13
 
14
14
  MCP server for AWS Cloud Development Kit (CDK) best practices, infrastructure as code patterns, and security compliance with CDK Nag.
15
15
 
16
16
  ## Features
17
17
 
18
- ### Tools
18
+ - **CDK Best Practices** - Get prescriptive CDK advice for building applications on AWS
19
+ - AWS Well-Architected guidance for CDK applications
20
+ - Security and compliance recommendations
19
21
 
20
- - **CDKGeneralGuidance** - Get prescriptive CDK advice for building applications on AWS
21
- - **ExplainCDKNagRule** - Explain specific CDK Nag rules with AWS Well-Architected guidance
22
- - **CheckCDKNagSuppressions** - Check if CDK code contains Nag suppressions that require human review
23
- - **GenerateBedrockAgentSchemaFromFile** - Generate OpenAPI schema for Bedrock Agent Action Groups from a file
24
- - **GetAwsSolutionsConstructPattern** - Search and discover AWS Solutions Constructs patterns
25
- - **SearchGenAICDKConstructs** - Search for GenAI CDK constructs by name or type
22
+ - **CDK Nag Integration** - Work with CDK Nag rules for security and compliance
23
+ - Explain specific CDK Nag rules with AWS Well-Architected guidance
24
+ - Check if CDK code contains Nag suppressions that require human review
26
25
 
27
- ### Resources
26
+ - **AWS Solutions Constructs** - Search and discover AWS Solutions Constructs patterns
27
+ - Find recommended patterns for common architecture needs
28
+ - Get detailed documentation on Solutions Constructs
28
29
 
29
- - **CDK Nag Rules** - Access rule packs via `cdk-nag://rules/{rule_pack}`
30
- - **Lambda Powertools** - Get guidance on Lambda Powertools via `lambda-powertools://{topic}`
31
- - **AWS Solutions Constructs** - Access patterns via `aws-solutions-constructs://{pattern_name}`
32
- - **GenAI CDK Constructs** - Access documentation via `genai-cdk-constructs://{construct_type}/{construct_name}`
30
+ - **Generative AI CDK Constructs** - Search for GenAI CDK constructs by name or type
31
+ - Discover specialized constructs for AI/ML workloads
32
+ - Get implementation guidance for generative AI applications
33
+
34
+ - **Amazon Bedrock Agent Schema Generation** - Generate OpenAPI schema for Bedrock Agent Action Groups
35
+ - Streamline the creation of Bedrock Agent schemas
36
+ - Convert code files to compatible OpenAPI specifications
37
+
38
+ ## Tools and Resources
39
+
40
+ - **CDK Nag Rules**: Access rule packs via `cdk-nag://rules/{rule_pack}`
41
+ - **Lambda Powertools**: Get guidance on Lambda Powertools via `lambda-powertools://{topic}`
42
+ - **AWS Solutions Constructs**: Access patterns via `aws-solutions-constructs://{pattern_name}`
43
+ - **GenAI CDK Constructs**: Access documentation via `genai-cdk-constructs://{construct_type}/{construct_name}`
33
44
 
34
45
  ## Prerequisites
35
46
 
36
47
  1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
37
- 2. Install Python using `uv python install 3.13`
48
+ 2. Install Python using `uv python install 3.10`
38
49
 
39
50
  ## Installation
40
51
 
41
- Here are some ways you can work with MCP across AWS, and well be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q DeveloperCLI MCP, `~/.aws/amazonq/mcp.json`):
52
+ Here are some ways you can work with MCP across AWS, and we'll be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q Developer CLI MCP, `~/.aws/amazonq/mcp.json`):
42
53
 
43
54
  ```json
44
55
  {
@@ -46,6 +57,9 @@ Here are some ways you can work with MCP across AWS, and we’ll be adding suppo
46
57
  "awslabs.cdk-mcp-server": {
47
58
  "command": "uvx",
48
59
  "args": ["awslabs.cdk-mcp-server@latest"],
60
+ "env": {
61
+ "FASTMCP_LOG_LEVEL": "ERROR"
62
+ },
49
63
  "disabled": false,
50
64
  "autoApprove": []
51
65
  }
@@ -7,15 +7,15 @@ awslabs/cdk_mcp_server/core/search_utils.py,sha256=Nz8ftv4w9O_1fvCwIJL36GoBMOtHP
7
7
  awslabs/cdk_mcp_server/core/server.py,sha256=1Zc_n4whZJq9q2_eVrmvqnmNaTKL4ftwbiVHmPJ3JAs,2594
8
8
  awslabs/cdk_mcp_server/core/tools.py,sha256=dw_RJ-IvfWsaicj6bp_UvyGjtd2hLicXL4RC5doaVk4,11644
9
9
  awslabs/cdk_mcp_server/data/__init__.py,sha256=ksA1se4fyvTIb4K7lND-C66ouriFtjyZU96Q88nl6w4,47
10
- awslabs/cdk_mcp_server/data/cdk_nag_parser.py,sha256=z74FJY3XuIJIxUUd_EbpvBuBRBLf5ZWDr39pdEwk5cE,10904
10
+ awslabs/cdk_mcp_server/data/cdk_nag_parser.py,sha256=k3OzuVyoYUivowt_mEO0cp1YwTOgzTmVyg_0mcanDt8,10900
11
11
  awslabs/cdk_mcp_server/data/construct_descriptions.py,sha256=br5gOa5M8Nhv3HrHqrHGXCwQRTu4ZeMAo85bEhzCuMM,2605
12
- awslabs/cdk_mcp_server/data/genai_cdk_loader.py,sha256=6YqW9ODyw8Gd2I05Suxuo1HPKrB8JPzuzm8CI-psD0E,15494
12
+ awslabs/cdk_mcp_server/data/genai_cdk_loader.py,sha256=Q_-tnYu9VNe9lbAxN6qfvBQWYJJjYXht63ko9x-IH-Y,15507
13
13
  awslabs/cdk_mcp_server/data/lambda_powertools_loader.py,sha256=sQfZrmA2hZdd1NSK0hCb5l4kl7jlQ3xhxs28KgEB4Dw,1630
14
- awslabs/cdk_mcp_server/data/schema_generator.py,sha256=bqEOMCFy0pWw52v66Zobn6xrn0wHLJzOZF3XuKGDfdc,27869
15
- awslabs/cdk_mcp_server/data/solutions_constructs_parser.py,sha256=IMGXBGkDB8W8SnZuXfspZ0JD8jc4CiRd_KH7HR6HwzE,27680
16
- awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md,sha256=RAYowPS-9I8dq7YQOPLEAgQ4i9anoQcyRdC2E2_dX_I,9930
14
+ awslabs/cdk_mcp_server/data/schema_generator.py,sha256=vQaZiasOyVam0NNmtzo6D6hy7ynsndRR2I56OBwQlag,27879
15
+ awslabs/cdk_mcp_server/data/solutions_constructs_parser.py,sha256=SL3ZjvCSALmiQlHEMsoDbnbtKxFAPl-mTurciCgj3G8,27656
16
+ awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md,sha256=bZJRzb-14lVOIceQnUTvzb4_QoPg2g3O4NgPavXYiz0,9919
17
17
  awslabs/cdk_mcp_server/static/CDK_NAG_GUIDANCE.md,sha256=zJtHJp9ruaaJ-xa68k9kDrPmEaXpiWCZZf7JIy8NK0w,5839
18
- awslabs/cdk_mcp_server/static/__init__.py,sha256=NybWQKuqEx70DXtHCJ5LuFuRn-AOF9M-NjDSiyev6Og,176
18
+ awslabs/cdk_mcp_server/static/__init__.py,sha256=JJ9ptA-cG8muKCoJgjPKUoCc2q2ks8gBJNbjJTHZS3o,194
19
19
  awslabs/cdk_mcp_server/static/bedrock/bedrockguardrails.md,sha256=CX00B7XgDpLbVxvf6B-a13O4NERAJMiaPPeTuKK-8Sw,7386
20
20
  awslabs/cdk_mcp_server/static/bedrock/profiles.md,sha256=xxPnEkZ0tJAFKomMuAPLm3EtlQFku6MR2nPu4VoyppE,7195
21
21
  awslabs/cdk_mcp_server/static/bedrock/agent/actiongroups.md,sha256=qm6UCCfKurtvNO52g1a6H1N9iBZx-KTCf4SbCK2QQXw,4865
@@ -66,7 +66,7 @@ awslabs/cdk_mcp_server/static/lambda_powertools/metrics.md,sha256=XpQHtNSQRKN3GU
66
66
  awslabs/cdk_mcp_server/static/lambda_powertools/tracing.md,sha256=Q3dSCvgktb9sUsuuQ5ONU2Qdb1OTwbNOYpK--MDzBNw,2539
67
67
  awslabs/cdk_mcp_server/static/opensearch-vectorindex/overview.md,sha256=0aSuBwX4ubI5WqwEfrnX1MH2UJlJOzdXZQ003fRIrGM,4121
68
68
  awslabs/cdk_mcp_server/static/opensearchserverless/overview.md,sha256=aUO1BRana_xqUPENP3GQyOSCAvV9mI-ZWls7x0g8ruA,746
69
- awslabs_cdk_mcp_server-0.0.11704.dist-info/METADATA,sha256=3w3EIC6V8L7yoy_2JlXaBOVyrQ4SBXqlWqtTA1Go8F8,3064
70
- awslabs_cdk_mcp_server-0.0.11704.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
71
- awslabs_cdk_mcp_server-0.0.11704.dist-info/entry_points.txt,sha256=LertzmID_mUU1YYZPySAF1IY1zE7ySTvzFxiGyo3VjY,78
72
- awslabs_cdk_mcp_server-0.0.11704.dist-info/RECORD,,
69
+ awslabs_cdk_mcp_server-0.0.31004.dist-info/METADATA,sha256=HkaHCbgnYTWxRslpcr2GjyS5UIQnGaLQHGN5Z3TIHnE,3591
70
+ awslabs_cdk_mcp_server-0.0.31004.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
71
+ awslabs_cdk_mcp_server-0.0.31004.dist-info/entry_points.txt,sha256=LertzmID_mUU1YYZPySAF1IY1zE7ySTvzFxiGyo3VjY,78
72
+ awslabs_cdk_mcp_server-0.0.31004.dist-info/RECORD,,