Back to Home
howtobearealprogrammer icon

cc-mysql-mcp

by howtobearealprogrammer

Overview

A Model Context Protocol (MCP) server enabling Claude Code to directly interact with local MySQL or MariaDB databases, primarily designed for Windows environments.

Installation

Run Command
node src/dist/index.js

Environment Variables

  • MYSQL_HOST
  • MYSQL_PORT
  • MYSQL_USER
  • MYSQL_PASSWORD

Security Notes

The server directly executes arbitrary SQL queries provided via the `execute_query` tool without any internal sanitization or validation. This poses a significant SQL injection vulnerability if the input is not strictly controlled by a trusted source. The `mysql2` library's `connection.query` is called with a raw query string, allowing for any SQL statement (including destructive ones like `DROP TABLE` or `DELETE FROM`) to be executed. The README explicitly warns about 'No safety rails' and recommends using a restricted database user, which is crucial but does not mitigate the code's inherent vulnerability to malicious or erroneous AI-generated SQL. No hardcoded secrets were found; configuration uses environment variables.

Similar Servers

Stats

Interest Score0
Security Score3
Cost ClassMedium
Avg Tokens1500
Stars0
Forks0
Last Update2025-12-14

Tags

MySQLMariaDBMCP ServerWindows DevelopmentDatabase Tools