Data as of

MySQL MCP Server for Claude Desktop: Setup & Config

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

What you can do with MySQL in Claude Desktop

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

  • Explore an unfamiliar database's tables and column types.
  • Preview representative rows before writing analysis queries.

Before you start: MySQL in Claude Desktop

  • 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 Claude Desktop configuration

  1. Choose Claude Desktop configuration scope

    For MySQL MCP Server, open macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json. Merge under mcpServers via Settings → Developer → Edit Config when available.

  2. Add MySQL MCP Server to Claude Desktop

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

  3. Check MySQL MCP Server in Claude Desktop

    MySQL MCP Server: Fully quit and reopen Claude Desktop; check developer diagnostics.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_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 Claude Desktop

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

execute_sql

When Claude Desktop requests execute_sql from MySQL, review the action before approving it.

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

get_schema_info

When Claude Desktop requests get_schema_info from MySQL, review the action before approving it.

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

get_table_sample

When Claude Desktop requests get_table_sample from MySQL, review the action before approving it.

MySQL: full stored tool descriptions

Troubleshooting MySQL in Claude Desktop

  • Fully quit and reopen Claude Desktop for MySQL MCP Server. If uvx --from (from uv, for Python tools) is missing, check the desktop process's PATH, which may differ from your terminal.
  • In Claude Desktop's MySQL MCP Server entry, check MYSQL_DATABASE, MYSQL_HOST, MYSQL_PASSWORD, MYSQL_PORT, MYSQL_USER. Keep secrets out of shared screenshots and repositories.
  • MySQL MCP Server uses stdio here: Claude Desktop 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 Claude Desktop troubleshooting lives in the /clients/claude-desktop guide.

MySQL MCP Server — details. Claude Desktop guide

Frequently asked questions

Claude Desktop loads MySQL MCP Server from claude_desktop_config.json: ~/Library/Application Support/Claude/ on macOS, or %APPDATA%\Claude\ on Windows. Open it via Settings → Developer → Edit Config when available.

Claude Desktop's mysql_mcp_server example uses stdio.

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

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

No. execute_sql supports SELECT and inspection statements as well as INSERT, UPDATE, and DELETE, subject to the database user's permissions.

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