-
Notifications
You must be signed in to change notification settings - Fork 898
feat(dynamodb-mcp-server): Add MySQL integration to support DynamoDB Data Modeling and Migration planning #1277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…Data Modeling and Migration planning
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1277 +/- ##
========================================
Coverage 89.21% 89.21%
========================================
Files 692 695 +3
Lines 48083 48209 +126
Branches 7464 7493 +29
========================================
+ Hits 42896 43011 +115
- Misses 3385 3392 +7
- Partials 1802 1806 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The official MCP Server for interacting with AWS DynamoDB | ||
|
||
This comprehensive server provides both operational DynamoDB management and expert design guidance, featuring 30+ operational tools for managing DynamoDB tables, items, indexes, backups, and more, expert data modeling guidance. | ||
This comprehensive server provides both operational DynamoDB management and expert design guidance, featuring 30+ operational tools for managing DynamoDB tables, items, indexes, backups, and more, expert data modeling guidance and also MySQL query capabilities for database analysis and migration planning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we considered to add or change existing evals to include this new use case? Please also consider adding a comment to the CR to show an end-to-end trace where the tool is exercised within the modeling workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 showing end-to-end trace, also keep add a task to add this to current evals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will include an end-to-end trace in the PR for better understanding of the workflow. Also, will plan for evals changes later once the actual MySQL data analysis tools are merged.
- `dynamodb_data_modeling` - Retrieves the complete DynamoDB Data Modeling Expert prompt | ||
|
||
### MySQL Integration | ||
- `mysql_run_query` - Run SQL queries against MySQL databases for analysis and migration planning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we really need to expose a free-from SQL query tool to the LLM. Have we considered having a parameterized SQL query to read the performance schema if that's our only use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels odd that the DynamoDB MCP server would expose a tool to run MySQL queries. Was there another option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be explicit that this currently uses Aurora/RDS only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's the only query (read the performance schema) we need to run. I think in the workflow I have seen, we need to do validation to check if users have enabled the performance schema, and also I think there are queries regarding getting the whole schema for a database. So there is a need for a tool that can run many such queries. The question is, is there a way to restrict the queries to only a few approved by us? Worth checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working on calling the mysql_run_query method within our analysis tool to execute the required SQL instead of registering as a separate tool. This will avoid exposing the tool publicly or user runs random calls.
except Exception as e: | ||
return [{'error': f'MySQL initialization failed: {str(e)}'}] | ||
else: | ||
return [{'error': 'MySQL configuration not properly configured or available'}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1/ This error is vague, most users don't read documentation. Should we make it
clearer what's misconfigured?
2/ Should we log errors with logging?
3/ Should we log the error in the MCP context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do
try: | ||
return await mysql_query(sql, DummyContext(), None, query_parameters) | ||
except Exception as e: | ||
return [{'error': f'MySQL query failed: {str(e)}'}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment about error handling
"FASTMCP_LOG_LEVEL": "ERROR", | ||
"MYSQL_CLUSTER_ARN": "[your data]", | ||
"MYSQL_SECRET_ARN": "[your data]", | ||
"MYSQL_DATABASE": "[your data]", | ||
"MYSQL_AWS_REGION": "us-west-2", | ||
"MYSQL_READONLY": "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain MYSQL_SECRET_ARN
in the README and why its required. Don't use [your data]
, put place holder values that are dummy and more intuitive to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will explain that in readme
MySQL Integration: This server also includes MySQL query capabilities through the run_query tool, enabling database | ||
analysis and migration planning from MySQL to DynamoDB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Aurora/RDS
"strands-agents>=1.5.0", | ||
"dspy-ai>=2.6.27" | ||
"dspy-ai>=2.6.27", | ||
"awslabs-mysql-mcp-server>=1.0.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be dependent on other MCP servers. When we need to extend support to other databases, or on-prem how do we handle that. Take a dependence on N number of MCP's doesn't seem like a viable approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now MySQL package is focused on Aurora MySQL, PR (1246) is yet to merge which will support both AWS and on-prem mysql. so this 1 package will eventually take care of entire MySQL databases. We will have to find / use similar packages for other databases.
The official MCP Server for interacting with AWS DynamoDB | ||
|
||
This comprehensive server provides both operational DynamoDB management and expert design guidance, featuring 30+ operational tools for managing DynamoDB tables, items, indexes, backups, and more, expert data modeling guidance. | ||
This comprehensive server provides both operational DynamoDB management and expert design guidance, featuring 30+ operational tools for managing DynamoDB tables, items, indexes, backups, and more, expert data modeling guidance and also MySQL query capabilities for database analysis and migration planning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 showing end-to-end trace, also keep add a task to add this to current evals.
- `dynamodb_data_modeling` - Retrieves the complete DynamoDB Data Modeling Expert prompt | ||
|
||
### MySQL Integration | ||
- `mysql_run_query` - Run SQL queries against MySQL databases for analysis and migration planning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's the only query (read the performance schema) we need to run. I think in the workflow I have seen, we need to do validation to check if users have enabled the performance schema, and also I think there are queries regarding getting the whole schema for a database. So there is a need for a tool that can run many such queries. The question is, is there a way to restrict the queries to only a few approved by us? Worth checking.
"FASTMCP_LOG_LEVEL": "ERROR", | ||
"AWS_PROFILE": "your-aws-profile", | ||
"AWS_REGION": "us-east-1" | ||
"AWS_REGION": "us-east-1",, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the purpose of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, we have DynamoDB API's using this particular AWS_REGION variable, we will remove that and use DB specific variables. It will help in case use resources (such as DB's) running on different regions.
"MYSQL_CLUSTER_ARN": "[your data]", | ||
"MYSQL_SECRET_ARN": "[your data]", | ||
"MYSQL_DATABASE": "[your data]", | ||
"MYSQL_AWS_REGION": "us-west-2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be place holder
Summary
Changes
Implementation of MySQL integration into the DynamoDB MCP server, providing foundational query capabilities for database migration analysis. This establishes the framework for comprehensive MySQL database analysis tooling.
Key Changes:
• Added MySQL Integration: Direct import of mysql_mcp_server functionality into the DynamoDB MCP server
• Tool: mysql_run_query tool is added to DynamoDB server and connects to MySQL DB when MySQL environment variables are configured
• Basic query execution: Execute SQL queries against RDS / Aurora MySQL clusters for migration analysis. Foundation for migration workflow analysis and database assessment
User experience
Before this change:
Users needed separate MCP servers for MySQL and DynamoDB operations, requiring:
• Multiple MCP server configurations in their setup
• Separate authentication and connection management
• Manual coordination between MySQL analysis and DynamoDB design workflows
After this change:
Users get a unified experience with a single MCP server that provides:
• Single Configuration: One MCP server configuration handles both MySQL analysis and DynamoDB operations
• Seamless Migration Workflow: Direct access to MySQL data for informing DynamoDB design decisions within the same tool context
• Extensible Foundation: Framework ready for specialized migration analysis like schema assessment and access pattern analysis
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change? No
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.