awslabs.cdk-mcp-server 0.0.71717__tar.gz → 0.0.81004__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.71717 → awslabs_cdk_mcp_server-0.0.81004}/PKG-INFO +10 -3
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/README.md +9 -2
- awslabs_cdk_mcp_server-0.0.81004/awslabs/__init__.py +10 -0
- awslabs_cdk_mcp_server-0.0.81004/awslabs/cdk_mcp_server/__init__.py +18 -0
- awslabs_cdk_mcp_server-0.0.81004/awslabs/cdk_mcp_server/core/__init__.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/core/resources.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/core/search_utils.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/core/server.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/core/tools.py +43 -0
- awslabs_cdk_mcp_server-0.0.81004/awslabs/cdk_mcp_server/data/__init__.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/data/cdk_nag_parser.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/data/construct_descriptions.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/data/genai_cdk_loader.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/data/lambda_powertools_loader.py +11 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/data/schema_generator.py +22 -3
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/data/solutions_constructs_parser.py +11 -0
- awslabs_cdk_mcp_server-0.0.81004/awslabs/cdk_mcp_server/server.py +18 -0
- awslabs_cdk_mcp_server-0.0.81004/awslabs/cdk_mcp_server/static/__init__.py +19 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/pyproject.toml +1 -1
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/uv.lock +1 -1
- awslabs_cdk_mcp_server-0.0.71717/awslabs/__init__.py +0 -2
- awslabs_cdk_mcp_server-0.0.71717/awslabs/cdk_mcp_server/__init__.py +0 -8
- awslabs_cdk_mcp_server-0.0.71717/awslabs/cdk_mcp_server/core/__init__.py +0 -1
- awslabs_cdk_mcp_server-0.0.71717/awslabs/cdk_mcp_server/data/__init__.py +0 -1
- awslabs_cdk_mcp_server-0.0.71717/awslabs/cdk_mcp_server/server.py +0 -7
- awslabs_cdk_mcp_server-0.0.71717/awslabs/cdk_mcp_server/static/__init__.py +0 -9
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/.gitignore +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/.pre-commit-config.yaml +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/.python-version +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/CHANGELOG.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/CDK_NAG_GUIDANCE.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/actiongroups.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/alias.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/collaboration.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/creation.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/custom_orchestration.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/prompt_override.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/bedrockguardrails.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/chunking.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/datasources.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/kendra.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/parsing.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/transformation.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/aurora.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/creation.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/opensearch.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/pinecone.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/bedrock/profiles.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/opensearch-vectorindex/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/genai_cdk/opensearchserverless/overview.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/bedrock.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/cdk.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/dependencies.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/index.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/insights.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/logging.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/metrics.md +0 -0
- {awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/awslabs/cdk_mcp_server/static/lambda_powertools/tracing.md +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.81004
|
|
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
|
|
@@ -41,10 +41,16 @@ MCP server for AWS Cloud Development Kit (CDK) best practices, infrastructure as
|
|
|
41
41
|
|
|
42
42
|
### Amazon Bedrock Agent Schema Generation
|
|
43
43
|
|
|
44
|
-
-
|
|
44
|
+
- Use this tool when creating Bedrock Agents with Action Groups that use Lambda functions
|
|
45
45
|
- Streamline the creation of Bedrock Agent schemas
|
|
46
46
|
- Convert code files to compatible OpenAPI specifications
|
|
47
47
|
|
|
48
|
+
#### Developer Notes
|
|
49
|
+
|
|
50
|
+
- **Requirements**: Your Lambda function must use `BedrockAgentResolver` from AWS Lambda Powertools
|
|
51
|
+
- **Lambda Dependencies**: If schema generation fails, a fallback script will be generated. If you see error messages about missing dependencies, install them and then run the script again.
|
|
52
|
+
- **Integration**: Use the generated schema with `bedrock.ApiSchema.fromLocalAsset()` in your CDK code
|
|
53
|
+
|
|
48
54
|
## CDK Implementation Workflow
|
|
49
55
|
|
|
50
56
|
This diagram provides a comprehensive view of the recommended CDK implementation workflow:
|
|
@@ -69,7 +75,8 @@ graph TD
|
|
|
69
75
|
BA --> BS["GenerateBedrockAgentSchema"]
|
|
70
76
|
BS -->|"Success"| JSON["openapi.json created"]
|
|
71
77
|
BS -->|"Import Errors"| BSF["Tool generates<br/>generate_schema.py"]
|
|
72
|
-
BSF
|
|
78
|
+
BSF -->|"Missing dependencies?"| InstallDeps["Install dependencies"]
|
|
79
|
+
InstallDeps --> BSR["Run script manually:<br/>python generate_schema.py"]
|
|
73
80
|
BSR --> JSON["openapi.json created"]
|
|
74
81
|
|
|
75
82
|
%% Use schema in Agent CDK
|
|
@@ -30,10 +30,16 @@ MCP server for AWS Cloud Development Kit (CDK) best practices, infrastructure as
|
|
|
30
30
|
|
|
31
31
|
### Amazon Bedrock Agent Schema Generation
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- Use this tool when creating Bedrock Agents with Action Groups that use Lambda functions
|
|
34
34
|
- Streamline the creation of Bedrock Agent schemas
|
|
35
35
|
- Convert code files to compatible OpenAPI specifications
|
|
36
36
|
|
|
37
|
+
#### Developer Notes
|
|
38
|
+
|
|
39
|
+
- **Requirements**: Your Lambda function must use `BedrockAgentResolver` from AWS Lambda Powertools
|
|
40
|
+
- **Lambda Dependencies**: If schema generation fails, a fallback script will be generated. If you see error messages about missing dependencies, install them and then run the script again.
|
|
41
|
+
- **Integration**: Use the generated schema with `bedrock.ApiSchema.fromLocalAsset()` in your CDK code
|
|
42
|
+
|
|
37
43
|
## CDK Implementation Workflow
|
|
38
44
|
|
|
39
45
|
This diagram provides a comprehensive view of the recommended CDK implementation workflow:
|
|
@@ -58,7 +64,8 @@ graph TD
|
|
|
58
64
|
BA --> BS["GenerateBedrockAgentSchema"]
|
|
59
65
|
BS -->|"Success"| JSON["openapi.json created"]
|
|
60
66
|
BS -->|"Import Errors"| BSF["Tool generates<br/>generate_schema.py"]
|
|
61
|
-
BSF
|
|
67
|
+
BSF -->|"Missing dependencies?"| InstallDeps["Install dependencies"]
|
|
68
|
+
InstallDeps --> BSR["Run script manually:<br/>python generate_schema.py"]
|
|
62
69
|
BSR --> JSON["openapi.json created"]
|
|
63
70
|
|
|
64
71
|
%% Use schema in Agent CDK
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
"""AWS CDK MCP server package."""
|
|
12
|
+
|
|
13
|
+
# Import the minimal set of essential functions
|
|
14
|
+
from awslabs.cdk_mcp_server.core.server import main, mcp
|
|
15
|
+
|
|
16
|
+
__all__ = ['main', 'mcp']
|
|
17
|
+
|
|
18
|
+
__version__ = '0.0.0'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
"""Core modules for the AWS CDK MCP server."""
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""AWS CDK MCP resource handlers."""
|
|
2
13
|
|
|
3
14
|
import logging
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""Common search utilities for AWS CDK MCP Server."""
|
|
2
13
|
|
|
3
14
|
import re
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""AWS CDK MCP server implementation."""
|
|
2
13
|
|
|
3
14
|
import argparse
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""AWS CDK MCP tool handlers."""
|
|
2
13
|
|
|
3
14
|
import logging
|
|
@@ -230,6 +241,38 @@ async def bedrock_schema_generator_from_file(
|
|
|
230
241
|
output_path=output_path,
|
|
231
242
|
)
|
|
232
243
|
|
|
244
|
+
# Add comprehensive next steps for successful schema generation
|
|
245
|
+
if result.get('status') == 'success':
|
|
246
|
+
output_filename = os.path.basename(output_path)
|
|
247
|
+
output_dir = os.path.dirname(output_path)
|
|
248
|
+
lambda_dir = os.path.dirname(os.path.abspath(lambda_code_path))
|
|
249
|
+
lambda_name = os.path.basename(os.path.dirname(lambda_code_path))
|
|
250
|
+
|
|
251
|
+
# Create a more comprehensive integration example
|
|
252
|
+
result['next_steps'] = {
|
|
253
|
+
'success_message': f'Schema successfully generated and saved to {output_path}',
|
|
254
|
+
'integration_steps': [
|
|
255
|
+
'1. Ensure your Lambda function has the right permissions:',
|
|
256
|
+
' - Add bedrock.amazonaws.com as a principal in permissions',
|
|
257
|
+
' - Include Lambda Powertools and Pydantic as layers',
|
|
258
|
+
'2. Add the ActionGroup to your Bedrock Agent:',
|
|
259
|
+
' - Create an action group with your Lambda as the executor',
|
|
260
|
+
' - Use the generated schema with ApiSchema.fromLocalAsset()',
|
|
261
|
+
'3. Deploy your CDK stack',
|
|
262
|
+
],
|
|
263
|
+
'cdk_example': [
|
|
264
|
+
'// Add the Action Group to your agent',
|
|
265
|
+
'agent.addActionGroup(new bedrock.AgentActionGroup({',
|
|
266
|
+
f" name: '{lambda_name}-action-group',",
|
|
267
|
+
f" description: 'Action group for {lambda_name}',",
|
|
268
|
+
' executor: bedrock.ActionGroupExecutor.fromlambdaFunction(yourLambdaFunction),',
|
|
269
|
+
' apiSchema: bedrock.ApiSchema.fromLocalAsset(',
|
|
270
|
+
f" path.join(__dirname, '{os.path.relpath(output_dir, lambda_dir)}', '{output_filename}')",
|
|
271
|
+
' )',
|
|
272
|
+
'}));',
|
|
273
|
+
],
|
|
274
|
+
}
|
|
275
|
+
|
|
233
276
|
# If fallback script was generated, save it to a file instead of returning it in the response
|
|
234
277
|
if result.get('status') == 'error' and result.get('fallback_script'):
|
|
235
278
|
# Save the script to a file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
"""Data modules for the AWS CDK MCP server."""
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""CDK Nag rules parsing utilities."""
|
|
2
13
|
|
|
3
14
|
import httpx
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""GenAI CDK construct descriptions."""
|
|
2
13
|
|
|
3
14
|
from typing import Dict
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""GenAI CDK constructs static content loader."""
|
|
2
13
|
|
|
3
14
|
import logging
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""Lambda Powertools guidance loader module."""
|
|
2
13
|
|
|
3
14
|
import os
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""Schema generator for Bedrock Agent Action Groups."""
|
|
2
13
|
|
|
3
14
|
import importlib.util
|
|
@@ -121,12 +132,13 @@ def main():
|
|
|
121
132
|
|
|
122
133
|
# Generate the OpenAPI schema
|
|
123
134
|
print("Generating OpenAPI schema...")
|
|
135
|
+
# Note: This might show a UserWarning about Pydantic v2 and OpenAPI versions
|
|
124
136
|
openapi_schema = json.loads(app.get_openapi_json_schema(openapi_version="3.0.0"))
|
|
125
137
|
|
|
126
138
|
# Fix Pydantic v2 issue (forcing OpenAPI 3.0.0)
|
|
127
139
|
if openapi_schema.get("openapi") != "3.0.0":
|
|
128
140
|
openapi_schema["openapi"] = "3.0.0"
|
|
129
|
-
print("
|
|
141
|
+
print("Note: Adjusted OpenAPI version for compatibility with Bedrock Agents")
|
|
130
142
|
|
|
131
143
|
# Fix operationIds
|
|
132
144
|
for path in openapi_schema['paths']:
|
|
@@ -158,12 +170,19 @@ def main():
|
|
|
158
170
|
json.dump(openapi_schema, f, indent=2)
|
|
159
171
|
|
|
160
172
|
print(f"Schema successfully generated and saved to {{OUTPUT_PATH}}")
|
|
173
|
+
print("Next steps: Use this schema in your CDK code with bedrock.ApiSchema.fromLocalAsset()")
|
|
161
174
|
return True
|
|
162
175
|
|
|
163
176
|
except Exception as simplified_error:
|
|
164
177
|
print(f"Error with simplified version: {{str(simplified_error)}}")
|
|
165
|
-
|
|
166
|
-
|
|
178
|
+
if "No module named" in str(simplified_error):
|
|
179
|
+
missing_dep = str(simplified_error).split("'")[-2] if "'" in str(simplified_error) else str(simplified_error).split("No module named ")[-1].strip()
|
|
180
|
+
print("To resolve this error, install the missing dependency:")
|
|
181
|
+
print(" pip install " + missing_dep.replace('_', '-'))
|
|
182
|
+
print("Then run this script again.")
|
|
183
|
+
else:
|
|
184
|
+
print("You may need to manually modify the script to handle this error.")
|
|
185
|
+
print("Focus on preserving the BedrockAgentResolver app definition and routes.")
|
|
167
186
|
return False
|
|
168
187
|
|
|
169
188
|
except Exception as e:
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
1
12
|
"""AWS Solutions Constructs patterns parser module."""
|
|
2
13
|
|
|
3
14
|
import httpx
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
|
|
12
|
+
"""AWS CDK MCP server implementation."""
|
|
13
|
+
|
|
14
|
+
from awslabs.cdk_mcp_server.core.server import main
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
if __name__ == '__main__':
|
|
18
|
+
main()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
4
|
+
# with the License. A copy of the License is located at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
9
|
+
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
10
|
+
# and limitations under the License.
|
|
11
|
+
from importlib import resources
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
with (
|
|
15
|
+
resources.files('awslabs.cdk_mcp_server.static')
|
|
16
|
+
.joinpath('CDK_GENERAL_GUIDANCE.md')
|
|
17
|
+
.open('r') as f
|
|
18
|
+
):
|
|
19
|
+
CDK_GENERAL_GUIDANCE = f.read()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "awslabs.cdk-mcp-server"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.081004"
|
|
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"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""Core modules for the AWS CDK MCP server."""
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""Data modules for the AWS CDK MCP server."""
|
|
File without changes
|
{awslabs_cdk_mcp_server-0.0.71717 → awslabs_cdk_mcp_server-0.0.81004}/.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
|