awslabs.dynamodb-mcp-server 2.0.4__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_dynamodb_mcp_server-2.0.4/.gitignore +59 -0
- awslabs_dynamodb_mcp_server-2.0.4/.python-version +1 -0
- awslabs_dynamodb_mcp_server-2.0.4/CHANGELOG.md +43 -0
- awslabs_dynamodb_mcp_server-2.0.4/Dockerfile +88 -0
- awslabs_dynamodb_mcp_server-2.0.4/LICENSE +175 -0
- awslabs_dynamodb_mcp_server-2.0.4/NOTICE +2 -0
- awslabs_dynamodb_mcp_server-2.0.4/PKG-INFO +257 -0
- awslabs_dynamodb_mcp_server-2.0.4/README.md +222 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/__init__.py +36 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/__init__.py +17 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/common.py +39 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/database_analysis_queries.py +346 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/database_analyzers.py +381 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/markdown_formatter.py +501 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/model_validation_utils.py +852 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/prompts/dynamodb_architect.md +840 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/prompts/json_generation_guide.md +185 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/prompts/transform_model_validation_result.md +168 -0
- awslabs_dynamodb_mcp_server-2.0.4/awslabs/dynamodb_mcp_server/server.py +466 -0
- awslabs_dynamodb_mcp_server-2.0.4/docker-healthcheck.sh +25 -0
- awslabs_dynamodb_mcp_server-2.0.4/pyproject.toml +151 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/__init__.py +14 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/conftest.py +30 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/evals/README.md +357 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/evals/dynamic_evaluators.py +251 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/evals/evaluation_registry.py +243 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/evals/logging_config.py +77 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/evals/multiturn_evaluator.py +376 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/evals/scenarios.py +244 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/evals/test_dspy_evals.py +338 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/test_dynamodb_server.py +774 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/test_markdown_formatter.py +974 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/test_model_validation_utils.py +1642 -0
- awslabs_dynamodb_mcp_server-2.0.4/tests/test_source_db_integration.py +604 -0
- awslabs_dynamodb_mcp_server-2.0.4/uv-requirements.txt +27 -0
- awslabs_dynamodb_mcp_server-2.0.4/uv.lock +3500 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
share/python-wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
MANIFEST
|
|
24
|
+
|
|
25
|
+
# Virtual environments
|
|
26
|
+
.venv
|
|
27
|
+
env/
|
|
28
|
+
venv/
|
|
29
|
+
ENV/
|
|
30
|
+
|
|
31
|
+
# IDE
|
|
32
|
+
.idea/
|
|
33
|
+
.vscode/
|
|
34
|
+
*.swp
|
|
35
|
+
*.swo
|
|
36
|
+
|
|
37
|
+
# Testing
|
|
38
|
+
.tox/
|
|
39
|
+
.coverage
|
|
40
|
+
.coverage.*
|
|
41
|
+
htmlcov/
|
|
42
|
+
.pytest_cache/
|
|
43
|
+
|
|
44
|
+
# Ruff
|
|
45
|
+
.ruff_cache/
|
|
46
|
+
|
|
47
|
+
# Build
|
|
48
|
+
*.manifest
|
|
49
|
+
*.spec
|
|
50
|
+
.pybuilder/
|
|
51
|
+
target/
|
|
52
|
+
|
|
53
|
+
# Environments
|
|
54
|
+
.env
|
|
55
|
+
.env.local
|
|
56
|
+
.env.*.local
|
|
57
|
+
|
|
58
|
+
# PyPI
|
|
59
|
+
.pypirc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.10
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.0.4] - 2025-11-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **DynamoDB Command Execution:** Added `execute_dynamodb_command` tool that integrates with [AWS API MCP Server](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server) to execute DynamoDB operations directly without requiring separate AWS API MCP Server configuration.
|
|
13
|
+
|
|
14
|
+
## [2.0.0] - 2025-09-11
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
|
|
18
|
+
- **BREAKING CHANGE:** DynamoDB Native API functions have been removed in favour of the [AWS API MCP Server](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server).
|
|
19
|
+
|
|
20
|
+
- The following functionality has been removed:
|
|
21
|
+
- Table Operations
|
|
22
|
+
- Item Operations
|
|
23
|
+
- Query and Scan Operations
|
|
24
|
+
- Backup and Recovery Operations
|
|
25
|
+
- Time to Live Operations
|
|
26
|
+
- Export Operations
|
|
27
|
+
- Tags and Resource Policies Operations
|
|
28
|
+
- Miscellaneous Operations (describe endpoints and describe limits)
|
|
29
|
+
|
|
30
|
+
- **Migration:** Use the AWS API MCP Server to perform these operations going forward.
|
|
31
|
+
|
|
32
|
+
## [1.0.0] - 2025-05-26
|
|
33
|
+
|
|
34
|
+
### Removed
|
|
35
|
+
|
|
36
|
+
- **BREAKING CHANGE:** Server Sent Events (SSE) support has been removed in accordance with the Model Context Protocol specification's [backwards compatibility guidelines](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#backwards-compatibility)
|
|
37
|
+
- This change prepares for future support of [Streamable HTTP](https://modelcontextprotocol.io/specification/draft/basic/transports#streamable-http) transport
|
|
38
|
+
|
|
39
|
+
## Unreleased
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- Initial project setup
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
# dependabot should continue to update this to the latest hash.
|
|
16
|
+
FROM public.ecr.aws/docker/library/python:3.13-alpine@sha256:070342a0cc1011532c0e69972cce2bbc6cc633eba294bae1d12abea8bd05303b AS uv
|
|
17
|
+
|
|
18
|
+
# Install the project into `/app`
|
|
19
|
+
WORKDIR /app
|
|
20
|
+
|
|
21
|
+
# Enable bytecode compilation
|
|
22
|
+
ENV UV_COMPILE_BYTECODE=1
|
|
23
|
+
|
|
24
|
+
# Copy from the cache instead of linking since it's a mounted volume
|
|
25
|
+
ENV UV_LINK_MODE=copy
|
|
26
|
+
|
|
27
|
+
# Prefer the system python
|
|
28
|
+
ENV UV_PYTHON_PREFERENCE=only-system
|
|
29
|
+
|
|
30
|
+
# Run without updating the uv.lock file like running with `--frozen`
|
|
31
|
+
ENV UV_FROZEN=true
|
|
32
|
+
|
|
33
|
+
# Copy the required files first
|
|
34
|
+
COPY pyproject.toml uv.lock uv-requirements.txt ./
|
|
35
|
+
|
|
36
|
+
# Python optimization and uv configuration
|
|
37
|
+
ENV PIP_NO_CACHE_DIR=1 \
|
|
38
|
+
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
39
|
+
|
|
40
|
+
# Install system dependencies and Python package manager
|
|
41
|
+
RUN apk update && \
|
|
42
|
+
apk add --no-cache --virtual .build-deps \
|
|
43
|
+
build-base \
|
|
44
|
+
gcc \
|
|
45
|
+
musl-dev \
|
|
46
|
+
libffi-dev \
|
|
47
|
+
openssl-dev \
|
|
48
|
+
cargo
|
|
49
|
+
|
|
50
|
+
# Install the project's dependencies using the lockfile and settings
|
|
51
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
52
|
+
pip install --require-hashes --requirement uv-requirements.txt --no-cache-dir && \
|
|
53
|
+
uv sync --python 3.13 --frozen --no-install-project --no-dev --no-editable
|
|
54
|
+
|
|
55
|
+
# Then, add the rest of the project source code and install it
|
|
56
|
+
# Installing separately from its dependencies allows optimal layer caching
|
|
57
|
+
COPY . /app
|
|
58
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
59
|
+
uv sync --python 3.13 --frozen --no-dev --no-editable
|
|
60
|
+
|
|
61
|
+
# Make the directory just in case it doesn't exist
|
|
62
|
+
RUN mkdir -p /root/.local
|
|
63
|
+
|
|
64
|
+
FROM public.ecr.aws/docker/library/python:3.13-alpine@sha256:070342a0cc1011532c0e69972cce2bbc6cc633eba294bae1d12abea8bd05303b
|
|
65
|
+
|
|
66
|
+
# Place executables in the environment at the front of the path and include other binaries
|
|
67
|
+
ENV PATH="/app/.venv/bin:$PATH" \
|
|
68
|
+
PYTHONUNBUFFERED=1
|
|
69
|
+
|
|
70
|
+
# Install runtime dependencies and create application user
|
|
71
|
+
RUN apk update && \
|
|
72
|
+
apk add --no-cache ca-certificates && \
|
|
73
|
+
update-ca-certificates && \
|
|
74
|
+
addgroup -S app && \
|
|
75
|
+
adduser -S app -G app -h /app
|
|
76
|
+
|
|
77
|
+
# Copy application artifacts from build stage
|
|
78
|
+
COPY --from=uv --chown=app:app /app/.venv /app/.venv
|
|
79
|
+
|
|
80
|
+
# Get healthcheck script
|
|
81
|
+
COPY ./docker-healthcheck.sh /usr/local/bin/docker-healthcheck.sh
|
|
82
|
+
|
|
83
|
+
# Run as non-root
|
|
84
|
+
USER app
|
|
85
|
+
|
|
86
|
+
# When running the container, add --db-path and a bind mount to the host's db file
|
|
87
|
+
HEALTHCHECK --interval=60s --timeout=10s --start-period=10s --retries=3 CMD ["docker-healthcheck.sh"]
|
|
88
|
+
ENTRYPOINT ["awslabs.dynamodb-mcp-server"]
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: awslabs.dynamodb-mcp-server
|
|
3
|
+
Version: 2.0.4
|
|
4
|
+
Summary: The official MCP Server for interacting with AWS DynamoDB
|
|
5
|
+
Project-URL: homepage, https://awslabs.github.io/mcp/
|
|
6
|
+
Project-URL: docs, https://awslabs.github.io/mcp/servers/dynamodb-mcp-server/
|
|
7
|
+
Project-URL: documentation, https://awslabs.github.io/mcp/servers/dynamodb-mcp-server/
|
|
8
|
+
Project-URL: repository, https://github.com/awslabs/mcp.git
|
|
9
|
+
Project-URL: changelog, https://github.com/awslabs/mcp/blob/main/src/dynamodb-mcp-server/CHANGELOG.md
|
|
10
|
+
Author: Amazon Web Services
|
|
11
|
+
Author-email: AWSLabs MCP <203918161+awslabs-mcp@users.noreply.github.com>, Erben Mo <moerben@amazon.com>
|
|
12
|
+
License: Apache-2.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: awslabs-aws-api-mcp-server==1.0.2
|
|
25
|
+
Requires-Dist: awslabs-mysql-mcp-server==1.0.5
|
|
26
|
+
Requires-Dist: boto3>=1.40.5
|
|
27
|
+
Requires-Dist: dspy-ai>=2.6.27
|
|
28
|
+
Requires-Dist: loguru==0.7.3
|
|
29
|
+
Requires-Dist: mcp[cli]==1.12.4
|
|
30
|
+
Requires-Dist: psutil==7.1.1
|
|
31
|
+
Requires-Dist: pydantic==2.11.7
|
|
32
|
+
Requires-Dist: strands-agents>=1.5.0
|
|
33
|
+
Requires-Dist: typing-extensions==4.14.1
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# AWS DynamoDB MCP Server
|
|
37
|
+
|
|
38
|
+
The official developer experience MCP Server for Amazon DynamoDB. This server provides DynamoDB expert design guidance and data modeling assistance.
|
|
39
|
+
|
|
40
|
+
## Available Tools
|
|
41
|
+
|
|
42
|
+
The DynamoDB MCP server provides four tools for data modeling and validation:
|
|
43
|
+
|
|
44
|
+
- `dynamodb_data_modeling` - Retrieves the complete DynamoDB Data Modeling Expert prompt with enterprise-level design patterns, cost optimization strategies, and multi-table design philosophy. Guides through requirements gathering, access pattern analysis, and schema design.
|
|
45
|
+
|
|
46
|
+
**Example invocation:** "Design a data model for my e-commerce application using the DynamoDB data modeling MCP server"
|
|
47
|
+
|
|
48
|
+
- `dynamodb_data_model_validation` - Validates your DynamoDB data model by loading dynamodb_data_model.json, setting up DynamoDB Local, creating tables with test data, and executing all defined access patterns. Saves detailed validation results to dynamodb_model_validation.json.
|
|
49
|
+
|
|
50
|
+
**Example invocation:** "Validate my DynamoDB data model"
|
|
51
|
+
|
|
52
|
+
- `source_db_analyzer` - Analyzes existing MySQL/Aurora databases to extract schema structure, access patterns from Performance Schema, and generates timestamped analysis files for use with dynamodb_data_modeling. Requires AWS RDS Data API and credentials in Secrets Manager.
|
|
53
|
+
|
|
54
|
+
**Example invocation:** "Analyze my MySQL database and help me design a DynamoDB data model"
|
|
55
|
+
|
|
56
|
+
- `execute_dynamodb_command` - Executes AWS CLI DynamoDB commands against DynamoDB Local or AWS DynamoDB. Supports all DynamoDB API operations and automatically configures credentials for local testing.
|
|
57
|
+
|
|
58
|
+
**Example invocation:** "Create the tables from the data model that was just created in my account in region us-east-1"
|
|
59
|
+
|
|
60
|
+
## Prerequisites
|
|
61
|
+
|
|
62
|
+
1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
|
|
63
|
+
2. Install Python using `uv python install 3.10`
|
|
64
|
+
3. Set up AWS credentials with access to AWS services
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
| Cursor | VS Code |
|
|
69
|
+
|:------:|:-------:|
|
|
70
|
+
| [](https://cursor.com/en/install-mcp?name=awslabs.dynamodb-mcp-server&config=JTdCJTIyY29tbWFuZCUyMiUzQSUyMnV2eCUyMGF3c2xhYnMuZHluYW1vZGItbWNwLXNlcnZlciU0MGxhdGVzdCUyMiUyQyUyMmVudiUyMiUzQSU3QiUyMkFXU19QUk9GSUxFJTIyJTNBJTIyZGVmYXVsdCUyMiUyQyUyMkFXU19SRUdJT04lMjIlM0ElMjJ1cy13ZXN0LTIlMjIlMkMlMjJGQVNUTUNQX0xPR19MRVZFTCUyMiUzQSUyMkVSUk9SJTIyJTdEJTJDJTIyZGlzYWJsZWQlMjIlM0FmYWxzZSUyQyUyMmF1dG9BcHByb3ZlJTIyJTNBJTVCJTVEJTdE)| [](https://insiders.vscode.dev/redirect/mcp/install?name=DynamoDB%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.dynamodb-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22AWS_PROFILE%22%3A%22default%22%2C%22AWS_REGION%22%3A%22us-west-2%22%2C%22FASTMCP_LOG_LEVEL%22%3A%22ERROR%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D) |
|
|
71
|
+
|
|
72
|
+
Add the MCP to your favorite agentic tools (e.g. for Amazon Q Developer CLI MCP `~/.aws/amazonq/mcp.json`, or [Kiro CLI](https://kiro.dev/docs/cli/migrating-from-q/) which is replacing Amazon Q Developer CLI):
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"awslabs.dynamodb-mcp-server": {
|
|
78
|
+
"command": "uvx",
|
|
79
|
+
"args": ["awslabs.dynamodb-mcp-server@latest"],
|
|
80
|
+
"env": {
|
|
81
|
+
"FASTMCP_LOG_LEVEL": "ERROR"
|
|
82
|
+
},
|
|
83
|
+
"disabled": false,
|
|
84
|
+
"autoApprove": []
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Windows Installation
|
|
91
|
+
|
|
92
|
+
For Windows users, the MCP server configuration format is slightly different:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"mcpServers": {
|
|
97
|
+
"awslabs.dynamodb-mcp-server": {
|
|
98
|
+
"disabled": false,
|
|
99
|
+
"timeout": 60,
|
|
100
|
+
"type": "stdio",
|
|
101
|
+
"command": "uv",
|
|
102
|
+
"args": [
|
|
103
|
+
"tool",
|
|
104
|
+
"run",
|
|
105
|
+
"--from",
|
|
106
|
+
"awslabs.dynamodb-mcp-server@latest",
|
|
107
|
+
"awslabs.dynamodb-mcp-server.exe"
|
|
108
|
+
],
|
|
109
|
+
"env": {
|
|
110
|
+
"FASTMCP_LOG_LEVEL": "ERROR",
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Docker Installation
|
|
118
|
+
|
|
119
|
+
After a successful `docker build -t awslabs/dynamodb-mcp-server .`:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"awslabs.dynamodb-mcp-server": {
|
|
125
|
+
"command": "docker",
|
|
126
|
+
"args": [
|
|
127
|
+
"run",
|
|
128
|
+
"--rm",
|
|
129
|
+
"--interactive",
|
|
130
|
+
"--env",
|
|
131
|
+
"FASTMCP_LOG_LEVEL=ERROR",
|
|
132
|
+
"awslabs/dynamodb-mcp-server:latest"
|
|
133
|
+
],
|
|
134
|
+
"env": {},
|
|
135
|
+
"disabled": false,
|
|
136
|
+
"autoApprove": []
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Data Modeling
|
|
143
|
+
|
|
144
|
+
### Data Modeling in Natural Language
|
|
145
|
+
|
|
146
|
+
Use the `dynamodb_data_modeling` tool to design DynamoDB data models through natural language conversation with your AI agent. Simply ask: "use my DynamoDB MCP to help me design a DynamoDB data model."
|
|
147
|
+
|
|
148
|
+
The tool provides a structured workflow that translates application requirements into DynamoDB data models:
|
|
149
|
+
|
|
150
|
+
**Requirements Gathering Phase:**
|
|
151
|
+
- Captures access patterns through natural language conversation
|
|
152
|
+
- Documents entities, relationships, and read/write patterns
|
|
153
|
+
- Records estimated requests per second (RPS) for each pattern
|
|
154
|
+
- Creates `dynamodb_requirements.md` file that updates in real-time
|
|
155
|
+
- Identifies patterns better suited for other AWS services (OpenSearch for text search, Redshift for analytics)
|
|
156
|
+
- Flags special design considerations (e.g., massive fan-out patterns requiring DynamoDB Streams and Lambda)
|
|
157
|
+
|
|
158
|
+
**Design Phase:**
|
|
159
|
+
- Generates optimized table and index designs
|
|
160
|
+
- Creates `dynamodb_data_model.md` with detailed design rationale
|
|
161
|
+
- Provides estimated monthly costs
|
|
162
|
+
- Documents how each access pattern is supported
|
|
163
|
+
- Includes optimization recommendations for scale and performance
|
|
164
|
+
|
|
165
|
+
The tool is backed by expert-engineered context that helps reasoning models guide you through advanced modeling techniques. Best results are achieved with reasoning-capable models such as Amazon Q, Anthropic Claude 4/4.5 Sonnet, OpenAI o3, and Google Gemini 2.5.
|
|
166
|
+
|
|
167
|
+
### Data Model Validation
|
|
168
|
+
|
|
169
|
+
**Prerequisites for Data Model Validation:**
|
|
170
|
+
To use the data model validation tool, you need one of the following:
|
|
171
|
+
- **Container Runtime**: Docker, Podman, Finch, or nerdctl with a running daemon
|
|
172
|
+
- **Java Runtime**: Java JRE version 17 or newer (set `JAVA_HOME` or ensure `java` is in your system PATH)
|
|
173
|
+
|
|
174
|
+
After completing your data model design, use the `dynamodb_data_model_validation` tool to automatically test your data model against DynamoDB Local. The validation tool closes the loop between generation and execution by creating an iterative validation cycle.
|
|
175
|
+
|
|
176
|
+
**How It Works:**
|
|
177
|
+
|
|
178
|
+
The tool automates the traditional manual validation process:
|
|
179
|
+
|
|
180
|
+
1. **Setup**: Spins up DynamoDB Local environment (Docker/Podman/Finch/nerdctl or Java fallback)
|
|
181
|
+
2. **Generate Test Specification**: Creates `dynamodb_data_model.json` listing tables, sample data, and access patterns to test
|
|
182
|
+
3. **Deploy Schema**: Creates tables, indexes, and inserts sample data locally
|
|
183
|
+
4. **Execute Tests**: Runs all read and write operations defined in your access patterns
|
|
184
|
+
5. **Validate Results**: Checks that each access pattern behaves correctly and efficiently
|
|
185
|
+
6. **Iterative Refinement**: If validation fails (e.g., query returns incomplete results due to misaligned partition key), the tool records the issue, and regenerates the affected schema and rerun tests until all patterns pass
|
|
186
|
+
|
|
187
|
+
**Validation Output:**
|
|
188
|
+
|
|
189
|
+
- `dynamodb_model_validation.json`: Detailed validation results with pattern responses
|
|
190
|
+
- `validation_result.md`: Summary of validation process with pass/fail status for each access pattern
|
|
191
|
+
- Identifies issues like incorrect key structures, missing indexes, or inefficient query patterns
|
|
192
|
+
|
|
193
|
+
### Source Database Analysis
|
|
194
|
+
|
|
195
|
+
The `source_db_analyzer` tool analyzes existing MySQL/Aurora databases to extract schema and access patterns for DynamoDB modeling. This is useful when migrating from relational databases.
|
|
196
|
+
|
|
197
|
+
#### Prerequisites for MySQL Integration
|
|
198
|
+
|
|
199
|
+
1. Aurora MySQL Cluster with credentials stored in AWS Secrets Manager
|
|
200
|
+
2. Enable RDS Data API for your Aurora MySQL Cluster
|
|
201
|
+
3. Enable Performance Schema for access pattern analysis (optional but recommended):
|
|
202
|
+
- Set `performance_schema` parameter to 1 in your DB parameter group
|
|
203
|
+
- Reboot the DB instance after changes
|
|
204
|
+
- Verify with: `SHOW GLOBAL VARIABLES LIKE '%performance_schema'`
|
|
205
|
+
- Consider tuning:
|
|
206
|
+
- `performance_schema_digests_size` - Maximum rows in events_statements_summary_by_digest
|
|
207
|
+
- `performance_schema_max_digest_length` - Maximum byte length per statement digest (default: 1024)
|
|
208
|
+
- Without Performance Schema, analysis is based on information schema only
|
|
209
|
+
|
|
210
|
+
4. AWS credentials with permissions to access RDS Data API and AWS Secrets Manager
|
|
211
|
+
|
|
212
|
+
#### MySQL Environment Variables
|
|
213
|
+
|
|
214
|
+
Add these environment variables to enable MySQL integration:
|
|
215
|
+
|
|
216
|
+
- `MYSQL_CLUSTER_ARN`: Aurora MySQL cluster Resource ARN
|
|
217
|
+
- `MYSQL_SECRET_ARN`: ARN of secret containing database credentials
|
|
218
|
+
- `MYSQL_DATABASE`: Database name to analyze
|
|
219
|
+
- `AWS_REGION`: AWS region of the Aurora MySQL cluster
|
|
220
|
+
- `MYSQL_MAX_QUERY_RESULTS`: Maximum rows in analysis output files (optional, default: 500)
|
|
221
|
+
|
|
222
|
+
#### MCP Configuration with MySQL
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"mcpServers": {
|
|
227
|
+
"awslabs.dynamodb-mcp-server": {
|
|
228
|
+
"command": "uvx",
|
|
229
|
+
"args": ["awslabs.dynamodb-mcp-server@latest"],
|
|
230
|
+
"env": {
|
|
231
|
+
"AWS_PROFILE": "default",
|
|
232
|
+
"AWS_REGION": "us-west-2",
|
|
233
|
+
"FASTMCP_LOG_LEVEL": "ERROR",
|
|
234
|
+
"MYSQL_CLUSTER_ARN": "arn:aws:rds:$REGION:$ACCOUNT_ID:cluster:$CLUSTER_NAME",
|
|
235
|
+
"MYSQL_SECRET_ARN": "arn:aws:secretsmanager:$REGION:$ACCOUNT_ID:secret:$SECRET_NAME",
|
|
236
|
+
"MYSQL_DATABASE": "<DATABASE_NAME>",
|
|
237
|
+
"MYSQL_MAX_QUERY_RESULTS": 500
|
|
238
|
+
},
|
|
239
|
+
"disabled": false,
|
|
240
|
+
"autoApprove": []
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### Using Source Database Analysis
|
|
247
|
+
|
|
248
|
+
1. Run `source_db_analyzer` against your MySQL database
|
|
249
|
+
2. Review the generated timestamped analysis folder (database_analysis_YYYYMMDD_HHMMSS)
|
|
250
|
+
3. Read the manifest.md file first - it lists all analysis files and statistics
|
|
251
|
+
4. Read all analysis files to understand schema structure and access patterns
|
|
252
|
+
5. Use the analysis with `dynamodb_data_modeling` to design your DynamoDB schema
|
|
253
|
+
|
|
254
|
+
The tool generates Markdown files with:
|
|
255
|
+
- Schema structure (tables, columns, indexes, foreign keys)
|
|
256
|
+
- Access patterns from Performance Schema (query patterns, RPS, frequencies)
|
|
257
|
+
- Timestamped analysis for tracking changes over time
|