MySQL Database Access
STDIOMCP server for secure interaction with MySQL databases through controlled interface.
MCP server for secure interaction with MySQL databases through controlled interface.
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases. This server allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
Set the following environment variables:
MYSQL_HOST=localhost # Database host MYSQL_PORT=3306 # Optional: Database port (defaults to 3306 if not specified) MYSQL_USER=your_username MYSQL_PASSWORD=your_password MYSQL_DATABASE=your_database
Add this to your claude_desktop_config.json
:
{ "mcpServers": { "mysql": { "command": "python", "args": [ "-m", "src.mysql_mcp_server.server" ], "env": { "MYSQL_HOST": "localhost", "MYSQL_PORT": "3306", "MYSQL_USER": "your_username", "MYSQL_PASSWORD": "your_password", "MYSQL_DATABASE": "your_database" } } } }
# Clone the repository git clone https://github.com/designcomputer/mysql_mcp_server.git cd mysql_mcp_server # Install dependencies pip install -r requirements.txt # Run the server python -m src.mysql_mcp_server.server
# Clone the repository git clone https://github.com/designcomputer/mysql_mcp_server.git cd mysql_mcp_server # Create virtual environment python -m venv py-mcp-mysql_venv source py-mcp-mysql_venv/bin/activate # or `py-mcp-mysql_venv\Scripts\activate` on Windows # Install development dependencies pip install -r requirements-dev.txt # Run tests pytest
This MCP server requires database access to function. For security:
See MySQL Security Configuration Guide for detailed instructions on:
⚠️ IMPORTANT: Always follow the principle of least privilege when configuring database access.
MIT License - see LICENSE file for details.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)