Back to Home
athavala icon

mysql-mcp-server

by athavala

Overview

Provides a programmatic interface for interacting with a MySQL database, enabling schema retrieval and arbitrary SQL query execution through an MCP server.

Installation

Run Command
python C:/Python/test/selfstudy/databaseMCP.py

Environment Variables

  • DB_HOST
  • DB_USER
  • DB_PASSWORD
  • DB_NAME
  • DB_PORT

Security Notes

The `query_data` function directly executes any SQL string provided as input without sanitization or validation, creating a severe SQL injection vulnerability. Although there's a commented-out `is_safe_query` check, it's not active. Additionally, hardcoded default database credentials ('root', 'password') are present, which are insecure if environment variables are not properly configured.

Similar Servers

Stats

Interest Score32
Security Score1
Cost ClassMedium
Avg Tokens2000
Stars1
Forks0
Last Update2025-12-10

Tags

MySQLDatabaseSchemaSQLMCP