Back to Home
gvishnoi icon

mysql-server-mcp

Verified Safe

by gvishnoi

Overview

An MCP server that exposes MySQL database operations as tools for AI assistants and other compatible clients.

Installation

Run Command
npm start

Environment Variables

  • MYSQL_HOST
  • MYSQL_PORT
  • MYSQL_USER
  • MYSQL_PASSWORD
  • MYSQL_DATABASE

Security Notes

The server's source code is clear and does not contain 'eval' or obfuscation. It communicates over stdio, not exposing direct network ports. However, it relies on environment variables for MySQL credentials (MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE), with generic placeholder defaults ('username', 'password', 'database_name'). While the README explicitly warns against committing credentials and advises using environment variables, relying on these generic defaults without explicit configuration poses a risk if deployed carelessly. The server executes arbitrary SQL queries provided by the client, making it susceptible to SQL injection if the calling client/AI assistant does not properly sanitize its inputs before generating the SQL query. The code includes basic statement classification to route queries to appropriate handlers, preventing some accidental misuse (e.g., calling a SELECT with 'execute_sql'), but it does not perform advanced SQL injection prevention or input sanitization itself. The README advises implementing additional query validation and sanitization for production use, acknowledging this inherent risk.

Similar Servers

Stats

Interest Score0
Security Score7
Cost ClassMedium
Avg Tokens500
Stars0
Forks0
Last Update2025-11-25

Tags

MySQLMCPdatabasetoolsserver