Data as of
MCP Server for MySQL for Claude Code: Setup & Config
Claude Code: MCP Server for MySQL lets Claude and other AI clients inspect schemas and execute SQL.
What you can do with MCP Server for MySQL in Claude Code
Use it for SQL and schema access with read-only defaults and explicit controls for database writes.
- Inspect table and column metadata from an AI client.
- Query multiple databases or reach a remote database through SSH.
Before you start: MCP Server for MySQL in Claude Code
- Node.js 20 or newer
- MySQL 5.7 or newer; 8.0 or newer recommended
- A MySQL account with suitable privileges
- An MCP-compatible client
The local quick-start remains read-only unless write flags are enabled. ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, and ALLOW_DELETE_OPERATION opt into the corresponding writes. HTTP remote mode is listed but its setup is delegated to other documentation.
MCP Server for MySQL Claude Code configuration
Choose Claude Code configuration scope
For MCP Server for MySQL, open Project scope: .mcp.json at the repository root. Project JSON: merge into mcpServers; user scope: use the CLI.
Add MCP Server for MySQL to Claude Code
Use the mcp-server-mysql entry below in mcpServers. Keep MCP Server for MySQL's documented stdio connection fields and your other Claude Code entries.
Check MCP Server for MySQL in Claude Code
MCP Server for MySQL: Inspect claude mcp list and /mcp status.
Config file · Project scope: .mcp.json at the repository root
{
"mcpServers": {
"mcp-server-mysql": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "<MySQL server hostname or address>",
"MYSQL_PORT": "<MySQL server port>",
"MYSQL_USER": "<MySQL username with appropriate privileges>",
"MYSQL_PASS": "<MySQL user password>",
"MYSQL_DB": "<Target database name>"
}
}
}
}claude mcp add-json --scope project 'mcp-server-mysql' '{"type":"stdio","command":"npx","args":["-y","@benborla29/mcp-server-mysql"],"env":{"MYSQL_HOST":"<MySQL server hostname or address>","MYSQL_PORT":"<MySQL server port>","MYSQL_USER":"<MySQL username with appropriate privileges>","MYSQL_PASS":"<MySQL user password>","MYSQL_DB":"<Target database name>"}}'MCP Server for MySQL tools available to Claude Code
MCP Server for MySQL's stored tool list documents 1 tool; compare it with Claude Code's connected tool list, because the stored list is not a live check.
- mysql_query
For MCP Server for MySQL's mysql_query, review the permission request and arguments in Claude Code before approval.
Execute SQL with read-only defaults and individually enabled write operations.
Troubleshooting MCP Server for MySQL in Claude Code
- If MCP Server for MySQL fails to start, check npx @benborla29/mcp-server-mysql (Node.js/npm), the working directory, and Claude Code's selected scope; inspect claude mcp list and /mcp.
- MCP Server for MySQL: check MYSQL_DB, MYSQL_HOST, MYSQL_PASS, MYSQL_PORT, MYSQL_USER; keep credentials out of shared .mcp.json.
- MCP Server for MySQL uses stdio here: Claude Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Requires Node.js 20 or newer and MySQL 5.7 or newer.
- Known limitation: Advanced remote-mode and redaction configuration are delegated to separate documentation.
- General Claude Code troubleshooting lives in the /clients/claude-code guide.
MCP Server for MySQL — details. Claude Code guide