awslabs.cdk-mcp-server 0.0.81004__tar.gz → 0.0.91005__tar.gz
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.
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/PKG-INFO +12 -12
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/README.md +11 -11
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/data/cdk_nag_parser.py +1 -1
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/data/genai_cdk_loader.py +5 -5
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/data/lambda_powertools_loader.py +1 -1
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/data/schema_generator.py +8 -8
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md +11 -11
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/__init__.py +1 -1
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/pyproject.toml +2 -2
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/.gitignore +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/.pre-commit-config.yaml +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/.python-version +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/CHANGELOG.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/__init__.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/__init__.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/core/__init__.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/core/resources.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/core/search_utils.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/core/server.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/core/tools.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/data/__init__.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/data/construct_descriptions.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/data/solutions_constructs_parser.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/server.py +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/CDK_NAG_GUIDANCE.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/actiongroups.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/alias.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/collaboration.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/creation.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/custom_orchestration.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/prompt_override.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/bedrockguardrails.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/chunking.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/datasources.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/kendra.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/parsing.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/transformation.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/aurora.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/creation.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/opensearch.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/pinecone.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/profiles.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/opensearch-vectorindex/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/genai_cdk/opensearchserverless/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/bedrock.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/cdk.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/dependencies.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/index.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/insights.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/logging.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/metrics.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/awslabs/cdk_mcp_server/static/lambda_powertools/tracing.md +0 -0
- {awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: awslabs.cdk-mcp-server
|
|
3
|
-
Version: 0.0.
|
|
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;
|
|
@@ -47,19 +47,19 @@ This diagram provides a comprehensive view of the recommended CDK implementation
|
|
|
47
47
|
```mermaid
|
|
48
48
|
graph TD
|
|
49
49
|
Start([Start]) --> Init["cdk init app"]
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
Init --> B{Choose Approach}
|
|
52
52
|
B -->|"Common Patterns"| C1["GetAwsSolutionsConstructPattern"]
|
|
53
53
|
B -->|"GenAI Features"| C2["SearchGenAICDKConstructs"]
|
|
54
54
|
B -->|"Custom Needs"| C3["Custom CDK Code"]
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
C1 --> D1["Implement Solutions Construct"]
|
|
57
57
|
C2 --> D2["Implement GenAI Constructs"]
|
|
58
58
|
C3 --> D3["Implement Custom Resources"]
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
%% Bedrock Agent with Action Groups specific flow
|
|
61
61
|
D2 -->|"For Bedrock Agents<br/>with Action Groups"| BA["Create Lambda with<br/>BedrockAgentResolver"]
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
%% Schema generation flow
|
|
64
64
|
BA --> BS["GenerateBedrockAgentSchema"]
|
|
65
65
|
BS -->|"Success"| JSON["openapi.json created"]
|
|
@@ -67,28 +67,28 @@ graph TD
|
|
|
67
67
|
BSF -->|"Missing dependencies?"| InstallDeps["Install dependencies"]
|
|
68
68
|
InstallDeps --> BSR["Run script manually:<br/>python generate_schema.py"]
|
|
69
69
|
BSR --> JSON["openapi.json created"]
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
%% Use schema in Agent CDK
|
|
72
72
|
JSON --> AgentCDK["Use schema in<br/>Agent CDK code"]
|
|
73
73
|
AgentCDK --> D2
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
%% Conditional Lambda Powertools implementation
|
|
76
76
|
D1 & D2 & D3 --> HasLambda{"Using Lambda<br/>Functions?"}
|
|
77
77
|
HasLambda -->|"Yes"| L["Add Lambda Powertools<br/>and create Layer"]
|
|
78
78
|
HasLambda -->|"No"| SkipL["Skip Lambda<br/>Powertools"]
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
%% Rest of workflow
|
|
81
81
|
L --> Synth["cdk synth"]
|
|
82
82
|
SkipL --> Synth
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
Synth --> Nag{"CDK Nag<br/>warnings?"}
|
|
85
85
|
Nag -->|Yes| E["ExplainCDKNagRule"]
|
|
86
86
|
Nag -->|No| Deploy["cdk deploy"]
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
E --> Fix["Fix or Add Suppressions"]
|
|
89
89
|
Fix --> CN["CheckCDKNagSuppressions"]
|
|
90
90
|
CN --> Synth
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
%% Styling with darker colors
|
|
93
93
|
classDef default fill:#424242,stroke:#ffffff,stroke-width:1px,color:#ffffff;
|
|
94
94
|
classDef cmd fill:#4a148c,stroke:#ffffff,stroke-width:1px,color:#ffffff;
|
|
@@ -96,7 +96,7 @@ graph TD
|
|
|
96
96
|
classDef note fill:#1b5e20,stroke:#ffffff,stroke-width:1px,color:#ffffff;
|
|
97
97
|
classDef output fill:#006064,stroke:#ffffff,stroke-width:1px,color:#ffffff;
|
|
98
98
|
classDef decision fill:#5d4037,stroke:#ffffff,stroke-width:1px,color:#ffffff;
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
class Init,Synth,Deploy,BSR cmd;
|
|
101
101
|
class C1,C2,BS,E,CN tool;
|
|
102
102
|
class JSON output;
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "awslabs.cdk-mcp-server"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.091005"
|
|
4
4
|
description = "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
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -81,4 +81,4 @@ update_changelog_on_bump = true
|
|
|
81
81
|
packages = ["awslabs"]
|
|
82
82
|
|
|
83
83
|
[tool.bandit]
|
|
84
|
-
exclude_dirs = ["venv","tests"]
|
|
84
|
+
exclude_dirs = ["venv","tests"]
|
|
File without changes
|
{awslabs_cdk_mcp_server-0.0.81004 → awslabs_cdk_mcp_server-0.0.91005}/.pre-commit-config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|