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
python C:/Python/test/selfstudy/databaseMCP.pyEnvironment 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
mcp-mysql-server
Provides an MCP-compliant interface for AI models to securely interact with a MySQL database for CRUD operations, schema inspection, and performance analysis.
jewei-mssql-mcp-server
Provides a Micro-Agent Protocol (MCP) server for querying Microsoft SQL Server databases and retrieving table structures.
Dynamic-Smart-MCP
An intelligent FastMCP 2 server that converts natural language questions into SQL queries or API requests for any SQL database or OpenAPI-defined API using AI.
mysql-mcp-server
Acts as a read-only MySQL server proxy that exposes database introspection and query execution tools to AI clients via the Model Context Protocol (MCP) or a REST API.