MySQL MCP Server
Provides read-only access to MySQL databases with tools for executing SELECT, SHOW, DESCRIBE, and EXPLAIN queries, along with automatic discovery of table schemas including columns, types, keys, and constraints.
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 me the top 10 customers by total order amount"
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 Model Context Protocol server that provides read-only access to MySQL databases.
Features
Tools
query - Execute read-only SQL queries (SELECT, SHOW, DESCRIBE, EXPLAIN)
All queries run within READ ONLY transactions
Resources
Table schemas - Automatic discovery of tables and columns with their types, keys, and constraints
Installation
Docker
docker build -t mcp/mysql .
docker run -i --rm mcp/mysql mysql://user:password@host:3306/databaseNPM
npm install -g @modelcontextprotocol/server-mysqlNPX
npx -y @modelcontextprotocol/server-mysql mysql://user:password@localhost:3306/databaseUsage
Add to your MCP's config:
Using Docker image (recommended)
docker pull guidomarinho/mcp-mysql{
"mcpServers": {
"your_mcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"guidomarinho/mcp-mysql:latest",
"mysql://root:password@host.docker.internal:3306/you_db"
],
"env": {}
}
}
}Using local Docker
{
"mcpServers": {
"mysql": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/mysql",
"mysql://root:password@host.docker.internal:3306/database"
]
}
}
}Using NPX
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mysql",
"mysql://user:password@localhost:3306/database"
]
}
}
}Note: When using Docker to connect to a MySQL server on your host machine, use host.docker.internal instead of localhost.
Connection String Format
mysql://username:password@host:port/databaseDevelopment
npm install
npm run build
node dist/index.js mysql://user:password@localhost:3306/databaseLicense
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/guido-marinho/mcp-mysql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server