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
db-mcp-server
Provides AI assistants with structured access to multiple databases, enabling them to execute SQL queries, manage transactions, explore schemas, and analyze performance through a unified interface.
tmcp
Build Model Context Protocol (MCP) servers for AI agents, providing schema-agnostic tools, resources, and prompts, with optional OAuth 2.1 authentication and distributed session management.
mcp-server-generator
Generate Model Context Protocol (MCP) servers from database datasources for integration with AI agents, using a visual canvas interface for tool creation and management.
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.