Skip to main content

MySQL MCP

io.github.gistrec/mcp-mysql-client

v1.1.1Updated Nov 4, 2026stdio · npm

MCP server for one MySQL database: schema, read-only queries and guarded writes.

Install

Replace 2 placeholders with your own values.

Run in your terminal. Replace 2 placeholders.

claude mcp add mcp-mysql-client -e 'MYSQL_USER=<your-mysql-user>' -e 'MYSQL_DB=<your-mysql-db>' -e MYSQL_HOST=127.0.0.1 -e MYSQL_PORT=3306 -e MYSQL_SSL=false -e ALLOW_INSERT_OPERATION=false -e ALLOW_UPDATE_OPERATION=false -e ALLOW_DELETE_OPERATION=false -e MYSQL_MAX_ROWS=1000 -e MYSQL_TIMEOUT_MS=30000 -- npx -y [email protected]

Configuration

12 settings.

  • MYSQL_USER
    Env var· required
    MySQL user. Use one with the least privileges the task needs, never root.
  • MYSQL_DB
    Env var· required
    The one database this server is bound to. No tool can leave it.
  • MYSQL_PASS
    Env var· optional· secret
    Password for that user. Treat it as a secret; MYSQL_PASS_FILE reads it from a file instead.
  • MYSQL_HOST
    Env var· optional
    Database host.Default: 127.0.0.1
  • MYSQL_PORT
    Env var· optional
    Database port.Default: 3306
  • MYSQL_SSL
    Env var· optional
    Require a TLS connection to the server.Default: false
Show 6 more
  • MYSQL_SSL_CA
    Env var· optional
    Path to the CA bundle verifying the server certificate; implies MYSQL_SSL.
  • ALLOW_INSERT_OPERATION
    Env var· optional
    Allow INSERT statements through the execute tool.Default: false
  • ALLOW_UPDATE_OPERATION
    Env var· optional
    Allow UPDATE statements through the execute tool.Default: false
  • ALLOW_DELETE_OPERATION
    Env var· optional
    Allow DELETE statements through the execute tool.Default: false
  • MYSQL_MAX_ROWS
    Env var· optional
    Row cap for one read; the result is marked truncated when it is hit.Default: 1000
  • MYSQL_TIMEOUT_MS
    Env var· optional
    Statement timeout in milliseconds; the connection is dropped on expiry.Default: 30000

Listed in the official MCP Registry since Nov 4, 2026. Mirrored daily; last checked Nov 26, 2026.