mirror of
https://github.com/executeautomation/mcp-database-server.git
synced 2025-12-09 21:12:57 +08:00
feat: Add AWS IAM authentication support for MySQL
- Add @aws-sdk/rds-signer dependency for RDS auth token generation - Extend CLI arguments with --aws-iam-auth and --aws-region options - Implement automatic AWS RDS auth token generation in MySQL adapter - Auto-enable SSL for AWS IAM authentication (required by RDS) - Add comprehensive error handling for AWS credential issues - Update documentation with AWS IAM authentication examples - Maintain backward compatibility with existing authentication methods Resolves the need for secure AWS RDS connections without hardcoded passwords.
This commit is contained in:
@@ -75,18 +75,29 @@ node dist/src/index.js --postgresql --host dbserver.example.com --database sampl
|
||||
| `--mysql` | Specifies MySQL mode | - | Yes |
|
||||
| `--host` | MySQL hostname or IP | - | Yes |
|
||||
| `--database` | Database name | - | Yes |
|
||||
| `--user` | MySQL username | - | No |
|
||||
| `--password` | MySQL password | - | No |
|
||||
| `--user` | MySQL username | - | No* |
|
||||
| `--password` | MySQL password | - | No* |
|
||||
| `--port` | MySQL port | 3306 | No |
|
||||
| `--ssl` | Use SSL connection (true/false or object) | false | No |
|
||||
| `--connection-timeout` | Connection timeout in ms | 30000 | No |
|
||||
| `--aws-iam-auth` | Enable AWS IAM authentication | false | No |
|
||||
| `--aws-region` | AWS region for RDS IAM auth | - | No** |
|
||||
|
||||
### Example
|
||||
*Required for standard authentication
|
||||
**Required when using `--aws-iam-auth`
|
||||
|
||||
### Standard Authentication Example
|
||||
|
||||
```bash
|
||||
node dist/src/index.js --mysql --host localhost --database sample_db --port 3306 --user root --password secret
|
||||
```
|
||||
|
||||
### AWS IAM Authentication Example
|
||||
|
||||
```bash
|
||||
node dist/src/index.js --mysql --aws-iam-auth --host rds-endpoint.region.rds.amazonaws.com --database sample_db --user aws-username --aws-region us-east-1
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Instead of specifying sensitive credentials on the command line, you can use environment variables:
|
||||
|
||||
Reference in New Issue
Block a user