- Mcp_server_mysql
Mcp_server_mysql
What is MCP Server for MySQL?
MCP Server for MySQL is a Model Context Protocol server built on Node.js that provides access to MySQL databases, enabling large language models (LLMs) to inspect database schemas and execute SQL queries.
How to use MCP Server for MySQL?
To use the MCP Server, install it via npm or through Smithery, configure your MySQL connection details, and run the server. You can execute SQL queries through the server once it's set up.
Key features of MCP Server for MySQL?
- Execute SQL queries against MySQL databases.
- Supports read and write operations with proper permissions.
- Provides comprehensive database information including table schemas and statistics.
- Security features like SQL injection prevention and query whitelisting.
- Performance optimizations such as connection pooling and query caching.
Use cases of MCP Server for MySQL?
- Integrating LLMs with MySQL databases for dynamic data retrieval.
- Automating database management tasks through SQL queries.
- Enhancing applications with real-time data access and manipulation capabilities.
FAQ from MCP Server for MySQL?
-
Can I use MCP Server with any version of MySQL?
Yes, it supports MySQL 5.7 and higher, with MySQL 8.0+ recommended. -
Is there a way to enable write operations?
Yes, you can enable INSERT, UPDATE, and DELETE operations through configuration settings. -
How do I troubleshoot connection issues?
Ensure your MySQL server is running, check your credentials, and verify SSL settings if applicable.
Server Config
{
"mcpServers": {
"mcp_server_mysql": {
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "password",
"MYSQL_DB": "your_db",
"ALLOW_INSERT_OPERATION": "true",
"ALLOW_UPDATE_OPERATION": "true",
"ALLOW_DELETE_OPERATION": "true"
}
}
}
}