mysql-mcp-server
Provides tools for managing MariaDB databases, covering the full lifecycle of database administration, development, and operations including schema management, data operations, user management, monitoring, and query analysis.
Provides tools for managing MySQL databases, covering the full lifecycle of database administration, development, and operations including schema management, data operations, user management, monitoring, and query analysis.
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.
MySQL/MariaDB MCP Server
Complete MCP server for MySQL and MariaDB. 50 tools covering the full lifecycle of database administration, development, and operations.
Quick Start (Docker)
cp .env.example .env
# Edit .env with your settings
docker compose up -dMCP server: http://localhost:4000/mcp
Health: http://localhost:4000/health
MariaDB: localhost:3307
Related MCP server: MySQL MCP Server
Configuration
Variable | Default | Description |
|
| MySQL host |
|
| MySQL port |
|
| MySQL user |
|
| MySQL password |
|
| Default database |
|
| Root password (Docker only) |
|
|
|
|
| HTTP server port |
|
| Host port for MySQL container |
|
| Host port for MCP container |
Claude Desktop / Claude Code Integration
HTTP Transport
{
"mcpServers": {
"mysql": {
"url": "http://localhost:4000/mcp"
}
}
}stdio Transport (local)
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/path/to/mcp-mysql/dist/index.js"],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "password"
}
}
}
}Tools (50 total)
Databases (5)
Tool | Description |
| List all databases |
| Create a database |
| Drop a database |
| Show CREATE DATABASE statement |
| Server version, uptime, config |
Tables (8)
Tool | Description |
| List tables with stats |
| Column definitions (SHOW FULL COLUMNS) |
| Full CREATE TABLE DDL |
| Create table from SQL |
| Drop one or more tables |
| Remove all rows |
| Rename / move between databases |
| Size, rows, engine, collation |
Columns (4)
Tool | Description |
| ALTER TABLE ADD COLUMN |
| ALTER TABLE DROP COLUMN |
| ALTER TABLE MODIFY COLUMN |
| RENAME COLUMN (MySQL 8+/MariaDB 10.5+) |
Indexes (3)
Tool | Description |
| All indexes with cardinality |
| Create BTREE/HASH/FULLTEXT/SPATIAL index |
| Drop an index |
Foreign Keys (3)
Tool | Description |
| List FK constraints |
| Add FK with ON UPDATE/DELETE rules |
| Drop FK constraint |
Data Operations (7)
Tool | Description |
| SELECT with pagination and parameterized values |
| Execute any SQL (DDL/DML) |
| Insert single row |
| Update rows by WHERE condition |
| Delete rows by WHERE condition |
| Batch insert up to 5000 rows |
| Atomic multi-statement transaction |
User Management (7)
Tool | Description |
| List all MySQL accounts |
| Create user with password |
| Drop user |
| Grant privileges |
| Revoke privileges |
| Show GRANT statements |
| Change user password |
Server Monitoring (6)
Tool | Description |
| Global/session status variables |
| Global/session config variables |
| Active connections and queries |
| Kill connection or query |
| Last statement warnings |
| Reload grant tables |
Query Analysis & Maintenance (5)
Tool | Description |
| EXPLAIN with traditional/JSON/TREE format |
| Update optimizer statistics |
| Defragment and reclaim space |
| Check for corruption |
| Repair MyISAM/ARCHIVE tables |
Export & Import (2)
Tool | Description |
| Export as JSON, CSV, or SQL INSERTs |
| Execute SQL script |
Development
npm install
npm run dev # Development with auto-reload
npm run build # Production buildSwitch to MySQL 8.4
Edit docker-compose.yml:
mysql:
image: mysql:8.4 # was mariadb:11.4
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpassword}
MYSQL_DATABASE: ${MYSQL_DATABASE:-mcpdb}
MYSQL_USER: ${MYSQL_USER:-mcpuser}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-mcppassword}Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Related MCP Connectors
Query, explore, and manage your databases through natural conversation.
Ask questions in plain language, get answers from your business database. No SQL required.
Ask business questions in plain English. Get instant answers from your database, no SQL needed.
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides comprehensive MySQL database operations including CRUD, performance optimization, health analysis, and anomaly detection. Supports multiple connection modes, OAuth2.0 authentication, and role-based permissions for database management through natural language.91MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language database operations on MySQL databases with AI integration, supporting CRUD operations, schema inspection, and audit logging with built-in security features including SQL injection protection and permission controls.798 npmMIT
- AlicenseCqualityDmaintenanceEnables monitoring and administration of MySQL databases through natural language, supporting multiple simultaneous connections, health checks, and full DDL/DML/DCL operations.3931 npmMIT
- AlicenseAqualityDmaintenanceEnables schema inspection, SELECT queries, and confirmation-gated write/DDL/transaction operations on MySQL and MariaDB databases through natural language.1412 npmMIT