Back to Home
matpb icon

mysql-mcp-server

Verified Safe

by matpb

Overview

Provides secure, read-only access to MySQL databases through a Model Context Protocol (MCP) server, including schema introspection and Google Cloud SQL Proxy support.

Installation

Run Command
npx -y @matpb/mysql-mcp-server

Environment Variables

  • MYSQL_HOST
  • MYSQL_PORT
  • MYSQL_USER
  • MYSQL_PASSWORD
  • MYSQL_DATABASE
  • CLOUD_SQL_PROXY_ENABLED
  • CLOUD_SQL_INSTANCE
  • GOOGLE_APPLICATION_CREDENTIALS

Security Notes

The server implements robust query sanitization using `QuerySanitizer.ts` to explicitly reject mutation operations (INSERT, UPDATE, DELETE, DROP, etc.), transaction commands, and dangerous keywords (INTO OUTFILE, FOR UPDATE). Table names in `DescribeTableTool` are sanitized via regex to prevent SQL injection. It loads credentials from environment variables, avoiding hardcoded secrets. The Cloud SQL Proxy provides a secure connection tunnel, and its binary is auto-downloaded from a trusted Google source. While the auto-download feature inherently depends on the integrity of the source, the overall implementation of read-only enforcement and secure connection methods is strong.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassMedium
Avg Tokens2500
Stars0
Forks0
Last Update2026-01-19

Tags

MySQLDatabaseRead-OnlyMCPCloud SQL