Data as of

MCP Server for MySQL for Windsurf: Setup & Config

Windsurf: 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 Windsurf

Use it for SQL and schema access with read-only defaults and explicit controls for database writes.

  • Run read-only SQL for database exploration.
  • Query multiple databases or reach a remote database through SSH.

Before you start: MCP Server for MySQL in Windsurf

  • 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 Windsurf configuration

  1. Choose Windsurf configuration scope

    For MCP Server for MySQL, open macOS/Linux: ~/.codeium/windsurf/mcp_config.json Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json. Merge into mcpServers; remote endpoints use serverUrl.

  2. Add MCP Server for MySQL to Windsurf

    Use the mcp-server-mysql entry below in mcpServers. Keep MCP Server for MySQL's documented stdio connection fields and your other Windsurf entries.

  3. Check MCP Server for MySQL in Windsurf

    MCP Server for MySQL: Refresh MCP in Windsurf settings and inspect Cascade’s tools.

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

JSON
{
  "mcpServers": {
    "mcp-server-mysql": {
      "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 Windsurf

MCP Server for MySQL's stored tool list documents 1 tool; compare it with Windsurf's connected tool list, because the stored list is not a live check.

mysql_query

After refreshing MCP Server for MySQL in Windsurf settings, check Cascade's tool list for mysql_query.

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 Windsurf

  • Check npx @benborla29/mcp-server-mysql (Node.js/npm) on the machine running Windsurf's MCP integration for MCP Server for MySQL; refresh MCP and inspect Cascade's tools.
  • Check MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_PORT, MYSQL_USER for MCP Server for MySQL; do not bypass a Windsurf permission error with a broad administrator token.
  • MCP Server for MySQL uses stdio here: Windsurf 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 Windsurf troubleshooting lives in the /clients/windsurf guide.

MCP Server for MySQL — details. Windsurf guide

Frequently asked questions

Windsurf reads MCP Server for MySQL under mcpServers in ~/.codeium/windsurf/mcp_config.json on macOS/Linux; Windows uses %USERPROFILE%\.codeium\windsurf\mcp_config.json.

Windsurf's mcp-server-mysql example uses stdio.

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

Windsurf'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 Windsurf's connected tool list; the stored list is not a live check.

The mysql://tables resource exposes tables and column metadata for the connected database.

The README requires MySQL 5.7 or higher and recommends 8.0 or higher, alongside Node.js 20 or higher.