mysql-mcp
Provides tools for schema inspection (list databases, tables, indexes, foreign keys, routines, triggers, events), SELECT queries, and confirmation-gated write/DDL/transaction operations on MariaDB databases.
Provides tools for schema inspection (list databases, tables, indexes, foreign keys, routines, triggers, events), SELECT queries, and confirmation-gated write/DDL/transaction operations (INSERT, UPDATE, DELETE, REPLACE, TRUNCATE, CREATE, ALTER, DROP, RENAME) on MySQL databases.
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-mcplist tables in the current 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.
mysql-mcp
MCP server for MySQL and MariaDB: schema inspection, SELECT, and separate confirmation-gated write/DDL/transaction tools.
Works over the MySQL wire protocol (MySQL 5.7+/8+ and MariaDB). For Aurora IAM or RDS Data API, use AWS Labs’ MySQL MCP instead.
Secrets belong in agent mcp.json env (mcpServers.*.env) — not project .env. Do not create a project .env for runtime credentials.
Tools
Tool | Notes |
| Schema inspect |
| Schema inspect |
| SELECT only; locks/ |
| INSERT/UPDATE/DELETE/REPLACE/TRUNCATE — strong confirm |
| CREATE/ALTER/DROP/RENAME — strong confirm |
| Multi-statement txn — per-stmt preview + strong confirm |
| EXPLAIN |
Writes are separate tools from reads. Agents must not use read_query for DML/DDL.
Strong confirmation
MCP has no native UI modal. Mutating tools return an impact preview and do not execute until called again with the same sql and confirmed: true.
Client operators should require approval on write_query, schema_query, and transaction_query (destructiveHint / non-readOnly).
Related MCP server: MySQL MCP Server
Auth / env
Variable | Required | Purpose |
| no* |
|
| * | Discrete connection |
| no | TLS |
| no | Caps |
Privilege scope: prefer least privilege. Use a write-capable role only when write tools are needed.
mcp.json example
{
"mcpServers": {
"mysql": {
"command": "node",
"args": ["/Volumes/ADATA/Projects/mcp-mysql/dist/index.js"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_USER": "mcp_rw",
"MYSQL_PASSWORD": "your-password",
"MYSQL_DATABASE": "your_database"
}
}
}
}Develop
npm test && npm run build
# Smoke (pass env inline — never create a repo .env):
# MYSQL_HOST=… MYSQL_USER=… MYSQL_PASSWORD=… MYSQL_DATABASE=… npm run test:connectionsRisks
Row content is untrusted (prompt injection)
Confirmed writes are permanent without DB-level undo
Shared bot identity;
transaction_queryhas large blast radius after confirm
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables read-only access to MySQL databases through natural language queries. Provides automatic table schema discovery and executes SELECT, SHOW, DESCRIBE, and EXPLAIN statements within secure read-only transactions.Last updatedMIT
- Alicense-qualityDmaintenanceEnables 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.Last updated962MIT
- AlicenseAqualityCmaintenanceEnables interaction with MySQL databases (including AWS RDS and cloud instances) through natural language, supporting query execution, schema inspection, index management, and comprehensive database operations with secure SSL connections.Last updated82MIT
- Alicense-qualityDmaintenanceEnables executing SQL queries, schema introspection, and data management for PostgreSQL and MySQL databases via natural language, supporting local, SSH, and AWS RDS connections.Last updated73MIT
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
GibsonAI MCP server: manage your databases with natural language
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/RexySaragih/mcp-mysql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server