mysql-mcp
Verified Safeby neverinfamous
Overview
Enables AI assistants to interact with MySQL databases through the Model Context Protocol.
Installation
node dist/cli.js --transport stdio --mysql mysql://user:password@localhost:3306/databaseEnvironment Variables
- MYSQL_HOST
- MYSQL_PORT
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_DATABASE
- MYSQL_POOL_SIZE
- MYSQL_MCP_TOOL_FILTER
- TOOL_FILTER
- LOG_LEVEL
- PROXYSQL_HOST
- PROXYSQL_PORT
- PROXYSQL_USER
- PROXYSQL_PASSWORD
- MYSQL_ROUTER_URL
- MYSQL_ROUTER_USER
- MYSQL_ROUTER_PASSWORD
- MYSQL_ROUTER_INSECURE
- MYSQL_ROUTER_API_VERSION
- MYSQLSH_PATH
- MYSQLSH_TIMEOUT
- MYSQLSH_WORK_DIR
- MYSQL_XPORT
Security Notes
The server implements strong security measures including SQL injection prevention via parameterized queries, OAuth 2.0 authentication and authorization, and sensitive data redaction in logs. Docker images are built with non-root users and automated scanning. The `mysqlsh_run_script` tool allows arbitrary code execution (JS, Python, SQL) and requires 'admin' scope, posing a significant risk if this scope is not tightly controlled. Some tool-specific connection configurations (e.g., for ProxySQL, MySQL Router) use hardcoded default credentials if environment variables are not provided, which could be a risk if not overridden in production.
Similar Servers
mcp-mysql-server
Provides an MCP-compliant interface for AI models to securely interact with a MySQL database for CRUD operations, schema inspection, and performance analysis.
mcp_sql_demo
Provides secure, multi-database access for LLMs to inspect MySQL schemas and execute SQL queries, supporting both read and configurable write operations with fine-grained schema-specific permissions.
mysql_mcp_server
This server provides a Model Context Protocol (MCP) interface to a MySQL database, enabling AI models to execute SQL queries and retrieve database schema information.
db-mcp
An enterprise-grade SQLite MCP server for database management, analytics, and AI-native operations with OAuth 2.0 authentication and granular access control.