Data as of

MySQL MCP Server for Windsurf: Setup & Config

Windsurf: Expose MySQL schema inspection, data samples, and SQL execution to MCP assistants.

What you can do with MySQL in Windsurf

Choose it for focused MySQL exploration with schemas, bounded samples, and explicit SQL access.

  • Preview representative rows before writing analysis queries.
  • Reach a MySQL instance through a configured SSH tunnel.

Before you start: MySQL in Windsurf

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

  1. Choose Windsurf configuration scope

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

  2. Add MySQL MCP Server to Windsurf

    Use the mysql_mcp_server entry below in mcpServers. Keep MySQL MCP Server's documented stdio connection fields and your other Windsurf entries.

  3. Check MySQL MCP Server in Windsurf

    MySQL MCP Server: 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": {
    "mysql_mcp_server": {
      "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 Windsurf

MySQL's stored tool list documents 3 tools; compare it with Windsurf's connected tool list, because the stored list is not a live check.

execute_sql

After refreshing MySQL in Windsurf settings, check Cascade's tool list for execute_sql.

Run one SQL statement, including reads and permitted data-modification operations.

get_schema_info

After refreshing MySQL in Windsurf settings, check Cascade's tool list for get_schema_info.

Inspect columns, types, defaults, nullability, and comments for database tables.

get_table_sample

After refreshing MySQL in Windsurf settings, check Cascade's tool list for get_table_sample.

MySQL: full stored tool descriptions

Troubleshooting MySQL in Windsurf

  • Check uvx --from (from uv, for Python tools) on the machine running Windsurf's MCP integration for MySQL MCP Server; refresh MCP and inspect Cascade's tools.
  • Check MYSQL_DATABASE, MYSQL_HOST, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_USER for MySQL MCP Server; do not bypass a Windsurf permission error with a broad administrator token.
  • MySQL MCP Server uses stdio here: Windsurf 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 Windsurf troubleshooting lives in the /clients/windsurf guide.

MySQL MCP Server — details. Windsurf guide

Frequently asked questions

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

Windsurf's mysql_mcp_server example uses stdio.

MySQL MCP Server's Windsurf configuration invokes uvx --from (from uv, for Python tools).

Windsurf's MySQL MCP Server example references MYSQL_DATABASE, MYSQL_HOST, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_USER. Check these names if startup or authentication fails; the example alone does not distinguish required from optional values.

MySQL MCP Server's stored list contains 3 tools, including execute_sql, get_schema_info, get_table_sample. Compare those names with Windsurf's connected tool list; the stored list is not a live check.

The server enters multi-database mode and lists user databases. Queries can target database.table names.

Clients can launch the process from a different directory. The README recommends putting MYSQL_* settings directly in the MCP environment configuration.