Data as of
MCP Server for MySQL for VS Code: Setup & Config
VS Code: MCP Server for MySQL lets Claude and other AI clients inspect schemas and execute SQL.
What you can do with MCP Server for MySQL in VS Code
Use it for SQL and schema access with read-only defaults and explicit controls for database writes.
- Inspect table and column metadata from an AI client.
- Enable selected data modifications through explicit operation flags.
Before you start: MCP Server for MySQL in VS Code
- Node.js 20 or newer
- MySQL 5.7 or newer; 8.0 or newer recommended
- A MySQL account with suitable privileges
- An MCP-compatible client
The local quick-start remains read-only unless write flags are enabled. ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, and ALLOW_DELETE_OPERATION opt into the corresponding writes. HTTP remote mode is listed but its setup is delegated to other documentation.
MCP Server for MySQL VS Code configuration
Choose VS Code configuration scope
For MCP Server for MySQL, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.
Add MCP Server for MySQL to VS Code
Use the mcp-server-mysql entry below in servers. Keep MCP Server for MySQL's documented stdio connection fields and your other VS Code entries.
Check MCP Server for MySQL in VS Code
MCP Server for MySQL: Start in VS Code’s MCP controls; inspect output and trust prompts.
Config file · Workspace: .vscode/mcp.json
{
"servers": {
"mcp-server-mysql": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "<MySQL server hostname or address>",
"MYSQL_PORT": "<MySQL server port>",
"MYSQL_USER": "<MySQL username with appropriate privileges>",
"MYSQL_PASS": "<MySQL user password>",
"MYSQL_DB": "<Target database name>"
}
}
}
}MCP Server for MySQL tools available to VS Code
MCP Server for MySQL's stored tool list documents 1 tool; compare it with VS Code's connected tool list, because the stored list is not a live check.
- mysql_query
Look for mysql_query among VS Code's agent-mode tools after starting MCP Server for MySQL through the MCP controls.
Execute SQL with read-only defaults and individually enabled write operations.
Troubleshooting MCP Server for MySQL in VS Code
- Make npx @benborla29/mcp-server-mysql (Node.js/npm) available in the workspace, container, or remote environment hosting MCP Server for MySQL. Start through VS Code's MCP controls; inspect output and trust prompts.
- For MCP Server for MySQL, keep MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_PORT, MYSQL_USER out of version control; VS Code documents input variables and secret handling.
- MCP Server for MySQL uses stdio here: VS Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Requires Node.js 20 or newer and MySQL 5.7 or newer.
- Known limitation: Advanced remote-mode and redaction configuration are delegated to separate documentation.
- General VS Code troubleshooting lives in the /clients/vscode guide.
MCP Server for MySQL — details. VS Code guide