mcp_server_mysql
by jasbir125
Overview
Exposes MySQL database operations as tools for AI assistants via the Model Context Protocol (MCP).
Installation
python mcp_server_mysql.pyEnvironment Variables
- MYSQL_HOST
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_DB
- MYSQL_PORT
Security Notes
The `run_query` function directly executes arbitrary SQL passed as a string from the AI assistant. This presents a critical SQL injection vulnerability if the AI's output is not perfectly controlled and sanitized, or if a prompt injection attack occurs. While other functions use parameterized queries, `run_query` lacks any input validation or sanitization, making it highly susceptible to malicious or accidental database modifications and data exfiltration.
Similar Servers
mcp
Provides an MCP interface to MariaDB, enabling standard SQL operations and optional 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.
dx-mcp-server
Empowers AI applications to interact with and query a user-provided Postgres database via the Model Context Protocol (MCP).