MySQL MCP Server
by gistrecio.github.gistrec/mcp-mysql-clientv1.0.0
MCP server for one MySQL database: schema, read-only queries and guarded writes.
context tax
queued
security
queued
cold start
queued
freshness
Maintained48d ago
Install MySQL MCP server
Install in Claude Code
claude mcp add mysql-client -e MYSQL_USER='<mysql-user>' -e MYSQL_PASS='<mysql-pass>' -e MYSQL_DB='<mysql-db>' -- npx -y mcp-mysql-clientInstall in Cursor
{
"mcpServers": {
"mysql-client": {
"command": "npx",
"args": [
"-y",
"mcp-mysql-client"
],
"env": {
"MYSQL_USER": "<mysql-user>",
"MYSQL_PASS": "<mysql-pass>",
"MYSQL_DB": "<mysql-db>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"mysql-client": {
"command": "npx",
"args": [
"-y",
"mcp-mysql-client"
],
"env": {
"MYSQL_USER": "<mysql-user>",
"MYSQL_PASS": "<mysql-pass>",
"MYSQL_DB": "<mysql-db>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"mysql-client": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-mysql-client"
],
"env": {
"MYSQL_USER": "<mysql-user>",
"MYSQL_PASS": "<mysql-pass>",
"MYSQL_DB": "<mysql-db>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"mysql-client": {
"command": "npx",
"args": [
"-y",
"mcp-mysql-client"
],
"env": {
"MYSQL_USER": "<mysql-user>",
"MYSQL_PASS": "<mysql-pass>",
"MYSQL_DB": "<mysql-db>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| MYSQL_HOST | — | — | Database host. |
| MYSQL_PORT | — | — | Database port. |
| MYSQL_USER | yes | — | MySQL user. Use one with the least privileges the task needs, never root. |
| MYSQL_PASS | — | yes | Password for that user. Treat it as a secret; MYSQL_PASS_FILE reads it from a file instead. |
| MYSQL_DB | yes | — | The one database this server is bound to. No tool can leave it. |
| MYSQL_SSL | — | — | Require a TLS connection to the server. |
| MYSQL_SSL_CA | — | — | Path to the CA bundle verifying the server certificate; implies MYSQL_SSL. |
| ALLOW_INSERT_OPERATION | — | — | Allow INSERT statements through the execute tool. |
| ALLOW_UPDATE_OPERATION | — | — | Allow UPDATE statements through the execute tool. |
| ALLOW_DELETE_OPERATION | — | — | Allow DELETE statements through the execute tool. |
| MYSQL_MAX_ROWS | — | — | Row cap for one read; the result is marked truncated when it is hit. |
| MYSQL_TIMEOUT_MS | — | — | Statement timeout in milliseconds; the connection is dropped on expiry. |
Freshness
Maintained — last maintenance signal 48d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-08-22 · 48d ago · GitHub
Latest release
2026-08-23 · 48d ago · GitHub · v1.0.0
Package published
no data · npm/PyPI
Registry entry updated
2026-08-23 · 48d ago · official registry · v1.0.0
FAQ
›How do I install the MySQL MCP server in Claude Code?
Run: claude mcp add mysql-client -e MYSQL_USER='<mysql-user>' -e MYSQL_PASS='<mysql-pass>' -e MYSQL_DB='<mysql-db>' -- npx -y mcp-mysql-client. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does MySQL require an API key?
Yes. It expects MYSQL_USER, MYSQL_DB, MYSQL_PASS, of which 1 is a secret.
›Can I use MySQL as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is MySQL in the official MCP registry?
Yes, as io.github.gistrec/mcp-mysql-client.
Alternatives to MySQL
Other database MCP servers.