Mysqldb MCP Server

The server provides two tools: - `connect_database`: Connects to a specific MySQL database - `database` parameter: Name of the database to connect to

Local serverstdio

What is the Mysqldb MCP server?

If you already use Mysqldb, the mysqldb mcp server is the piece that lets your assistant work with it directly. The server provides two tools: - connect_database: Connects to a specific MySQL database - database parameter: Name of the database to connect to (string) - Returns a confirmation message when connection is successful.

Installation

The server ships on npm as @smithery/cli, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • connect_database — Connects to a specific MySQL database
  • execute_query — Executes MySQL queries
  • Tools — The server provides two tools: - connect_database: Connects to a specific MySQL database - database parameter: Name of the database to connect to
  • Installation — The Installation tool exposed by this server
  • Debugging — Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the [MCP

Credentials and setup notes

Configuration is passed through the environment: MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_READONLY, UV_PUBLISH_TOKEN. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Where it fits

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Mysqldb's toolset — connect_database, execute_query, Tools and 2 more — is a fair guide to whether it matches your workflow. It is maintained by burakdirin; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Mysqldb's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
connect_databaseConnects to a specific MySQL database
execute_queryExecutes MySQL queries
ToolsThe server provides two tools: - connect_database: Connects to a specific MySQL database - database parameter: Name of the database to connect to (string) - Returns a confirmation message when connection is successful
InstallationThe Installation tool exposed by this server.
DebuggingSince MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).

How to install the Mysqldb MCP server

{
  "mcpServers": {
    "mysqldb-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/burakdirin/Projects/mysqldb-mcp-server",
        "run",
        "mysqldb-mcp-server"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "password",
        "MYSQL_DATABASE": "[optional]",
        "MYSQL_READONLY": "true"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
MYSQL_HOSTEndpoint or connection string the server talks to.Optional
MYSQL_USERConfiguration value read at startup.Optional
MYSQL_PASSWORDConfiguration value read at startup.Optional
MYSQL_DATABASEConfiguration value read at startup.Optional
MYSQL_READONLYConfiguration value read at startup.Optional
UV_PUBLISH_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • Use Mysqldb to connect database.
  • Use Mysqldb to execute query.
  • Use Mysqldb to Tools.

Frequently asked questions

It connects Mysqldb to MCP-compatible AI assistants such as Claude and Cursor, exposing 5 tools (connect_database, execute_query, Tools, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Mysqldb directly.