Back to Home
jasbir125 icon

mcp_server_mysql

by jasbir125

Overview

Exposes MySQL database operations as tools for AI assistants via the Model Context Protocol (MCP).

Installation

Run Command
python mcp_server_mysql.py

Environment 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

Stats

Interest Score0
Security Score4
Cost ClassMedium
Avg Tokens750
Stars0
Forks0
Last Update2025-11-27

Tags

MySQLMCP ServerAI ToolsDatabasePyMySQL