MySQL for VS Code
io.github.burakdirin/mysqldb-mcp-server
Query MySQL databases from AI assistants, read-only by default with opt-in writes.
client:VS Code
transport:stdio
runtime:pypi
Install MySQL in VS Code
.vscode/mcp.json
{
"inputs": [
{
"type": "promptString",
"id": "mysql-host",
"description": "MYSQL_HOST",
"password": true
},
{
"type": "promptString",
"id": "mysql-port",
"description": "MYSQL_PORT",
"password": true
},
{
"type": "promptString",
"id": "mysql-user",
"description": "MYSQL_USER",
"password": true
},
{
"type": "promptString",
"id": "mysql-password",
"description": "MYSQL_PASSWORD",
"password": true
},
{
"type": "promptString",
"id": "mysql-database",
"description": "MYSQL_DATABASE",
"password": true
},
{
"type": "promptString",
"id": "mysql-ssl-mode",
"description": "MYSQL_SSL_MODE",
"password": true
},
{
"type": "promptString",
"id": "mysql-ssl-ca",
"description": "MYSQL_SSL_CA",
"password": true
},
{
"type": "promptString",
"id": "mysql-allow-write",
"description": "MYSQL_ALLOW_WRITE",
"password": true
},
{
"type": "promptString",
"id": "mysql-query-timeout",
"description": "MYSQL_QUERY_TIMEOUT",
"password": true
},
{
"type": "promptString",
"id": "mysql-max-rows",
"description": "MYSQL_MAX_ROWS",
"password": true
}
],
"servers": {
"mysqldb-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"mysqldb-mcp-server"
],
"env": {
"MYSQL_HOST": "${input:mysql-host}",
"MYSQL_PORT": "${input:mysql-port}",
"MYSQL_USER": "${input:mysql-user}",
"MYSQL_PASSWORD": "${input:mysql-password}",
"MYSQL_DATABASE": "${input:mysql-database}",
"MYSQL_SSL_MODE": "${input:mysql-ssl-mode}",
"MYSQL_SSL_CA": "${input:mysql-ssl-ca}",
"MYSQL_ALLOW_WRITE": "${input:mysql-allow-write}",
"MYSQL_QUERY_TIMEOUT": "${input:mysql-query-timeout}",
"MYSQL_MAX_ROWS": "${input:mysql-max-rows}"
}
}
}
}
VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs