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

  1. Choose VS Code configuration scope

    For MCP Server for MySQL, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.

  2. 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.

  3. 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

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.

MCP Server for MySQL: full stored tool descriptions

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

Frequently asked questions

For MCP Server for MySQL, edit workspace .vscode/mcp.json. VS Code requires servers rather than mcpServers; preserve the displayed type on each entry.

VS Code's mcp-server-mysql example uses stdio.

MCP Server for MySQL's VS Code configuration invokes npx @benborla29/mcp-server-mysql (Node.js/npm).

VS Code's MCP Server for MySQL example references MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_PORT, MYSQL_USER. Check these names if startup or authentication fails; the example alone does not distinguish required from optional values.

MCP Server for MySQL's stored list contains 1 tool, including mysql_query. Compare those names with VS Code's connected tool list; the stored list is not a live check.

No. Insert, update, and delete operations are disabled unless their respective environment flags are enabled.

Yes. SSH tunneling is listed, and a separate HTTP remote mode with bearer authentication is also described.