mcp-mysql-server
Verified Safeby huangfeng19820712
Overview
Provides an MCP-compliant interface for AI models to securely interact with a MySQL database for CRUD operations, schema inspection, and performance analysis.
Installation
npx @fhuang/mcp-mysql-serverEnvironment Variables
- MYSQL_HOST
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_DATABASE
- MYSQL_PORT
- CONNECTION_LIMIT
- QUEUE_LIMIT
Security Notes
The server demonstrates robust security practices by utilizing parameterized queries to prevent SQL injection. Sensitive database credentials are managed via environment variables or a MySQL connection URL passed as a command-line argument, and passwords are explicitly masked in logging output. Input validation ensures that different tools ('query', 'execute', 'show_statement') are used for their intended SQL command types, preventing misuse. Connection pooling and graceful shutdown on process exit contribute to reliable resource management.
Similar Servers
tmcp
A server implementation for the Model Context Protocol (MCP) to enable LLMs to access external context and tools.
mysql-mcp
Provides an MCP (Model Context Protocol) server for MySQL, enabling AI agents to programmatically interact with and manage MySQL databases.
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.
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.