MySQL
Databases Key required
GitHub stars73
Forks11
LicenseMIT
Last activitySep 22, 2026
Open issues3
Repository: dpflucas/mysql-mcp-server · Data checked Oct 2026
About
Let your agent run read-only queries on your MySQL database.
Details
npx -y mysql-mcp-serverChecked by plugmyagent · Sep 19, 2026
PlugMyAgent ScorecardChecked Oct 2026
Handle with care
Actively maintained, a small community, real setup work.
MaintenanceStrong
Last commit Sep 22, 2026.
Community adoptionWeak
73 GitHub stars. Niche or newer; weigh the other rows.
Setup effortWeak
Needs MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_PORT, MYSQL_USER.
LicenseStrong
Open license: MIT.
Listing freshnessStrong
Checked by plugmyagent on Sep 19, 2026.
Rules: Methodology · Scores are never sold or adjusted for anyone.
Config for your agent
Pick your agent and copy the block into its MCP config file. The setup guide shows where that file lives for each agent.
{
"mcpServers": {
"mysql": {
"args": [
"-y",
"mysql-mcp-server"
],
"command": "npx",
"env": {
"MYSQL_DB": "your-database",
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PASS": "your-password",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root"
}
}
}
}{
"mcpServers": {
"mysql": {
"args": [
"-y",
"mysql-mcp-server"
],
"command": "npx",
"env": {
"MYSQL_DB": "your-database",
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PASS": "your-password",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root"
}
}
}
}[mcp_servers.mysql]
command = "npx"
args = ["-y", "mysql-mcp-server"]
env = { MYSQL_DB = "your-database", MYSQL_HOST = "127.0.0.1", MYSQL_PASS = "your-password", MYSQL_PORT = "3306", MYSQL_USER = "root" }{
"mcpServers": {
"mysql": {
"args": [
"-y",
"mysql-mcp-server"
],
"command": "npx",
"env": {
"MYSQL_DB": "your-database",
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PASS": "your-password",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root"
}
}
}
}{
"mcpServers": {
"mysql": {
"args": [
"-y",
"mysql-mcp-server"
],
"command": "npx",
"env": {
"MYSQL_DB": "your-database",
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PASS": "your-password",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root"
}
}
}
}{
"mcpServers": {
"mysql": {
"args": [
"-y",
"mysql-mcp-server"
],
"command": "npx",
"env": {
"MYSQL_DB": "your-database",
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PASS": "your-password",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root"
}
}
}
}[mcp_servers.mysql]
command = "npx"
args = ["-y", "mysql-mcp-server"]
env = { MYSQL_DB = "your-database", MYSQL_HOST = "127.0.0.1", MYSQL_PASS = "your-password", MYSQL_PORT = "3306", MYSQL_USER = "root" }{
"servers": {
"mysql": {
"args": [
"-y",
"mysql-mcp-server"
],
"command": "npx",
"env": {
"MYSQL_DB": "your-database",
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PASS": "your-password",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root"
}
}
}
}How to use it
- Copy the config block above for your agent.
- Paste it into your agent's MCP config file.
- Restart your agent so it picks up the new server.
- Ask your agent to use it.
Before you install
- Is it free?
- Yes. MySQL is open source under the MIT license and free to run. It needs an API key from the provider; a free account or free tier covers normal use.
- What do I need first?
- Node.js 18 or newer (which provides npx); values for MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_PORT, MYSQL_USER (they go in the env block of the config).
If it does not show up
- Fully quit and relaunch your agent app after editing the config. Closing the window is not always enough for desktop apps.
- Check the JSON is valid: one trailing comma breaks the whole file. Our MCP Config Validator checks it in your browser.
- If the log says "npx: command not found", the runtime above is missing or the app cannot see your PATH. Install it, then relaunch the app.
- If the server starts but every call fails, a credential is usually wrong or expired: MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_PORT, MYSQL_USER.