Skip to content

Conversation

kishorln
Copy link

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.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Is this a breaking change? No

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

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.

Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 72.97297% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.21%. Comparing base (74082b0) to head (448a8f1).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...b-mcp-server/awslabs/dynamodb_mcp_server/server.py 72.22% 7 Missing and 3 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.
Copy link

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.

Copy link
Contributor

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.

Copy link
Author

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
Copy link

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?

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Author

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'}]
Copy link

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?

Copy link
Author

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)}'}]
Copy link

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

Comment on lines +108 to +113
"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"
Copy link
Contributor

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.

Copy link
Author

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

Comment on lines +64 to +65
MySQL Integration: This server also includes MySQL query capabilities through the run_query tool, enabling database
analysis and migration planning from MySQL to DynamoDB.
Copy link
Contributor

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",
Copy link
Contributor

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.

Copy link
Author

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.
Copy link
Contributor

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
Copy link
Contributor

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",,
Copy link
Contributor

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?

Copy link
Author

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",
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To triage
Development

Successfully merging this pull request may close these issues.

5 participants