Provides comprehensive database management capabilities including querying, data manipulation (insert, update, delete), table structure analysis, backup operations, user management, and permission control for MariaDB databases.
Provides comprehensive database management capabilities including querying, data manipulation (insert, update, delete), table structure analysis, backup operations, user management, and permission control for MySQL databases.
🚀 MCP MySQL Server - Full Control Database Tool
⚠️ CẢNH BÁO: Tool này có thể làm mất dữ liệu! Hãy cẩn thận khi sử dụng!
MCP (Model Context Protocol) Server cho MySQL với quyền truy cập đầy đủ. Tool này được phát triển bởi AI và hướng dẫn bởi kami2k1.
📋 Tính năng
🔍 Truy vấn & Phân tích
- Xem danh sách bảng: Hiển thị tất cả bảng với thông tin chi tiết
- Mô tả cấu trúc bảng: Xem cột, kiểu dữ liệu, ràng buộc
- Phân tích bảng: Thống kê số hàng, kích thước, index
- Thực thi SQL: Chạy bất kỳ lệnh SQL nào
📝 Thao tác dữ liệu
- Thêm dữ liệu: Insert record mới
- Cập nhật dữ liệu: Update record theo điều kiện
- Xóa dữ liệu: Delete record theo điều kiện
- Truy vấn tùy chỉnh: SELECT với điều kiện phức tạp
🛠️ Quản trị hệ thống
- Xem biến hệ thống: SHOW VARIABLES
- Backup bảng: Tạo bản sao lưu
- Tối ưu bảng: OPTIMIZE TABLE
- Quản lý user: Tạo/xóa user MySQL
- Cấp quyền: GRANT/REVOKE permissions
⚙️ Cài đặt
1. Cài đặt dependencies
2. Cấu hình database
Tạo file .env
:
3. Cấu hình VS Code
Thêm vào mcp.json
:
4. Khởi động server
🎯 Cách sử dụng trong VS Code
Xem cấu trúc database
Truy vấn dữ liệu
Thêm dữ liệu
Cập nhật dữ liệu
Backup dữ liệu
⚠️ CẢNH BÁO QUAN TRỌNG
🚨 Rủi ro cao
- Tool này có quyền FULL ACCESS vào MySQL
- Có thể XÓA TOÀN BỘ DATABASE nếu sử dụng sai
- Có thể THAY ĐỔI CẤU TRÚC BẢNG không thể khôi phục
- Có thể XÓA USERS & PERMISSIONS của MySQL
🛡️ Biện pháp an toàn
- LUÔN BACKUP trước khi sử dụng
- KIỂM TRA KỸ các lệnh SQL trước khi thực thi
- SỬ DỤNG USER có quyền hạn chế, không dùng root
- TEST TRÊN DATABASE TEST trước khi dùng production
- GIÁM SÁT tất cả thay đổi được thực hiện
🚫 Không khuyến nghị
- Sử dụng trên database production quan trọng
- Để AI tự động thực thi lệnh mà không xem xét
- Cấp quyền root cho connection
- Sử dụng mà không hiểu SQL
🔧 Các tool có sẵn
Tool | Mô tả | Mức độ rủi ro |
---|---|---|
get_tables | Xem danh sách bảng | ✅ An toàn |
describe_table | Xem cấu trúc bảng | ✅ An toàn |
analyze_table | Phân tích bảng | ✅ An toàn |
execute_query | Thực thi SQL | ⚠️ Rủi ro cao |
insert_data | Thêm dữ liệu | ⚠️ Rủi ro trung bình |
update_data | Cập nhật dữ liệu | 🚨 Rủi ro cao |
delete_data | Xóa dữ liệu | 🚨 Rủi ro rất cao |
backup_table | Backup bảng | ✅ An toàn |
optimize_table | Tối ưu bảng | ⚠️ Rủi ro trung bình |
show_variables | Xem biến hệ thống | ✅ An toàn |
👨💻 Thông tin phát triển
- Được phát triển bởi: AI Assistant
- Hướng dẫn bởi: kami2k1
- Ngôn ngữ: Python 3.12+
- Framework: FastMCP (Model Context Protocol)
- Database: MySQL/MariaDB
📞 Hỗ trợ
Nếu gặp vấn đề:
- Kiểm tra logs trong terminal
- Xác nhận cấu hình
.env
đúng - Đảm bảo MySQL server đang chạy
- Kiểm tra quyền truy cập database
📜 License
Tool này được cung cấp "AS IS" không có bảo hành. Người sử dụng chịu trách nhiệm toàn bộ cho việc sử dụng tool.
🚨 LƯU Ý CUỐI: Tool này rất mạnh mẽ nhưng cũng rất nguy hiểm. Hãy sử dụng cẩn thận!
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables full control database operations on MySQL through natural language commands. Supports querying, data manipulation, table management, backups, and system administration with comprehensive SQL execution capabilities.
Related MCP Servers
- AsecurityFlicenseAqualityEnables AI models to perform MySQL database operations through a standardized interface, supporting secure connections, query execution, and comprehensive schema management.Last updated -73526JavaScript
- AsecurityAlicenseAqualityEnables interaction with a MySQL database via JSON commands, supporting read-only queries, test execution of write queries, and table information retrieval through Docker.Last updated -415JavaScriptMIT License
- AsecurityAlicenseAqualityConnect and interact with MySQL databases seamlessly. Execute SQL queries, manage database connections, and retrieve data directly through AI assistants. Enhance your AI capabilities with structured access to your MySQL data.Last updated -9415TypeScriptMIT License
- -securityFlicense-qualityEnables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.Last updated -Python