You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 🚀 MySQL MCP Server — AI-Driven MySQL Control & Diagnostics for LLMs
2
2
3
-
A comprehensive Model Context Protocol (MCP) server for MySQL databases, designed to empower AI assistantsand LLMs with advanced database access, management, and diagnostic capabilities.
3
+
A fully featured **Model Context Protocol (MCP) server for MySQL** — designed to empower **AI assistants, LLMs (like ChatGPT, Claude, Gemini)**, and automation tools with deep **MySQL database access**, diagnostics, and intelligent control.
4
4
5
-
## Repository
5
+
> ⚡ Ideal for building **AI-powered database agents**, DevOps automation, or managing **MySQL with natural language**.
-**Execute SQL Queries**: Support for safe execution of `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and other commands with read-only validation.
14
-
-**Database Introspection**: List tables, view schemas, fetch sample data, and explore indexes and constraints.
15
-
-**Advanced Diagnostics**: Comprehensive analysis tools covering fragmentation, slow queries, deadlocks, buffer pool usage, partitioning, and query performance.
16
-
-**Security and User Management**: Tools for auditing user privileges, managing users and roles, SSL/TLS configuration audit, and monitoring audit logs.
17
-
-**Backup and Replication Monitoring**: Backup health status, binary log and replication status, replication lag monitoring, and recovery readiness.
18
-
-**Server and System Monitoring**: View system variables, process lists, query cache stats, memory usage breakdowns, and plugin/component status.
19
-
-**Performance Insights**: Adaptive index and query optimizer analyses, event scheduler management, and resource consumption evaluations.
python mysql_server.py --transport sse # For web clients (SSE)
67
+
python mysql_server.py --help # Command help
88
68
```
89
69
90
-
## Integration
70
+
---
91
71
92
-
To integrate with Claude Desktop, update your config file (`%APPDATA%/Claude/claude_desktop_config.json` on Windows or `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
72
+
## 🔗 Claude Desktop Integration
93
73
94
74
```json
95
75
{
@@ -100,77 +80,121 @@ To integrate with Claude Desktop, update your config file (`%APPDATA%/Claude/cla
100
80
"env": {
101
81
"MYSQL_HOST": "localhost",
102
82
"MYSQL_PORT": "3306",
103
-
"MYSQL_USER": "your_username",
104
-
"MYSQL_PASSWORD": "your_password",
105
-
"MYSQL_DATABASE": "your_database"
83
+
"MYSQL_USER": "your_user",
84
+
"MYSQL_PASSWORD": "your_pass",
85
+
"MYSQL_DATABASE": "your_db"
106
86
}
107
87
}
108
88
}
109
89
}
110
90
```
111
91
112
-
## Example Workflows
92
+
---
113
93
114
-
- List all tables: use `list_tables` tool or access `mysql://tables` resource.
115
-
- Inspect table schema: use `describe_table` tool or `mysql://schema/{table_name}`.
116
-
- Execute queries: use `execute_sql` for select or data modification queries.
117
-
- Analyze slow queries and deadlocks.
118
-
- Audit user privileges and monitor SSL/TLS connections.
119
-
- Monitor replication lag and binary logs for health.
94
+
## 🧪 Example Workflows
120
95
121
-
## Included Tools
96
+
*`list_tables`: Lists all tables
97
+
*`describe_table`: Schema of a specific table
98
+
*`execute_sql`: Run select or data modification queries
99
+
*`mysql_slow_query_analysis`: Detect slow queries
100
+
*`mysql_user_privileges`: Audit user access
101
+
*`mysql_replication_lag_monitoring`: Check lag in replication
0 commit comments