awslabs.cdk-mcp-server 1.0.0__tar.gz → 1.0.2__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-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/Dockerfile +12 -9
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/PKG-INFO +3 -3
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/README.md +2 -2
- awslabs_cdk_mcp_server-1.0.2/awslabs/__init__.py +13 -0
- awslabs_cdk_mcp_server-1.0.2/awslabs/cdk_mcp_server/__init__.py +21 -0
- awslabs_cdk_mcp_server-1.0.2/awslabs/cdk_mcp_server/core/__init__.py +14 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/core/resources.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/core/search_utils.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/core/server.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/core/tools.py +9 -6
- awslabs_cdk_mcp_server-1.0.2/awslabs/cdk_mcp_server/data/__init__.py +14 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/data/cdk_nag_parser.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/data/construct_descriptions.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/data/genai_cdk_loader.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/data/lambda_layer_parser.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/data/lambda_powertools_loader.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/data/schema_generator.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/data/solutions_constructs_parser.py +103 -28
- awslabs_cdk_mcp_server-1.0.2/awslabs/cdk_mcp_server/server.py +21 -0
- awslabs_cdk_mcp_server-1.0.2/awslabs/cdk_mcp_server/static/__init__.py +24 -0
- awslabs_cdk_mcp_server-1.0.2/docker-healthcheck.sh +26 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/pyproject.toml +1 -1
- awslabs_cdk_mcp_server-1.0.2/tests/__init__.py +13 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/core/test_resources.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/core/test_resources_enhanced.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/core/test_search_utils.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/core/test_server.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/core/test_tools.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/data/test_cdk_nag_parser.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/data/test_genai_cdk_loader.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/data/test_lambda_powertools_loader.py +9 -6
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/tests/data/test_schema_generator.py +9 -6
- awslabs_cdk_mcp_server-1.0.2/tests/data/test_solutions_constructs_parser.py +832 -0
- awslabs_cdk_mcp_server-1.0.0/.pre-commit-config.yaml +0 -14
- awslabs_cdk_mcp_server-1.0.0/awslabs/__init__.py +0 -10
- awslabs_cdk_mcp_server-1.0.0/awslabs/cdk_mcp_server/__init__.py +0 -18
- awslabs_cdk_mcp_server-1.0.0/awslabs/cdk_mcp_server/core/__init__.py +0 -11
- awslabs_cdk_mcp_server-1.0.0/awslabs/cdk_mcp_server/data/__init__.py +0 -11
- awslabs_cdk_mcp_server-1.0.0/awslabs/cdk_mcp_server/server.py +0 -18
- awslabs_cdk_mcp_server-1.0.0/awslabs/cdk_mcp_server/static/__init__.py +0 -21
- awslabs_cdk_mcp_server-1.0.0/docker-healthcheck.sh +0 -12
- awslabs_cdk_mcp_server-1.0.0/tests/__init__.py +0 -10
- awslabs_cdk_mcp_server-1.0.0/tests/data/test_solutions_constructs_parser.py +0 -211
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/.gitignore +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/.python-version +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/CHANGELOG.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/LICENSE +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/NOTICE +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/CDK_NAG_GUIDANCE.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/bedrock.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/cdk.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/dependencies.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/index.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/insights.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/logging.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/metrics.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/static/lambda_powertools/tracing.md +0 -0
- {awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/uv.lock +0 -0
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
#FROM public.ecr.aws/sam/build-python3.10:1.137.1-20250411084548
|
|
13
|
-
FROM public.ecr.aws/sam/build-python3.10@sha256:
|
|
16
|
+
FROM public.ecr.aws/sam/build-python3.10@sha256:d821662474d65f3cf2fc97dba2fa807a3adb580d02895fc4545527812550ea65 AS uv
|
|
14
17
|
|
|
15
18
|
# Install the project into `/app`
|
|
16
19
|
WORKDIR /app
|
|
@@ -32,7 +35,7 @@ COPY pyproject.toml uv.lock ./
|
|
|
32
35
|
|
|
33
36
|
# Install the project's dependencies using the lockfile and settings
|
|
34
37
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
35
|
-
pip install uv && \
|
|
38
|
+
pip install uv==0.7.11 && \
|
|
36
39
|
uv sync --frozen --no-install-project --no-dev --no-editable
|
|
37
40
|
|
|
38
41
|
# Then, add the rest of the project source code and install it
|
|
@@ -44,7 +47,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|
|
44
47
|
# Make the directory just in case it doesn't exist
|
|
45
48
|
RUN mkdir -p /root/.local
|
|
46
49
|
|
|
47
|
-
FROM public.ecr.aws/sam/build-python3.10@sha256:
|
|
50
|
+
FROM public.ecr.aws/sam/build-python3.10@sha256:d821662474d65f3cf2fc97dba2fa807a3adb580d02895fc4545527812550ea65
|
|
48
51
|
|
|
49
52
|
# Place executables in the environment at the front of the path and include other binaries
|
|
50
53
|
ENV PATH="/app/.venv/bin:$PATH:/usr/sbin"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: awslabs.cdk-mcp-server
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
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
|
Project-URL: Homepage, https://awslabs.github.io/mcp/
|
|
6
6
|
Project-URL: Documentation, https://awslabs.github.io/mcp/servers/cdk-mcp-server/
|
|
@@ -168,7 +168,7 @@ graph TD
|
|
|
168
168
|
|
|
169
169
|
## Installation
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
|
|
172
172
|
|
|
173
173
|
```json
|
|
174
174
|
{
|
|
@@ -186,7 +186,7 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
|
|
|
186
186
|
}
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
or docker after a
|
|
189
|
+
or docker after a successful `docker build -t awslabs/cdk-mcp-server .`:
|
|
190
190
|
|
|
191
191
|
```json
|
|
192
192
|
{
|
|
@@ -138,7 +138,7 @@ graph TD
|
|
|
138
138
|
|
|
139
139
|
## Installation
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
|
|
142
142
|
|
|
143
143
|
```json
|
|
144
144
|
{
|
|
@@ -156,7 +156,7 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
|
|
|
156
156
|
}
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
or docker after a
|
|
159
|
+
or docker after a successful `docker build -t awslabs/cdk-mcp-server .`:
|
|
160
160
|
|
|
161
161
|
```json
|
|
162
162
|
{
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""AWS CDK MCP server package."""
|
|
15
|
+
|
|
16
|
+
# Import the minimal set of essential functions
|
|
17
|
+
from awslabs.cdk_mcp_server.core.server import main, mcp
|
|
18
|
+
|
|
19
|
+
__all__ = ['main', 'mcp']
|
|
20
|
+
|
|
21
|
+
__version__ = '0.0.0'
|
|
@@ -0,0 +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");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Core modules for the AWS CDK MCP server."""
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""AWS CDK MCP resource handlers."""
|
|
13
16
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""Common search utilities for AWS CDK MCP Server."""
|
|
13
16
|
|
{awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/core/server.py
RENAMED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""AWS CDK MCP server implementation."""
|
|
13
16
|
|
{awslabs_cdk_mcp_server-1.0.0 → awslabs_cdk_mcp_server-1.0.2}/awslabs/cdk_mcp_server/core/tools.py
RENAMED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""AWS CDK MCP tool handlers."""
|
|
13
16
|
|
|
@@ -0,0 +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");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Data modules for the AWS CDK MCP server."""
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""CDK Nag rules parsing utilities."""
|
|
13
16
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""GenAI CDK construct descriptions."""
|
|
13
16
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""GitHub-based GenAI CDK constructs content loader."""
|
|
13
16
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""Lambda layer documentation parser module."""
|
|
13
16
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""Lambda Powertools guidance loader module."""
|
|
13
16
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""Schema generator for Bedrock Agent Action Groups."""
|
|
13
16
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
11
14
|
|
|
12
15
|
"""AWS Solutions Constructs patterns parser module."""
|
|
13
16
|
|
|
@@ -20,6 +23,40 @@ from datetime import datetime, timedelta
|
|
|
20
23
|
from typing import Any, Dict, List
|
|
21
24
|
|
|
22
25
|
|
|
26
|
+
# Regular expression patterns for parsing documentation
|
|
27
|
+
# AsciiDoc patterns
|
|
28
|
+
# Matches a Description section in AsciiDoc format: "= Description" followed by text until the next section or end
|
|
29
|
+
ADOC_DESCRIPTION_SECTION_PATTERN = r'= Description\s*\n+(.*?)(?=\n=|\Z)'
|
|
30
|
+
|
|
31
|
+
# Matches an Overview section in AsciiDoc format: "= Overview" followed by text until the next section or end
|
|
32
|
+
ADOC_OVERVIEW_SECTION_PATTERN = r'= Overview\s*\n+(.*?)(?=\n=|\Z)'
|
|
33
|
+
|
|
34
|
+
# Matches the first paragraph in a section: start of text until first blank line or end
|
|
35
|
+
FIRST_PARAGRAPH_PATTERN = r'^(.*?)(?=\n\n|\Z)'
|
|
36
|
+
|
|
37
|
+
# Matches a title and the following paragraph in AsciiDoc: "= Title" followed by blank line and text
|
|
38
|
+
ADOC_TITLE_AND_PARAGRAPH_PATTERN = r'= ([^\n]+)\s*\n\n(.*?)(?=\n\n|\n=|\Z)'
|
|
39
|
+
|
|
40
|
+
# Markdown patterns
|
|
41
|
+
# Matches a Description section in Markdown: "## Description" followed by text until the next section or end
|
|
42
|
+
MD_DESCRIPTION_SECTION_PATTERN = r'## Description\s*\n+(.*?)(?=\n##|\Z)'
|
|
43
|
+
|
|
44
|
+
# Matches an Overview section in Markdown: "## Overview" followed by text until the next section or end
|
|
45
|
+
MD_OVERVIEW_SECTION_PATTERN = r'## Overview\s*\n+(.*?)(?=\n##|\Z)'
|
|
46
|
+
|
|
47
|
+
# Matches the first paragraph after a title in Markdown: "# Title" followed by blank line and text
|
|
48
|
+
MD_TITLE_AND_PARAGRAPH_PATTERN = r'# [^\n]*\n\n(.*?)(?=\n\n|\n##|\Z)'
|
|
49
|
+
|
|
50
|
+
# Matches any text before the first ## heading
|
|
51
|
+
MD_TEXT_BEFORE_FIRST_HEADING_PATTERN = r'\n\n(.*?)(?=\n##|\Z)'
|
|
52
|
+
|
|
53
|
+
# Matches a title in Markdown: "# Title"
|
|
54
|
+
MD_TITLE_PATTERN = r'# ([^\n]+)'
|
|
55
|
+
|
|
56
|
+
# Pattern to replace multiple whitespace characters with a single space
|
|
57
|
+
WHITESPACE_CLEANUP_PATTERN = r'\s+'
|
|
58
|
+
|
|
59
|
+
|
|
23
60
|
# Set up logging
|
|
24
61
|
logging.basicConfig(level=logging.INFO)
|
|
25
62
|
logger = logging.getLogger(__name__)
|
|
@@ -112,22 +149,32 @@ async def get_pattern_info(pattern_name: str) -> Dict[str, Any]:
|
|
|
112
149
|
logger.info(f'Using cached info for {pattern_name}')
|
|
113
150
|
return _pattern_details_cache[pattern_name]['data']
|
|
114
151
|
|
|
115
|
-
#
|
|
152
|
+
# Try to fetch README.adoc first (preferred)
|
|
116
153
|
async with httpx.AsyncClient() as client:
|
|
117
|
-
|
|
118
|
-
logger.info(f'Fetching README from {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
154
|
+
readme_adoc_url = f'{GITHUB_RAW_CONTENT_URL}/{REPO_OWNER}/{REPO_NAME}/main/{PATTERNS_PATH}/{pattern_name}/README.adoc'
|
|
155
|
+
logger.info(f'Fetching README.adoc from {readme_adoc_url}')
|
|
156
|
+
adoc_response = await client.get(readme_adoc_url)
|
|
157
|
+
|
|
158
|
+
if adoc_response.status_code == 200:
|
|
159
|
+
readme_content = adoc_response.text
|
|
160
|
+
logger.info(f'Successfully fetched README.adoc for {pattern_name}')
|
|
161
|
+
else:
|
|
162
|
+
# Fall back to README.md (if README.adoc is not available)
|
|
163
|
+
readme_md_url = f'{GITHUB_RAW_CONTENT_URL}/{REPO_OWNER}/{REPO_NAME}/main/{PATTERNS_PATH}/{pattern_name}/README.md'
|
|
164
|
+
logger.info(f'README.adoc not found, trying README.md from {readme_md_url}')
|
|
165
|
+
md_response = await client.get(readme_md_url)
|
|
166
|
+
|
|
167
|
+
if md_response.status_code != 200:
|
|
168
|
+
logger.warning(
|
|
169
|
+
f'Failed to fetch README for {pattern_name}: HTTP {md_response.status_code}'
|
|
170
|
+
)
|
|
171
|
+
return {
|
|
172
|
+
'error': f'Pattern {pattern_name} not found or README not available',
|
|
173
|
+
'status_code': md_response.status_code,
|
|
174
|
+
}
|
|
129
175
|
|
|
130
|
-
|
|
176
|
+
readme_content = md_response.text
|
|
177
|
+
logger.info(f'Successfully fetched README.md for {pattern_name}')
|
|
131
178
|
|
|
132
179
|
# Extract only metadata
|
|
133
180
|
services = extract_services_from_pattern_name(pattern_name)
|
|
@@ -310,41 +357,69 @@ def extract_services_from_pattern_name(pattern_name: str) -> List[str]:
|
|
|
310
357
|
|
|
311
358
|
|
|
312
359
|
def extract_description(content: str) -> str:
|
|
313
|
-
"""Extract the pattern description from README
|
|
360
|
+
"""Extract the pattern description from README content.
|
|
314
361
|
|
|
315
362
|
Args:
|
|
316
|
-
content: README.md
|
|
363
|
+
content: README content (can be .md or .adoc format)
|
|
317
364
|
|
|
318
365
|
Returns:
|
|
319
366
|
Pattern description
|
|
320
367
|
"""
|
|
368
|
+
# Check if this is an AsciiDoc (.adoc) file
|
|
369
|
+
if any(marker in content for marker in ['= Overview', '= Description']):
|
|
370
|
+
# First, try to find a dedicated Description section in AsciiDoc
|
|
371
|
+
desc_section_match = re.search(ADOC_DESCRIPTION_SECTION_PATTERN, content, re.DOTALL)
|
|
372
|
+
if desc_section_match:
|
|
373
|
+
desc_text = desc_section_match.group(1).strip()
|
|
374
|
+
# Replace newlines with spaces to ensure a single line description
|
|
375
|
+
return re.sub(WHITESPACE_CLEANUP_PATTERN, ' ', desc_text)
|
|
376
|
+
|
|
377
|
+
# Next, try to find an Overview section in AsciiDoc
|
|
378
|
+
overview_section_match = re.search(ADOC_OVERVIEW_SECTION_PATTERN, content, re.DOTALL)
|
|
379
|
+
if overview_section_match:
|
|
380
|
+
# Take the first paragraph of the overview
|
|
381
|
+
overview = overview_section_match.group(1).strip()
|
|
382
|
+
first_para_match = re.search(FIRST_PARAGRAPH_PATTERN, overview, re.DOTALL)
|
|
383
|
+
if first_para_match:
|
|
384
|
+
# Replace newlines with spaces to ensure a single line description
|
|
385
|
+
return re.sub(WHITESPACE_CLEANUP_PATTERN, ' ', first_para_match.group(1).strip())
|
|
386
|
+
# Replace newlines with spaces to ensure a single line description
|
|
387
|
+
return re.sub(WHITESPACE_CLEANUP_PATTERN, ' ', overview)
|
|
388
|
+
|
|
389
|
+
# Try to find the first paragraph after a title in AsciiDoc format
|
|
390
|
+
title_match = re.search(ADOC_TITLE_AND_PARAGRAPH_PATTERN, content, re.DOTALL)
|
|
391
|
+
if title_match:
|
|
392
|
+
# Replace newlines with spaces to ensure a single line description
|
|
393
|
+
return re.sub(WHITESPACE_CLEANUP_PATTERN, ' ', title_match.group(2).strip())
|
|
394
|
+
|
|
395
|
+
# For Markdown format
|
|
321
396
|
# First, try to find a dedicated Description section
|
|
322
|
-
desc_section_match = re.search(
|
|
397
|
+
desc_section_match = re.search(MD_DESCRIPTION_SECTION_PATTERN, content, re.DOTALL)
|
|
323
398
|
if desc_section_match:
|
|
324
399
|
return desc_section_match.group(1).strip()
|
|
325
400
|
|
|
326
401
|
# Next, try to find an Overview section
|
|
327
|
-
overview_section_match = re.search(
|
|
402
|
+
overview_section_match = re.search(MD_OVERVIEW_SECTION_PATTERN, content, re.DOTALL)
|
|
328
403
|
if overview_section_match:
|
|
329
404
|
# Take the first paragraph of the overview
|
|
330
405
|
overview = overview_section_match.group(1).strip()
|
|
331
|
-
first_para_match = re.search(
|
|
406
|
+
first_para_match = re.search(FIRST_PARAGRAPH_PATTERN, overview, re.DOTALL)
|
|
332
407
|
if first_para_match:
|
|
333
408
|
return first_para_match.group(1).strip()
|
|
334
409
|
return overview
|
|
335
410
|
|
|
336
411
|
# Try to find the first paragraph after the title
|
|
337
|
-
match = re.search(
|
|
412
|
+
match = re.search(MD_TITLE_AND_PARAGRAPH_PATTERN, content, re.DOTALL)
|
|
338
413
|
if match:
|
|
339
414
|
return match.group(1).strip()
|
|
340
415
|
|
|
341
416
|
# Fallback: Try to find any text before the first ## heading
|
|
342
|
-
match = re.search(
|
|
417
|
+
match = re.search(MD_TEXT_BEFORE_FIRST_HEADING_PATTERN, content, re.DOTALL)
|
|
343
418
|
if match:
|
|
344
419
|
return match.group(1).strip()
|
|
345
420
|
|
|
346
421
|
# If all else fails, extract the title as a fallback
|
|
347
|
-
title_match = re.search(
|
|
422
|
+
title_match = re.search(MD_TITLE_PATTERN, content)
|
|
348
423
|
if title_match:
|
|
349
424
|
pattern_name = title_match.group(1).strip()
|
|
350
425
|
return f'A pattern for integrating {pattern_name} services'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""AWS CDK MCP server implementation."""
|
|
16
|
+
|
|
17
|
+
from awslabs.cdk_mcp_server.core.server import main
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if __name__ == '__main__':
|
|
21
|
+
main()
|