Mysql MCP Server

Add `--scope project` after `mcp add` to keep the registration in the current workspace. See [Autohand Code](https://github.com/autohandai/code-cli/)

Remote serverstreamable-httpPython

What is the Mysql MCP Server?

Add --scope project after mcp add to keep the registration in the current workspace. See Autohand Code for current CLI details.

Key capabilities

  • List available MySQL tables as resources
  • Read table contents
  • Execute SQL queries with proper error handling
  • Multi-database mode — (Optional MYSQL_DATABASE)
  • SSE/HTTP transport support — (MCP_TRANSPORT=sse)
  • SSH Tunneling support —
  • Comprehensive schema information —
  • Table data sampling —

Practical notes

  • Maintained by designcomputer, written in Python.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
execute_sql
get_schema_info
get_table_sample

How to install the Mysql MCP Server

{
  "mcpServers": {
    "mysql": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/mysql_mcp_server",
        "run",
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "YOUR_MYSQL_PASSWORD",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
MYSQL_HOSTDeclared in the maintainer’s client configuration.Check documentation
MYSQL_PORTDeclared in the maintainer’s client configuration.Optional
MYSQL_USERDeclared in the maintainer’s client configuration.Check documentation
MYSQL_PASSWORDDeclared in the maintainer’s client configuration.Check documentation
MYSQL_DATABASEDeclared in the maintainer’s client configuration.Optional

Example prompts to try

  • “Use Mysql to execute sql.”
  • “Use Mysql to get schema info.”
  • “Use Mysql to get table sample.”

Frequently asked questions

Add `--scope project` after `mcp add` to keep the registration in the current workspace. See [Autohand Code](https://github.com/autohandai/code-cli/) for current Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.