MySQL DB is an MCP server that provides tools for interacting with and querying relational MySQL databases directly from AI assistants. Built for software engineers, database administrators, and data analysts, it allows users to connect to local or remote database instances and execute standard SQL commands using conversational interfaces. The server exposes dedicated operations to switch target databases and execute single or multiple semicolon-delimited queries, returning results in JSON format for the model to parse. It includes configurable environment variables for database credentials, server host addresses, and initial database selection. Additionally, the server supports an optional read-only mode to prevent accidental data modifications or destructive statements during testing and analysis sessions. By integrating into standard Model Context Protocol setups, it enables LLMs to inspect schemas, run reports, verify table structures, and retrieve records without switching context to external database management clients.
Category: Databases & Data Stores
Tags: database, mysql, relational, SQL
To install and configure the server for Claude Desktop, follow these steps: 1. Install the package via uv or pip: bash uv pip install mysqldb-mcp-server Alternatively, install it via Smithery: bash npx -y @smithery/cli install @burakdirin/mysqldb-mcp-server --client claude 2. Open your Claude Desktop configuration file (claude_desktop_config.json) and add the server configuration using uvx: json { "mcpServers": { "mysqldb-mcp-server": { "command": "uvx", "args": ["mysqldb-mcp-server"], "env": { "MYSQL_HOST": "localhost", "MYSQL_USER": "root", "MYSQL_PASSWORD": "password", "MYSQL_DATABASE": "your_database", "MYSQL_READONLY": "true" } } } } 3. Restart Claude Desktop to apply the configuration.
Part of MCP Servers
You can install it using uv pip install mysqldb-mcp-server or standard pip install mysqldb-mcp-server. It can also be added automatically to Claude Desktop using the Smithery CLI with the command npx -y @smithery/cli install @burakdirin/mysqldb-mcp-server --client claude.
The server provides two core tools: connect_database, which establishes a connection to a specific database by name, and execute_query, which runs single or multiple semicolon-separated SQL statements and returns the resulting records in JSON format.
Yes. You can enforce read-only execution by setting the environment variable MYSQL_READONLY to true or 1 in your MCP configuration file. This prevents unwanted data mutations during query execution.
It is designed to work with any standard Model Context Protocol client that supports stdio transport, including Claude Desktop on macOS and Windows, as well as debugging utilities like the MCP Inspector.