Skip to content

Commit 7421f64

Browse files
authored
feat(dynamodb): improving Database Analysis Queries and changing the query results output format (#1578)
* Improve source_analyer tool cr: https://code.amazon.com/reviews/CR-228084467 * commiting the test files * Improving Database Analysis Queries and changes to data modeller cr: https://code.amazon.com/reviews/CR-228322116 * Cleaning up queries and data modeller prompt cr: https://code.amazon.com/reviews/CR-228364585 * adding extra condition to ignore system or performance schema related queries cr: https://code.amazon.com/reviews/CR-228364585 * Fixing secret and formating issue * Fixing the unit tests * Increasing the test coverage * Increasing the test coverage * add some more test for markdown formater * Update the readme * Adding precommit changes * Removing the unreachable code * Increasing coverage for partially covered lines on markdown_formatter.py
1 parent cbccca4 commit 7421f64

File tree

10 files changed

+2180
-342
lines changed

10 files changed

+2180
-342
lines changed

.secrets.baseline

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"filename": "src/dynamodb-mcp-server/README.md",
206206
"hashed_secret": "37b5ecd16fe6c599c85077c7992427df62b2ab71",
207207
"is_verified": false,
208-
"line_number": 100,
208+
"line_number": 152,
209209
"is_secret": false
210210
}
211211
],
@@ -215,7 +215,7 @@
215215
"filename": "src/dynamodb-mcp-server/awslabs/dynamodb_mcp_server/database_analyzers.py",
216216
"hashed_secret": "38a2bae6275b4d868c488758d213827833cd8570",
217217
"is_verified": false,
218-
"line_number": 103,
218+
"line_number": 107,
219219
"is_secret": false
220220
}
221221
],
@@ -235,15 +235,15 @@
235235
"filename": "src/dynamodb-mcp-server/tests/test_source_db_integration.py",
236236
"hashed_secret": "fe1bae27cb7c1fb823f496f286e78f1d2ae87734",
237237
"is_verified": false,
238-
"line_number": 19,
238+
"line_number": 18,
239239
"is_secret": false
240240
},
241241
{
242242
"type": "Secret Keyword",
243243
"filename": "src/dynamodb-mcp-server/tests/test_source_db_integration.py",
244244
"hashed_secret": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
245245
"is_verified": false,
246-
"line_number": 286,
246+
"line_number": 292,
247247
"is_secret": false
248248
}
249249
],
@@ -896,5 +896,5 @@
896896
}
897897
]
898898
},
899-
"generated_at": "2025-10-30T19:32:08Z"
899+
"generated_at": "2025-10-31T16:14:13Z"
900900
}

src/dynamodb-mcp-server/README.md

Lines changed: 78 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,34 @@ Right now the DynamoDB MCP server contains two tools that support data modeling
1111
* `dynamodb_data_modeling` - Retrieves the complete DynamoDB Data Modeling Expert prompt
1212
* `source_db_analyzer` - Executes predefined SQL queries against source databases to analyze schema and access patterns
1313

14-
## Migration Notice
14+
## Instructions
1515

16-
Starting with version 2.0.0, this server focuses exclusively on DynamoDB design and modeling guidance. All operational DynamoDB management tools (table operations, item operations, queries, backups, etc.) have been removed in favor of the [AWS API MCP Server](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server) which provides the same capability and more.
16+
To design a data model in natural language you can simply ask your AI agent to “use my DynamoDB MCP to help me design a DynamoDB data model,” or something similar. If you want to analyze your MySQL query patterns then you can follow these additional steps below to setup connectivity and then say something like “analyze my MySQL database and then help me design a DynamoDB data model.”
1717

18-
**This server does not do:**
18+
### Prerequisites
1919

20-
- ❌ Operational DynamoDB management (CRUD operations)
21-
- ❌ Table creation or data migration
22-
- ❌ Direct data queries or transformations
20+
1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
21+
2. Install Python using `uv python install 3.10`
22+
3. Set up AWS credentials with access to AWS services
2323

24-
### Recommended: AWS API MCP Server
24+
* Consider setting up Read-only permission if you don't want the LLM to modify any resources
2525

26-
For operational DynamoDB management (retrieving data, managing tables, etc.), use the [AWS API MCP Server](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server) which provides comprehensive DynamoDB operations. [Migration guide available here](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server).
26+
### Installation
2727

28-
### Not Recommended: Legacy Version
28+
Use the configurations below to install the MCP without configuring the MySQL source database analyzer.
2929

30-
If you must use the previous operational tools, you can pin to version 1.0.9, though this is not recommended:
30+
| Cursor | VS Code |
31+
|:------:|:-------:|
32+
| [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/en/install-mcp?name=awslabs.dynamodb-mcp-server&config=JTdCJTIyY29tbWFuZCUyMiUzQSUyMnV2eCUyMGF3c2xhYnMuZHluYW1vZGItbWNwLXNlcnZlciU0MGxhdGVzdCUyMiUyQyUyMmVudiUyMiUzQSU3QiUyMkREQi1NQ1AtUkVBRE9OTFklMjIlM0ElMjJ0cnVlJTIyJTJDJTIyQVdTX1BST0ZJTEUlMjIlM0ElMjJkZWZhdWx0JTIyJTJDJTIyQVdTX1JFR0lPTiUyMiUzQSUyMnVzLXdlc3QtMiUyMiUyQyUyMkZBU1RNQ1BfTE9HX0xFVkVMJTIyJTNBJTIyRVJST1IlMjIlN0QlMkMlMjJkaXNhYmxlZCUyMiUzQWZhbHNlJTJDJTIyYXV0b0FwcHJvdmUlMjIlM0ElNUIlNUQlN0Q%3D)| [![Install on VS Code](https://img.shields.io/badge/Install_on-VS_Code-FF9900?style=flat-square&logo=visualstudiocode&logoColor=white)](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%22DDB-MCP-READONLY%22%3A%22true%22%2C%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) |
33+
34+
Add the MCP to your favorite agentic tools. (e.g. for Amazon Q Developer CLI MCP, `~/.aws/amazonq/mcp.json`):
3135

3236
```json
3337
{
3438
"mcpServers": {
3539
"awslabs.dynamodb-mcp-server": {
3640
"command": "uvx",
37-
"args": ["awslabs.dynamodb-mcp-server@1.0.9"],
41+
"args": ["awslabs.dynamodb-mcp-server@latest"],
3842
"env": {
3943
"DDB-MCP-READONLY": "true",
4044
"AWS_PROFILE": "default",
@@ -48,9 +52,57 @@ If you must use the previous operational tools, you can pin to version 1.0.9, th
4852
}
4953
```
5054

51-
## Instructions
55+
### Windows Installation
5256

53-
To design a data model in natural language you can simply ask your AI agent to “use my DynamoDB MCP to help me design a DynamoDB data model,” or something similar. If you want to analyze your MySQL query patterns then you can follow these additional steps below to setup connectivity and then say something like “analyze my MySQL database and then help me design a DynamoDB data model.”
57+
For Windows users, the MCP server configuration format is slightly different:
58+
59+
```json
60+
{
61+
"mcpServers": {
62+
"awslabs.dynamodb-mcp-server": {
63+
"disabled": false,
64+
"timeout": 60,
65+
"type": "stdio",
66+
"command": "uv",
67+
"args": [
68+
"tool",
69+
"run",
70+
"--from",
71+
"awslabs.dynamodb-mcp-server@latest",
72+
"awslabs.dynamodb-mcp-server.exe"
73+
],
74+
"env": {
75+
"FASTMCP_LOG_LEVEL": "ERROR",
76+
"AWS_PROFILE": "your-aws-profile",
77+
"AWS_REGION": "us-west-2"
78+
}
79+
}
80+
}
81+
}
82+
```
83+
84+
or docker after a successful `docker build -t awslabs/dynamodb-mcp-server .`:
85+
86+
```json
87+
{
88+
"mcpServers": {
89+
"awslabs.dynamodb-mcp-server": {
90+
"command": "docker",
91+
"args": [
92+
"run",
93+
"--rm",
94+
"--interactive",
95+
"--env",
96+
"FASTMCP_LOG_LEVEL=ERROR",
97+
"awslabs/dynamodb-mcp-server:latest"
98+
],
99+
"env": {},
100+
"disabled": false,
101+
"autoApprove": []
102+
}
103+
}
104+
}
105+
```
54106

55107
## Source Database Integration
56108

@@ -108,28 +160,30 @@ Add these environment variables to DynamoDB MCP Server configuration to enable M
108160
}
109161
```
110162

111-
## Prerequisites
163+
## Migration Notice
112164

113-
1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
114-
2. Install Python using `uv python install 3.10`
115-
3. Set up AWS credentials with access to AWS services
165+
Starting with version 2.0.0, this server focuses exclusively on DynamoDB design and modeling guidance. All operational DynamoDB management tools (table operations, item operations, queries, backups, etc.) have been removed in favor of the [AWS API MCP Server](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server) which provides the same capability and more.
116166

117-
* Consider setting up Read-only permission if you don't want the LLM to modify any resources
167+
**This server does not do:**
118168

119-
## Installation
169+
- ❌ Operational DynamoDB management (CRUD operations)
170+
- ❌ Table creation or data migration
171+
- ❌ Direct data queries or transformations
120172

121-
| Cursor | VS Code |
122-
|:------:|:-------:|
123-
| [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/en/install-mcp?name=awslabs.dynamodb-mcp-server&config=JTdCJTIyY29tbWFuZCUyMiUzQSUyMnV2eCUyMGF3c2xhYnMuZHluYW1vZGItbWNwLXNlcnZlciU0MGxhdGVzdCUyMiUyQyUyMmVudiUyMiUzQSU3QiUyMkREQi1NQ1AtUkVBRE9OTFklMjIlM0ElMjJ0cnVlJTIyJTJDJTIyQVdTX1BST0ZJTEUlMjIlM0ElMjJkZWZhdWx0JTIyJTJDJTIyQVdTX1JFR0lPTiUyMiUzQSUyMnVzLXdlc3QtMiUyMiUyQyUyMkZBU1RNQ1BfTE9HX0xFVkVMJTIyJTNBJTIyRVJST1IlMjIlN0QlMkMlMjJkaXNhYmxlZCUyMiUzQWZhbHNlJTJDJTIyYXV0b0FwcHJvdmUlMjIlM0ElNUIlNUQlN0Q%3D)| [![Install on VS Code](https://img.shields.io/badge/Install_on-VS_Code-FF9900?style=flat-square&logo=visualstudiocode&logoColor=white)](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%22DDB-MCP-READONLY%22%3A%22true%22%2C%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) |
173+
### Recommended: AWS API MCP Server
124174

125-
Add the MCP to your favorite agentic tools. (e.g. for Amazon Q Developer CLI MCP, `~/.aws/amazonq/mcp.json`):
175+
For operational DynamoDB management (retrieving data, managing tables, etc.), use the [AWS API MCP Server](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server) which provides comprehensive DynamoDB operations. [Migration guide available here](https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server).
176+
177+
### Not Recommended: Legacy Version
178+
179+
If you must use the previous operational tools, you can pin to version 1.0.9, though this is not recommended:
126180

127181
```json
128182
{
129183
"mcpServers": {
130184
"awslabs.dynamodb-mcp-server": {
131185
"command": "uvx",
132-
"args": ["awslabs.dynamodb-mcp-server@latest"],
186+
"args": ["awslabs.dynamodb-mcp-server@1.0.9"],
133187
"env": {
134188
"DDB-MCP-READONLY": "true",
135189
"AWS_PROFILE": "default",
@@ -142,82 +196,3 @@ Add the MCP to your favorite agentic tools. (e.g. for Amazon Q Developer CLI MCP
142196
}
143197
}
144198
```
145-
146-
### Windows Installation
147-
148-
For Windows users, the MCP server configuration format is slightly different:
149-
150-
```json
151-
{
152-
"mcpServers": {
153-
"awslabs.dynamodb-mcp-server": {
154-
"disabled": false,
155-
"timeout": 60,
156-
"type": "stdio",
157-
"command": "uv",
158-
"args": [
159-
"tool",
160-
"run",
161-
"--from",
162-
"awslabs.dynamodb-mcp-server@latest",
163-
"awslabs.dynamodb-mcp-server.exe"
164-
],
165-
"env": {
166-
"FASTMCP_LOG_LEVEL": "ERROR",
167-
"AWS_PROFILE": "your-aws-profile",
168-
"AWS_REGION": "us-west-2"
169-
}
170-
}
171-
}
172-
}
173-
```
174-
175-
176-
or docker after a successful `docker build -t awslabs/dynamodb-mcp-server .`:
177-
178-
```json
179-
{
180-
"mcpServers": {
181-
"awslabs.dynamodb-mcp-server": {
182-
"command": "docker",
183-
"args": [
184-
"run",
185-
"--rm",
186-
"--interactive",
187-
"--env",
188-
"FASTMCP_LOG_LEVEL=ERROR",
189-
"awslabs/dynamodb-mcp-server:latest"
190-
],
191-
"env": {},
192-
"disabled": false,
193-
"autoApprove": []
194-
}
195-
}
196-
}
197-
```
198-
199-
## Limitations & Considerations
200-
201-
### **Application-Level Patterns:**
202-
203-
* Queries generated dynamically in application code
204-
* Caching layer behavior (Redis, Memcached)
205-
* Real-time vs. analytics query differentiation
206-
* Background job access patterns
207-
208-
### Business Context:
209-
210-
* Data consistency requirements
211-
* Compliance and audit requirements
212-
* Geographic distribution requirements
213-
214-
### Recommendation:
215-
216-
Supplement analysis with documentation or natural language descriptions based on:
217-
218-
* Application code review
219-
* Architecture documentation review
220-
* Stakeholder interviews with development team
221-
* Load testing results analysis
222-
223-
There are also more complex patterns that result from stored procedures, triggers, aggregations, that the tool does not currently handle consistently but we plan to improve in future iterations.

0 commit comments

Comments
 (0)