Data as of
MySQL MCP Server for VS Code: Setup & Config
VS Code: Expose MySQL schema inspection, data samples, and SQL execution to MCP assistants.
What you can do with MySQL in VS Code
Choose it for focused MySQL exploration with schemas, bounded samples, and explicit SQL access.
- Explore an unfamiliar database's tables and column types.
- Query multiple databases using qualified table names.
Before you start: MySQL in VS Code
- uv for the documented uvx launch
- An accessible MySQL instance
- MySQL credentials with the required permissions
- An MCP-compatible client
This is the README's VS Code stdio launch. Put database values in the client's env block rather than assuming the project's .env will be discovered. Network SSE deployments require an authentication proxy outside localhost.
MySQL VS Code configuration
Choose VS Code configuration scope
For MySQL MCP Server, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.
Add MySQL MCP Server to VS Code
Use the mysql_mcp_server entry below in servers. Keep MySQL MCP Server's documented stdio connection fields and your other VS Code entries.
Check MySQL MCP Server in VS Code
MySQL MCP Server: Start in VS Code’s MCP controls; inspect output and trust prompts.
Config file · Workspace: .vscode/mcp.json
{
"servers": {
"mysql_mcp_server": {
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"mysql-mcp-server",
"mysql_mcp_server"
],
"env": {
"MYSQL_HOST": "<MySQL hostname>",
"MYSQL_PORT": "<MySQL port, default 3306>",
"MYSQL_USER": "<dedicated least-privilege MySQL username>",
"MYSQL_PASSWORD": "<MySQL account password>",
"MYSQL_DATABASE": "<optional default database; omit for multi-database mode>"
}
}
}
}MySQL tools available to VS Code
MySQL's stored tool list documents 3 tools; compare it with VS Code's connected tool list, because the stored list is not a live check.
- execute_sql
Look for execute_sql among VS Code's agent-mode tools after starting MySQL through the MCP controls.
- get_schema_info
Look for get_schema_info among VS Code's agent-mode tools after starting MySQL through the MCP controls.
Inspect columns, types, defaults, nullability, and comments for database tables.
- get_table_sample
Look for get_table_sample among VS Code's agent-mode tools after starting MySQL through the MCP controls.
Read a table sample capped at 20 rows, including cross-database targets.
Troubleshooting MySQL in VS Code
- Make uvx --from (from uv, for Python tools) available in the workspace, container, or remote environment hosting MySQL MCP Server. Start through VS Code's MCP controls; inspect output and trust prompts.
- For MySQL MCP Server, keep MYSQL_DATABASE, MYSQL_HOST, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_USER out of version control; VS Code documents input variables and secret handling.
- MySQL MCP Server uses stdio here: VS Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: SQL execution includes writes when database permissions allow them.
- Known limitation: Only single-statement SQL calls are supported.
- Known limitation: SSE mode needs external authentication when exposed beyond localhost.
- General VS Code troubleshooting lives in the /clients/vscode guide.
MySQL MCP Server — details. VS Code guide