Enables LLMs to interact with MySQL databases by inspecting schemas and executing safe, read-only queries within transactions.
Model Context Protocol Server for MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.
# Build the Docker image make docker # Run with Docker docker run -i --rm mcp/mysql mysql://host:port/dbname
To install MySQL Database Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @yuru-sha/mcp-server-mysql --client claude
Add the following configuration to your claude_desktop_config.json
:
{ "mcpServers": { "mysql": { "command": "docker", "args": [ "run", "-i", "--rm", "mcp/mysql", "mysql://host:port/dbname" ] } } }
Note: When using Docker on macOS, use host.docker.internal
if the MySQL server is running on the host network.
mysql://[user][:password]@host[:port]/database
Replace /database
with your database name.
# Initial setup make setup # Build the project make build # Format code make format # Run linter make lint
This project is released under the MIT License.
This server enforces read-only access to protect your database. All queries are executed within READ ONLY transactions.
For enhanced security, we recommend creating a read-only user.
Contributions are welcome! Please feel free to submit a Pull Request.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!