Back to Home
neverinfamous icon

mysql-mcp

Verified Safe

by neverinfamous

Overview

Enables AI assistants to interact with MySQL databases through the Model Context Protocol.

Installation

Run Command
node dist/cli.js --transport stdio --mysql mysql://user:password@localhost:3306/database

Environment 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

Stats

Interest Score81
Security Score8
Cost ClassHigh
Avg Tokens200
Stars2
Forks0
Last Update2025-12-14

Tags

mcpmysqldatabaseaillmoauthtypescript