Add MySQL support to MCP Database Server

Updated package.json and package-lock.json to include MySQL dependencies. Enhanced README with MySQL usage instructions and configuration details. Modified index.ts to handle MySQL connection parameters and logging. Added MysqlAdapter for database interactions.
This commit is contained in:
Karthik KK
2025-05-31 07:50:39 +12:00
parent 67cb325f88
commit b6a8182538
6 changed files with 324 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
# MCP Database Server
This MCP (Model Context Protocol) server provides database access capabilities to Claude, supporting SQLite, SQL Server, and PostgreSQL databases.
This MCP (Model Context Protocol) server provides database access capabilities to Claude, supporting SQLite, SQL Server, PostgreSQL, and MySQL databases.
## Installation
@@ -92,6 +92,25 @@ Optional parameters:
- `--ssl`: Enable SSL connection (true/false)
- `--connection-timeout`: Connection timeout in milliseconds (default: 30000)
### MySQL Database
To use with a MySQL database:
```
node dist/src/index.js --mysql --host <host-name> --database <database-name> [--user <username> --password <password>]
```
Required parameters:
- `--host`: MySQL host name or IP address
- `--database`: Name of the database
Optional parameters:
- `--user`: Username for MySQL authentication
- `--password`: Password for MySQL authentication
- `--port`: Port number (default: 3306)
- `--ssl`: Enable SSL connection (true/false or object)
- `--connection-timeout`: Connection timeout in milliseconds (default: 30000)
## Configuring Claude Desktop
### Direct Usage Configuration
@@ -132,6 +151,18 @@ If you installed the package globally, configure Claude Desktop with:
"--user", "your-username",
"--password", "your-password"
]
},
"mysql": {
"command": "npx",
"args": [
"-y",
"@executeautomation/database-server",
"--mysql",
"--host", "your-host-name",
"--database", "your-database-name",
"--user", "your-username",
"--password", "your-password"
]
}
}
}
@@ -172,6 +203,17 @@ For local development, configure Claude Desktop to use your locally built versio
"--user", "your-username",
"--password", "your-password"
]
},
"mysql": {
"command": "node",
"args": [
"/absolute/path/to/mcp-database-server/dist/src/index.js",
"--mysql",
"--host", "your-host-name",
"--database", "your-database-name",
"--user", "your-username",
"--password", "your-password"
]
}
}
}