MCP MySQL
Provides tools for testing connections, listing tables, describing table columns, and executing read-only SQL queries (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH) on a MySQL database.
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., "@MCP MySQLlist all tables in the database"
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.
MCP MySQL
Servidor MCP en Python para conectar asistentes de IA (Cursor, Claude, etc.) a una base de datos MySQL.
Estructura
MCP-DATABASE/
├── pyproject.toml
├── .env.example
├── src/
│ └── mcp_mysql/
│ ├── __init__.py
│ ├── __main__.py
│ ├── config.py # Variables de entorno
│ ├── db.py # Conexión MySQL
│ ├── tools.py # Lógica de las tools
│ └── server.py # Servidor MCP (FastMCP)
└── README.mdRelated MCP server: MCP MySQL Server
Requisitos
Python 3.11+
Acceso a un servidor MySQL
Instalación
python -m venv .venv
source .venv/bin/activate
pip install -e .Copia y edita las credenciales:
cp .env.example .envTools disponibles
Tool | Descripción |
| Verifica la conexión a MySQL |
| Lista las tablas de la base de datos |
| Muestra columnas de una tabla |
| Ejecuta consultas de solo lectura |
Por defecto solo se permiten consultas SELECT, SHOW, DESCRIBE, EXPLAIN y WITH.
Uso con Cursor
En la configuración de MCP de Cursor (~/.cursor/mcp.json o settings del proyecto):
{
"mcpServers": {
"mysql": {
"command": "python",
"args": ["-m", "mcp_mysql"],
"cwd": "/ruta/absoluta/a/MCP-DATABASE",
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "tu_password",
"MYSQL_DATABASE": "tu_database"
}
}
}
}Si usas el virtualenv del proyecto:
{
"mcpServers": {
"mysql": {
"command": "/ruta/absoluta/a/MCP-DATABASE/.venv/bin/python",
"args": ["-m", "mcp_mysql"],
"cwd": "/ruta/absoluta/a/MCP-DATABASE",
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "tu_password",
"MYSQL_DATABASE": "tu_database"
}
}
}
}Ejecución local
python -m mcp_mysqlEl servidor usa transporte stdio (estándar para clientes MCP).
Prueba

This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/EgCooper/MCP-DATABASE'
If you have feedback or need assistance with the MCP directory API, please join our Discord server