Back to Home
shengshengshengbuxi icon

mysql_mcp_server

by shengshengshengbuxi

Overview

This server provides a Model Context Protocol (MCP) interface to a MySQL database, enabling AI models to execute SQL queries and retrieve database schema information.

Installation

Run Command
npm start

Environment Variables

  • MYSQL_HOST
  • MYSQL_PORT
  • MYSQL_USER
  • MYSQL_PASSWORD
  • MYSQL_DATABASE

Security Notes

The server's primary function is to execute arbitrary SQL queries provided as input via the MCP protocol. While the `mysql2` client supports parameterized queries (mitigating basic SQL injection within parameters), the `sql` string itself is passed directly from the tool's input without additional server-side validation. This means a malicious or compromised LLM (or any upstream caller) could instruct the server to execute destructive SQL commands (e.g., `DROP TABLE`, `DELETE FROM`) on the connected MySQL database. The system inherently trusts the `sql` input from the MCP caller. Additionally, the default `MYSQL_PASSWORD` '1234' for unconfigured environments is a minor security risk for local development setups.

Similar Servers

Stats

Interest Score30
Security Score4
Cost ClassLow
Avg Tokens750
Stars1
Forks0
Last Update2025-12-01

Tags

MySQLMCPSQLDatabaseServer