mysql-mcp-server
by KeeVor
Overview
Enables AI assistants within the Cursor editor to directly query and interact with MySQL databases via the Model Context Protocol (MCP).
Installation
npx -y @keevor/mysql-mcp-serverEnvironment Variables
- DB_HOST
- DB_USER
- DB_DATABASE
Security Notes
The server directly executes user-provided SQL queries (`args.sql`) via `conn.execute()` without server-side sanitization or explicit parameter binding for prepared statements, making it highly vulnerable to SQL injection. While the README suggests using read-only or restricted database accounts, the core functionality itself doesn't prevent malicious SQL from being executed if the AI or user input is compromised. It also uses `KILL QUERY` for timeout, which requires specific database permissions and could potentially be abused if the connection ID is guessable, though the risk is lower here as it's killing its own query.
Similar Servers
mcp
Provides a Model Context Protocol (MCP) interface for managing and querying MariaDB databases, supporting standard SQL operations and advanced vector/embedding-based search for AI assistants.
mcp-mysql-server
Provides an MCP-compliant interface for AI models to securely interact with a MySQL database for CRUD operations, schema inspection, and performance analysis.
postgres-mysql-mcp-server
A Model Context Protocol (MCP) server that enables AI assistants to query PostgreSQL and MySQL databases for schema introspection and data retrieval.
mysql-mcp
Provides an MCP (Model Context Protocol) server for MySQL, enabling AI agents to programmatically interact with and manage MySQL databases.