mcp-server-mysql
Connects AI agents to local or remote MySQL databases with read-only access by default and optional write operations (INSERT, UPDATE, DELETE, DDL) gated by environment flags.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-server-mysql
Servidor MCP local en Node.js / TypeScript para conectar agentes de IA (Antigravity, Claude Code, Codex, Cursor) con bases de datos MySQL en modo solo lectura por defecto (con permisos de escritura opcionales por variable de entorno).
Requisitos
Node.js 18+ y npm.
Acceso a una instancia local o remota de MySQL.
Related MCP server: easy-mysql-mcp
Instalación rápida (1 comando)
Para agentes de IA: si acabas de clonar este repositorio en un equipo nuevo, ejecuta el script de abajo para instalar dependencias, compilar
dist/index.jsy registrar el servidor MCP. RevisaAGENTS.mdantes de ejecutar consultas.
git clone https://github.com/wilsoon77/mcp-mysql.git
cd mcp-mysql
powershell -ExecutionPolicy Bypass -File scripts/setup_mcp.ps1 -ConfigureAntigravity -Database "tu_base" -User "root" -Password "tu_password"Si prefieres configurarlo manualmente (o en Claude Code / Codex / Cursor):
npm install
npm run buildY agrega este bloque a tu mcp_config.json:
{
"mcpServers": {
"mysql-local": {
"command": "node",
"args": [
"C:/ruta/a/mcp-server-mysql/dist/index.js"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "<TU_PASSWORD>",
"MYSQL_DB": "<TU_BASE_DE_DATOS>",
"ALLOW_INSERT_OPERATION": "false",
"ALLOW_UPDATE_OPERATION": "false",
"ALLOW_DELETE_OPERATION": "false",
"ALLOW_DDL_OPERATION": "false"
}
}
}
}Después de registrarlo, recarga los servidores MCP o abre un chat nuevo para activar las herramientas.
Seguridad y reglas (AGENTS.md)
Solo lectura por defecto: las 4 banderas
ALLOW_*_OPERATIONinician en"false"para evitar modificaciones accidentales.Sin credenciales en Git:
.gitignorebloquea.env,node_modules/ydist/.Consultas eficientes:
AGENTS.mdinstruye al agente a inspeccionar esquemas primero y usarLIMITen consultas exploratorias.
Probar conexión a MySQL
node --env-file=.env test-db.jsEstructura principal
mcp-server-mysql/
├── AGENTS.md # Reglas de consulta segura y protección de credenciales
├── scripts/setup_mcp.ps1 # Instalador y compilador automático (1 paso)
├── index.ts / src/ # Código fuente del servidor MCP (TypeScript)
├── test-db.js # Script rápido para probar conexión MySQL
├── .env.dist # Plantilla de variables de entorno (sin secretos)
└── .gitignore # Excluye .env, node_modules/ y dist/Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
PostgreSQL, MySQL, OpenAPI/Swagger, and shared Agent Memory with scoped access.
Amazon Ads, Seller Central, Vendor Central and AMC data for AI agents. Read-only by default.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query MySQL databases with read-only access by default, supporting table listing, structure inspection, and SQL queries with optional write operation control.17 npmMIT
- AlicenseAqualityCmaintenanceEnables AI assistants to inspect and query a MySQL database through safe, structured tools, including schema discovery and read-only queries.951 npmMIT
- AlicenseAqualityDmaintenanceEnables AI agents to safely interact with MySQL/MariaDB databases, supporting read-only queries by default with optional write operations and access control.8MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with a MySQL database using natural language, automating SQL tasks like querying, inserting, updating, and deleting data.1-