awslabs.cdk-mcp-server 0.0.81004__py3-none-any.whl → 0.0.91005__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.
@@ -282,7 +282,7 @@ def check_cdk_nag_suppressions(
282
282
  # If file_path is provided, read the file content
283
283
  if file_path is not None:
284
284
  try:
285
- with open(file_path, 'r') as f:
285
+ with open(file_path, 'r', encoding='utf-8') as f:
286
286
  code = f.read()
287
287
  except Exception as e:
288
288
  return {'error': f'Failed to read file: {str(e)}', 'status': 'error'}
@@ -71,7 +71,7 @@ def get_genai_cdk_overview(construct_type: str = '') -> str:
71
71
  'overview.md',
72
72
  )
73
73
  try:
74
- with open(file_path, 'r') as f:
74
+ with open(file_path, 'r', encoding='utf-8') as f:
75
75
  return f.read()
76
76
  except FileNotFoundError:
77
77
  return f"Error: Overview file for '{construct_type}' not found."
@@ -184,7 +184,7 @@ def get_genai_cdk_construct_section(construct_type: str, construct_name: str, se
184
184
  )
185
185
 
186
186
  try:
187
- with open(file_path, 'r') as f:
187
+ with open(file_path, 'r', encoding='utf-8') as f:
188
188
  return f.read()
189
189
  except FileNotFoundError:
190
190
  return (
@@ -307,7 +307,7 @@ def get_genai_cdk_construct(construct_type: str, construct_name: str) -> str:
307
307
  f'{construct_name_lower}.md',
308
308
  )
309
309
  try:
310
- with open(file_path, 'r') as f:
310
+ with open(file_path, 'r', encoding='utf-8') as f:
311
311
  return f.read()
312
312
  except FileNotFoundError:
313
313
  # Try to see if this is a directory with an overview.md file
@@ -320,7 +320,7 @@ def get_genai_cdk_construct(construct_type: str, construct_name: str) -> str:
320
320
  'overview.md',
321
321
  )
322
322
  try:
323
- with open(overview_path, 'r') as f:
323
+ with open(overview_path, 'r', encoding='utf-8') as f:
324
324
  return f.read()
325
325
  except FileNotFoundError:
326
326
  return f"Error: Documentation for '{construct_name}' in '{construct_type}' not found."
@@ -419,7 +419,7 @@ def process_directory_files(
419
419
  # If no fixed description, fall back to current behavior
420
420
  if not description:
421
421
  try:
422
- with open(file_path, 'r') as f:
422
+ with open(file_path, 'r', encoding='utf-8') as f:
423
423
  first_line = f.readline().strip()
424
424
  description = (
425
425
  first_line[1:].strip() if first_line.startswith('#') else display_name
@@ -51,7 +51,7 @@ def get_lambda_powertools_section(topic: str = '') -> str:
51
51
  ) # Go up from 'data' to get to the package root
52
52
  file_path = os.path.join(base_dir, 'static', 'lambda_powertools', f'{topic.lower()}.md')
53
53
  try:
54
- with open(file_path, 'r') as f:
54
+ with open(file_path, 'r', encoding='utf-8') as f:
55
55
  return f.read()
56
56
  except FileNotFoundError:
57
57
  return f"Error: File for topic '{topic}' not found. (Looking in: {file_path})"
@@ -85,7 +85,7 @@ def main():
85
85
  # Example of creating a simplified version:
86
86
  simplified_path = os.path.join(lambda_dir, f"{{module_name}}_simplified.py")
87
87
  try:
88
- with open(LAMBDA_FILE_PATH, 'r') as f:
88
+ with open(LAMBDA_FILE_PATH, 'r', encoding='utf-8') as f:
89
89
  content = f.read()
90
90
 
91
91
  # Comment out problematic imports (add more as needed)
@@ -104,7 +104,7 @@ def main():
104
104
 
105
105
  simplified_content = '\\n'.join(lines)
106
106
 
107
- with open(simplified_path, 'w') as f:
107
+ with open(simplified_path, 'w', encoding='utf-8') as f:
108
108
  f.write(simplified_content)
109
109
 
110
110
  print("Created simplified version with problematic imports commented out")
@@ -166,7 +166,7 @@ def main():
166
166
  os.makedirs(os.path.dirname(os.path.abspath(OUTPUT_PATH)), exist_ok=True)
167
167
 
168
168
  # Save the schema to the output path
169
- with open(OUTPUT_PATH, 'w') as f:
169
+ with open(OUTPUT_PATH, 'w', encoding='utf-8') as f:
170
170
  json.dump(openapi_schema, f, indent=2)
171
171
 
172
172
  print(f"Schema successfully generated and saved to {{OUTPUT_PATH}}")
@@ -218,7 +218,7 @@ def main():
218
218
  os.makedirs(os.path.dirname(os.path.abspath(OUTPUT_PATH)), exist_ok=True)
219
219
 
220
220
  # Save the schema to the output path
221
- with open(OUTPUT_PATH, 'w') as f:
221
+ with open(OUTPUT_PATH, 'w', encoding='utf-8') as f:
222
222
  json.dump(openapi_schema, f, indent=2)
223
223
 
224
224
  print(f"Schema successfully generated and saved to {{OUTPUT_PATH}}")
@@ -441,7 +441,7 @@ def generate_bedrock_schema_from_file(
441
441
  os.makedirs(os.path.dirname(os.path.abspath(output_path)), exist_ok=True)
442
442
 
443
443
  # Save the schema to the output path
444
- with open(output_path, 'w') as f:
444
+ with open(output_path, 'w', encoding='utf-8') as f:
445
445
  json.dump(openapi_schema, f, indent=2)
446
446
 
447
447
  result['schema'] = openapi_schema
@@ -460,7 +460,7 @@ def generate_bedrock_schema_from_file(
460
460
  simplified_path = os.path.join(lambda_dir, f'{module_name}_simplified.py')
461
461
 
462
462
  try:
463
- with open(lambda_code_path, 'r') as f:
463
+ with open(lambda_code_path, 'r', encoding='utf-8') as f:
464
464
  content = f.read()
465
465
 
466
466
  # Define problematic packages
@@ -494,7 +494,7 @@ def generate_bedrock_schema_from_file(
494
494
  result['process']['simplified_version']['modifications'] = modifications
495
495
 
496
496
  # Write simplified file
497
- with open(simplified_path, 'w') as f:
497
+ with open(simplified_path, 'w', encoding='utf-8') as f:
498
498
  f.write(simplified_content)
499
499
 
500
500
  try:
@@ -536,7 +536,7 @@ def generate_bedrock_schema_from_file(
536
536
  os.makedirs(os.path.dirname(os.path.abspath(output_path)), exist_ok=True)
537
537
 
538
538
  # Save the schema to the output path
539
- with open(output_path, 'w') as f:
539
+ with open(output_path, 'w', encoding='utf-8') as f:
540
540
  json.dump(openapi_schema, f, indent=2)
541
541
 
542
542
  result['schema'] = openapi_schema
@@ -200,47 +200,47 @@ For complete implementation details and examples for all languages, see the [lam
200
200
  ```mermaid
201
201
  graph TD
202
202
  Start([Start]) --> Init["cdk init app"]
203
-
203
+
204
204
  Init --> B{Choose Approach}
205
205
  B -->|"Common Patterns"| C1["GetAwsSolutionsConstructPattern"]
206
206
  B -->|"GenAI Features"| C2["SearchGenAICDKConstructs"]
207
207
  B -->|"Custom Needs"| C3["Custom CDK Code"]
208
-
208
+
209
209
  C1 --> D1["Implement Solutions Construct"]
210
210
  C2 --> D2["Implement GenAI Constructs"]
211
211
  C3 --> D3["Implement Custom Resources"]
212
-
212
+
213
213
  %% Bedrock Agent with Action Groups specific flow
214
214
  D2 -->|"For Bedrock Agents<br/>with Action Groups"| BA["Create Lambda with<br/>BedrockAgentResolver"]
215
-
215
+
216
216
  %% Schema generation flow
217
217
  BA --> BS["GenerateBedrockAgentSchema"]
218
218
  BS -->|"Success"| JSON["openapi.json created"]
219
219
  BS -->|"Import Errors"| BSF["Tool generates<br/>generate_schema.py"]
220
220
  BSF --> BSR["Run script manually:<br/>python generate_schema.py"]
221
221
  BSR --> JSON["openapi.json created"]
222
-
222
+
223
223
  %% Use schema in Agent CDK
224
224
  JSON --> AgentCDK["Use schema in<br/>Agent CDK code"]
225
225
  AgentCDK --> D2
226
-
226
+
227
227
  %% Conditional Lambda Powertools implementation
228
228
  D1 & D2 & D3 --> HasLambda{"Using Lambda<br/>Functions?"}
229
229
  HasLambda -->|"Yes"| L["Add Lambda Powertools<br/>and create Layer"]
230
230
  HasLambda -->|"No"| SkipL["Skip Lambda<br/>Powertools"]
231
-
231
+
232
232
  %% Rest of workflow
233
233
  L --> Synth["cdk synth"]
234
234
  SkipL --> Synth
235
-
235
+
236
236
  Synth --> Nag{"CDK Nag<br/>warnings?"}
237
237
  Nag -->|Yes| E["ExplainCDKNagRule"]
238
238
  Nag -->|No| Deploy["cdk deploy"]
239
-
239
+
240
240
  E --> Fix["Fix or Add Suppressions"]
241
241
  Fix --> CN["CheckCDKNagSuppressions"]
242
242
  CN --> Synth
243
-
243
+
244
244
  %% Styling with darker colors
245
245
  classDef default fill:#424242,stroke:#ffffff,stroke-width:1px,color:#ffffff;
246
246
  classDef cmd fill:#4a148c,stroke:#ffffff,stroke-width:1px,color:#ffffff;
@@ -248,7 +248,7 @@ graph TD
248
248
  classDef note fill:#1b5e20,stroke:#ffffff,stroke-width:1px,color:#ffffff;
249
249
  classDef output fill:#006064,stroke:#ffffff,stroke-width:1px,color:#ffffff;
250
250
  classDef decision fill:#5d4037,stroke:#ffffff,stroke-width:1px,color:#ffffff;
251
-
251
+
252
252
  class Init,Synth,Deploy,BSR cmd;
253
253
  class C1,C2,BS,E,CN tool;
254
254
  class JSON output;
@@ -14,6 +14,6 @@ from importlib import resources
14
14
  with (
15
15
  resources.files('awslabs.cdk_mcp_server.static')
16
16
  .joinpath('CDK_GENERAL_GUIDANCE.md')
17
- .open('r') as f
17
+ .open('r', encoding='utf-8') as f
18
18
  ):
19
19
  CDK_GENERAL_GUIDANCE = f.read()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.cdk-mcp-server
3
- Version: 0.0.81004
3
+ Version: 0.0.91005
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
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: aws-lambda-powertools>=2.30.0
@@ -58,19 +58,19 @@ This diagram provides a comprehensive view of the recommended CDK implementation
58
58
  ```mermaid
59
59
  graph TD
60
60
  Start([Start]) --> Init["cdk init app"]
61
-
61
+
62
62
  Init --> B{Choose Approach}
63
63
  B -->|"Common Patterns"| C1["GetAwsSolutionsConstructPattern"]
64
64
  B -->|"GenAI Features"| C2["SearchGenAICDKConstructs"]
65
65
  B -->|"Custom Needs"| C3["Custom CDK Code"]
66
-
66
+
67
67
  C1 --> D1["Implement Solutions Construct"]
68
68
  C2 --> D2["Implement GenAI Constructs"]
69
69
  C3 --> D3["Implement Custom Resources"]
70
-
70
+
71
71
  %% Bedrock Agent with Action Groups specific flow
72
72
  D2 -->|"For Bedrock Agents<br/>with Action Groups"| BA["Create Lambda with<br/>BedrockAgentResolver"]
73
-
73
+
74
74
  %% Schema generation flow
75
75
  BA --> BS["GenerateBedrockAgentSchema"]
76
76
  BS -->|"Success"| JSON["openapi.json created"]
@@ -78,28 +78,28 @@ graph TD
78
78
  BSF -->|"Missing dependencies?"| InstallDeps["Install dependencies"]
79
79
  InstallDeps --> BSR["Run script manually:<br/>python generate_schema.py"]
80
80
  BSR --> JSON["openapi.json created"]
81
-
81
+
82
82
  %% Use schema in Agent CDK
83
83
  JSON --> AgentCDK["Use schema in<br/>Agent CDK code"]
84
84
  AgentCDK --> D2
85
-
85
+
86
86
  %% Conditional Lambda Powertools implementation
87
87
  D1 & D2 & D3 --> HasLambda{"Using Lambda<br/>Functions?"}
88
88
  HasLambda -->|"Yes"| L["Add Lambda Powertools<br/>and create Layer"]
89
89
  HasLambda -->|"No"| SkipL["Skip Lambda<br/>Powertools"]
90
-
90
+
91
91
  %% Rest of workflow
92
92
  L --> Synth["cdk synth"]
93
93
  SkipL --> Synth
94
-
94
+
95
95
  Synth --> Nag{"CDK Nag<br/>warnings?"}
96
96
  Nag -->|Yes| E["ExplainCDKNagRule"]
97
97
  Nag -->|No| Deploy["cdk deploy"]
98
-
98
+
99
99
  E --> Fix["Fix or Add Suppressions"]
100
100
  Fix --> CN["CheckCDKNagSuppressions"]
101
101
  CN --> Synth
102
-
102
+
103
103
  %% Styling with darker colors
104
104
  classDef default fill:#424242,stroke:#ffffff,stroke-width:1px,color:#ffffff;
105
105
  classDef cmd fill:#4a148c,stroke:#ffffff,stroke-width:1px,color:#ffffff;
@@ -107,7 +107,7 @@ graph TD
107
107
  classDef note fill:#1b5e20,stroke:#ffffff,stroke-width:1px,color:#ffffff;
108
108
  classDef output fill:#006064,stroke:#ffffff,stroke-width:1px,color:#ffffff;
109
109
  classDef decision fill:#5d4037,stroke:#ffffff,stroke-width:1px,color:#ffffff;
110
-
110
+
111
111
  class Init,Synth,Deploy,BSR cmd;
112
112
  class C1,C2,BS,E,CN tool;
113
113
  class JSON output;
@@ -7,15 +7,15 @@ awslabs/cdk_mcp_server/core/search_utils.py,sha256=GLaNJBFzmDgwM8OY98R4VHfgj2Cw7
7
7
  awslabs/cdk_mcp_server/core/server.py,sha256=FmEb02_yu8kjr7PL-8fZ51Tu7ywl8kbMsxWMjrhvRlY,3145
8
8
  awslabs/cdk_mcp_server/core/tools.py,sha256=m_GkmypslKBbhOA8VcDQmXRhwaLUi9BvSi0OO0zqINs,19279
9
9
  awslabs/cdk_mcp_server/data/__init__.py,sha256=8o7-TnXbiVvfwc_xc6LGnDfERnD9GMPRFfnWcgf--0Y,605
10
- awslabs/cdk_mcp_server/data/cdk_nag_parser.py,sha256=c_gIWGvn9zQzyfr-U-uBWR5b4n68PjSDNSj8c8AH370,11459
10
+ awslabs/cdk_mcp_server/data/cdk_nag_parser.py,sha256=AKJU0O9lkzeVLAElzgBkV7rpKNUktywIXwmA52m3Vec,11477
11
11
  awslabs/cdk_mcp_server/data/construct_descriptions.py,sha256=CBfKFM_pJo6Sn_NA7hr-0oVB8piXdncQ_A5ewnTCx30,3164
12
- awslabs/cdk_mcp_server/data/genai_cdk_loader.py,sha256=wARJk0pH8_3_ic2t9sa7zV8djQVOp_iNRUJw1hJxCIg,16066
13
- awslabs/cdk_mcp_server/data/lambda_powertools_loader.py,sha256=5Wk0mLyakthzazGteGTCmk4uGOdmZfzHrNCfKGhrzVQ,2393
14
- awslabs/cdk_mcp_server/data/schema_generator.py,sha256=p2RGeitGt82blWsO3LEQdleYGxfkTZIOjlUaV5CsqPM,29107
12
+ awslabs/cdk_mcp_server/data/genai_cdk_loader.py,sha256=detHbuKZYmJrsJi5UzZYZsU0hZJyykI_-QLw36itbE8,16156
13
+ awslabs/cdk_mcp_server/data/lambda_powertools_loader.py,sha256=XtJb8tTYhmAQ6Ulor6nhKWLQ56aIh2eElpBuw2D9sco,2411
14
+ awslabs/cdk_mcp_server/data/schema_generator.py,sha256=hAVRE2Hue7nQVf61BjYWBhyqQx7s5_YmfPXxYR3t_sg,29251
15
15
  awslabs/cdk_mcp_server/data/solutions_constructs_parser.py,sha256=ceIZwKlj_zdxC1Z17NZ2FKCeVFwNZCoj7GwTjDlC_Q4,28215
16
- awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md,sha256=aFUZvhfELhS7UEffFIzJM-tRS8a7Aj13X9O7FnGN0UI,12245
16
+ awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md,sha256=I4jSgpKA3lJtNps0pFxUg-zuf6Axuru7yZYu7gSyegM,12201
17
17
  awslabs/cdk_mcp_server/static/CDK_NAG_GUIDANCE.md,sha256=zJtHJp9ruaaJ-xa68k9kDrPmEaXpiWCZZf7JIy8NK0w,5839
18
- awslabs/cdk_mcp_server/static/__init__.py,sha256=6MiRoh0eFS7TU_pj09tFRjWROSG2nYkMXLcWMdm5WAs,752
18
+ awslabs/cdk_mcp_server/static/__init__.py,sha256=Tq3PnIhXqHDYM8JWmGYaLz4rKX23X2zVxP_DpLVBeZo,770
19
19
  awslabs/cdk_mcp_server/static/genai_cdk/bedrock/bedrockguardrails.md,sha256=CX00B7XgDpLbVxvf6B-a13O4NERAJMiaPPeTuKK-8Sw,7386
20
20
  awslabs/cdk_mcp_server/static/genai_cdk/bedrock/profiles.md,sha256=xxPnEkZ0tJAFKomMuAPLm3EtlQFku6MR2nPu4VoyppE,7195
21
21
  awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/actiongroups.md,sha256=m40RkxPkX3BI4PHEBQHHPOAAK0rgdPkLVi37F3JcLZQ,4857
@@ -45,7 +45,7 @@ awslabs/cdk_mcp_server/static/lambda_powertools/insights.md,sha256=t-lgyx2AstqXu
45
45
  awslabs/cdk_mcp_server/static/lambda_powertools/logging.md,sha256=6CSgD8QB3Bs4s_x4RnbKwZoWvG6aG4etCnmDH6HU9XY,1797
46
46
  awslabs/cdk_mcp_server/static/lambda_powertools/metrics.md,sha256=XpQHtNSQRKN3GUqQWkk1lTfQSRC0LmW6VoX1dlwEvnQ,3182
47
47
  awslabs/cdk_mcp_server/static/lambda_powertools/tracing.md,sha256=Q3dSCvgktb9sUsuuQ5ONU2Qdb1OTwbNOYpK--MDzBNw,2539
48
- awslabs_cdk_mcp_server-0.0.81004.dist-info/METADATA,sha256=mBHvzTFHyb40gc_0tpKlU9TuypMrG_CVtAiHY_cKneo,6508
49
- awslabs_cdk_mcp_server-0.0.81004.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
- awslabs_cdk_mcp_server-0.0.81004.dist-info/entry_points.txt,sha256=LertzmID_mUU1YYZPySAF1IY1zE7ySTvzFxiGyo3VjY,78
51
- awslabs_cdk_mcp_server-0.0.81004.dist-info/RECORD,,
48
+ awslabs_cdk_mcp_server-0.0.91005.dist-info/METADATA,sha256=Mql8HMDVCMOPFTX0A9q-ZC9C5kRbtUplmuFi6SfSTy4,6464
49
+ awslabs_cdk_mcp_server-0.0.91005.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
+ awslabs_cdk_mcp_server-0.0.91005.dist-info/entry_points.txt,sha256=LertzmID_mUU1YYZPySAF1IY1zE7ySTvzFxiGyo3VjY,78
51
+ awslabs_cdk_mcp_server-0.0.91005.dist-info/RECORD,,