A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mysql": {
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your_username",
"MYSQL_DATABASE": "your_database",
"MYSQL_PASSWORD": "your_password"
},
"args": [
"--directory",
"path/to/mysql_mcp_server",
"run",
"mysql_mcp_server"
],
"command": "uv"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) implementation that enables secure interaction with MySQL databases. This server component facilitates communication between AI applications (hosts/clients) and MySQL databases, making database exploration and analysis safer and more structured through a controlled interface.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y '@smithery/cli' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked @smithery/cli against OSV.dev.
Click any tool to inspect its schema.
mysql_tablesList available MySQL tables as resources
mysql://tables
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in data
Query and manage PostgreSQL databases directly from AI assistants
Manage Supabase projects — databases, auth, storage, and edge functions
Zero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
MCP Security Weekly
Get CVE alerts and security updates for Mysql_mcp_server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) implementation that enables secure interaction with MySQL databases. This server component facilitates communication between AI applications (hosts/clients) and MySQL databases, making database exploration and analysis safer and more structured through a controlled interface.
Note: MySQL MCP Server supports both standard input/output (STDIO) and Streamable HTTP (SSE) transport modes. The SSE mode is recommended for remote/self-hosted deployments.
MYSQL_DATABASE)MCP_TRANSPORT=sse)pip install mysql-mcp-server
To install MySQL MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install designcomputer/mysql-mcp-server --client claude
claude mcp add --transport stdio designcomputer-mysql_mcp_server uvx mysql_mcp_server
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 # Optional: Omit for multi-database mode
# Advanced Configuration
MYSQL_SSL_MODE=DISABLED # DISABLED, REQUIRED, VERIFY_CA, VERIFY_IDENTITY
MYSQL_CONNECT_TIMEOUT=10 # Timeout in seconds
# Connection behaviour (Optional)
MYSQL_SQL_MODE=TRADITIONAL # SQL mode applied to the connection (default: TRADITIONAL)
# Compatibility (Optional)
MYSQL_CHARSET=utf8mb4
MYSQL_COLLATION=utf8mb4_unicode_ci
MYSQL_AUTH_PLUGIN= # e.g., mysql_native_password for older MySQL versions
MYSQL_USE_PURE=false # Force the pure-Python connector (default: false)
MYSQL_RAISE_ON_WARNINGS=false # Raise on SQL warnings (default: false)
# SSE Transport (Optional)
MCP_TRANSPORT=stdio # stdio or sse
MCP_SSE_HOST=0.0.0.0 # Listen on all interfaces (required for Docker/hosting)
PORT=8000 # HTTP port (fallback for MCP_SSE_PORT)
MCP_SSE_ALLOWED_HOSTS= # Comma-separated allowed Host headers (default: localhost:{port},127.0.0.1:{port})
# SSH Tunneling (Optional)
MYSQL_SSH_ENABLE=false # Set to true to enable
MYSQL_SSH_HOST= # SSH jump host
MYSQL_SSH_PORT=22 # SSH port
MYSQL_SSH_USER= # SSH username
MYSQL_SSH_KEY_PATH= # Path to SSH private key
MYSQL_SSH_REMOTE_HOST=localhost # Host from the perspective of the jump host
MYSQL_SSH_REMOTE_PORT=3306
MYSQL_LOCAL_PORT=3330
.env file loadingOn startup the server automatically loads a .env file via python-dotenv, so for local use you can simply:
cp .env.example .env # then edit with your credentials
The file is read from the process working directory (and parent directories), which wo