mcp-server-mysql
If you are the rightful owner of mcp-server-mysql and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol server that provides MySQL database operations, enabling AI models to interact with MySQL databases through a standardized interface.
The @enemyrr/mcp-mysql-server is a Model Context Protocol (MCP) server designed to facilitate seamless interaction between AI models and MySQL databases. It provides a standardized interface for executing database operations such as connecting to databases, executing queries, and managing database schemas. The server supports multiple connection methods, including using a database URL, workspace path, or direct credentials, making it versatile for different deployment environments. It also emphasizes security by using prepared statements to prevent SQL injection and supports secure password handling through environment variables. The server is built with TypeScript, ensuring type safety and robust error handling. It is designed to automatically detect workspaces and manage connections efficiently, providing comprehensive error messages for various failure scenarios. The server is open-source and contributions are welcome through its GitHub repository.
Features
- Multiple connection methods (URL, workspace, direct)
- Secure connection handling with automatic cleanup
- Prepared statement support for query parameters
- Schema management tools
- Comprehensive error handling and validation
Tools
connect_db
Connect to MySQL database using URL, workspace path, or direct credentials
query
Execute SELECT query (support parameter binding)
execute
Perform INSERT/UPDATE/DELETE operation
list_tables
List all tables in the database
describe_table
Get table structure information
create_table
Create a new table (supports field and index definitions)
add_column
Add new columns to existing tables