Query MySQL databases from AI assistants, read-only by default with opt-in writes.
Maintain this server? Claim it
This server only runs locally, from a package. Install it with the instructions on this page to try it.
Pick your client. Values in capitals, like YOUR_TOKEN, are yours to fill in.
Run in a terminal
claude mcp add mysqldb-mcp-server \ -e MYSQL_HOST=YOUR_MYSQL_HOST \ -e MYSQL_USER=YOUR_MYSQL_USER \ -- uvx mysqldb-mcp-server==0.2.0
Environment
MYSQL_HOST (required): MySQL host name or IP address.MYSQL_PORT (optional, not in the config above): TCP port of the MySQL server.MYSQL_USER (required): User name; use a dedicated user with SELECT and SHOW VIEW grants only.MYSQL_PASSWORD (optional, not in the config above): Password of the MySQL user.MYSQL_DATABASE (optional, not in the config above): Default schema for unqualified table names.MYSQL_SSL_MODE (optional, not in the config above): TLS mode, as in the mysql client: DISABLED, PREFERRED, REQUIRED, VERIFY_CA or VERIFY_IDENTITY. Defaults to VERIFY_CA when MYSQL_SSL_CA is set.MYSQL_SSL_CA (optional, not in the config above): CA certificate file that VERIFY_CA and VERIFY_IDENTITY trust in addition to the system's CAs.MYSQL_ALLOW_WRITE (optional, not in the config above): Offer the mysql_execute tool, which can change data and schema.MYSQL_QUERY_TIMEOUT (optional, not in the config above): Seconds a call may take before its statement is stopped.MYSQL_MAX_ROWS (optional, not in the config above): Most rows mysql_query returns.We don't run packages, so we can't list this server's tools.