Back to Home
isdaniel icon

mysqltuner_mcp

by isdaniel

Overview

A Model Context Protocol (MCP) server for MySQL performance tuning and analysis.

Installation

Run Command
python -m mysqltuner_mcp

Environment Variables

  • MYSQL_URI
  • MYSQL_POOL_SIZE
  • MYSQL_SSL
  • MYSQL_SSL_CA
  • MYSQL_SSL_CERT
  • MYSQL_SSL_KEY
  • MYSQL_SSL_VERIFY_CERT
  • MYSQL_SSL_VERIFY_IDENTITY

Security Notes

The `UserPrivilegesToolHandler` has a SQL injection vulnerability. Specifically, methods like `_get_user_privileges` construct SQL queries using f-strings to directly embed `username` and `hostname` values into the `WHERE` clause without proper escaping or parameterization (e.g., `WHERE User = '{username}' AND Host = '{hostname}'`). This allows an attacker to inject arbitrary SQL if they can control these inputs, potentially leading to unauthorized data access or manipulation. While most queries use parameterized statements via `SqlDriver`, this specific pattern bypasses that protection. No usage of `eval` or direct obfuscation was found. Database connection configuration, including SSL/TLS, is handled securely via environment variables and standard Python `ssl` module.

Similar Servers

Stats

Interest Score0
Security Score3
Cost ClassHigh
Avg Tokens3000
Stars0
Forks0
Last Update2026-01-18

Tags

MySQLperformance tuningdatabase analysisMCPAI-powered