MySQL MCP Server
About
 [](https://smithery.ai/server/mysql-mcp-server) # MySQL MCP Server A Model Context Protocol (MCP) implementation that enables secure interaction with MySQL…
Details
- License
- MIT license
Explore
- List available MySQL tables as resources
- Read table contents
- Execute SQL queries with proper error handling
- Secure database access through environment variables
- Comprehensive logging
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MySQL MCP ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Set the following environment variables:
MYSQL_HOST=localhost # Database host
MYSQL_PORT=3306 # Optional: Database port (defaults to 3306 if not specified)
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
pip install mysql-mcp-server
To install MySQL MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mysql-mcp-server --client claude
pip install -r requirements.txt
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements-dev.txt
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mysql mcp server": {
"MCP-Server-with-Claude-Ai": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mysql-mcp-server",
"--client",
"claude"
]
}
}
}
}
McpServers
{
"MCP-Server-with-Claude-Ai": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"mysql-mcp-server",
"--client",
"claude"
]
}
}
> Note: MySQL MCP Server is not designed to be used as a standalone server, but rather as a communication protocol implementation between AI applications and MySQL databases.
Features
- List available MySQL tables as resources - Read table contents - Execute SQL queries with proper error handling - Secure database access through environment variables - Comprehensive loggingInstallation
Manual Installation
pip install mysql-mcp-server
Installing via Smithery
To install MySQL MCP Server for Claude Desktop automatically via Smithery:npx -y @smithery/cli install mysql-mcp-server --client claude
Configuration
Set the following environment variables:MYSQL_HOST=localhost # Database host
MYSQL_PORT=3306 # Optional: Database port (defaults to 3306 if not specified)
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
Usage
With Claude Desktop
Add this to yourclaude_desktop_config.json:
{
"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_password",
"MYSQL_DATABASE": "your_database"
}
}
}
}
Debugging with MCP Inspector
While MySQL MCP Server isn't intended to be run standalone or directly from the command line with Python, you can use the MCP Inspector to debug it.The MCP Inspector provides a convenient way to test and debug your MCP implementation:
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



