Provides tools for managing multiple MySQL connections and performing database operations such as executing SQL queries, listing databases and tables, and retrieving detailed table schema information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MySQL MCP Servershow the schema for the users table in production"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MySQL MCP Server
A lightweight Model Context Protocol (MCP) server for MySQL database operations. Supports multiple named connections and runs in a minimal Docker container.
Features
Multiple Connections: Manage multiple MySQL connections with unique names
Persistent Storage: Connection configs saved to SQLite (survives restarts)
Query Execution: Execute arbitrary SQL queries with parameterized support
Schema Inspection: List databases, tables, and describe table structures
Minimal Footprint: Alpine-based Docker image (~92MB)
Pre-configured Connections: Optionally load connections from environment variables
Tools
Tool | Description |
| Add a new MySQL connection with a unique name |
| Remove an existing connection |
| List all active connections |
| Execute SQL queries on a named connection |
| List all databases on a connection |
| List tables in a database |
| Get table schema/structure |
Quick Start
Build the Docker Image
Run with Docker
Pre-configure Connections
Set the MYSQL_CONNECTIONS environment variable with a JSON array:
Docker Compose
MCP Configuration
Add to your MCP client configuration (e.g., Claude Desktop):
Note: Use host.docker.internal to connect to MySQL running on your host machine.
Usage Examples
Add a Connection
Execute a Query
List Tables
Development
Run Locally (without Docker)
Test with a Local MySQL
Uncomment the MySQL service in docker-compose.yml:
Persistence
Connection configurations are stored in a SQLite database at /app/config/connections.db. Mount a volume to ./config to persist connections across container restarts:
The database stores:
Connection name, host, port, user, password, and default database
Security Notes
Passwords are stored in the SQLite database - ensure the config directory has appropriate permissions
Use environment variables for initial seeding; they will be saved to the store
The container runs as a non-root user (uid 1000)
Consider using Docker secrets or a vault for sensitive credentials
Set
MCP_CONFIG_PATHenvironment variable to customize the config directory
License
MIT