mysql-mcp-server
A comprehensive Model Context Protocol (MCP) server for MySQL databases with 200+ tools for advanced database management, diagnostics, performance analysis, security auditing, and AI-powered database interactions.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Repository
A comprehensive Model Context Protocol (MCP) server for MySQL databases with 200+ tools for advanced database management, diagnostics, performance analysis, security auditing, and AI-powered database interactions.
Basic Info
- Host: GitHub
- Owner: mukul975
- License: mit
- Language: Python
- Default Branch: master
- Size: 62.5 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
🚀 MySQL MCP Server — AI-Driven MySQL Control & Diagnostics for LLMs
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.
⚡ Ideal for building AI-powered database agents, DevOps automation, or managing MySQL with natural language.
📆 Repository Info
- GitHub: mcp-mysql-server
- Author: @mukul975
- License: MIT
- Keywords:
MySQL,MCP Server,AI MySQL interface,LLM database tool,MySQL automation,chatbot SQL
🧠 Key Features
This MySQL MCP Server provides LLMs and AI tools with:
- ✅ Secure Query Execution: Handles
SELECT,INSERT,UPDATE,DELETE, etc. with read-only validation. - 🔍 Schema Introspection: List tables, inspect structures, indexes, keys.
- 📊 Performance Diagnostics: Analyze fragmentation, slow queries, buffer pool stats.
- 🛡️ Security Auditing: Manage users, audit SSL, monitor roles & privileges.
- 🧩 Backup & Replication Monitor: View replication lag, log status, recovery readiness.
- ⚙️ System Monitoring: Get process list, memory usage, plugin state.
- 📈 Query Insights: Index recommendations, event scheduler overview.
🛠️ Installation
```bash pip install -r requirements.txt
Or install manually:
pip install "mcp[cli]" pip install mysql-connector-python ```
⚙️ Environment Configuration
| Variable | Description | Default |
| ---------------- | --------------------- | ----------- |
| MYSQL_HOST | MySQL server hostname | localhost |
| MYSQL_PORT | MySQL port | 3306 |
| MYSQL_USER | Username | root |
| MYSQL_PASSWORD | Password | (empty) |
| MYSQL_DATABASE | Target DB | (empty) |
💡 Use
.envor export variables manually
▶️ Run & Usage
bash
python mysql_server.py # Default (stdin transport)
python mysql_server.py --transport sse # For web clients (SSE)
python mysql_server.py --help # Command help
🔗 Claude Desktop Integration
json
{
"mcpServers": {
"mysql": {
"command": "python",
"args": ["path/to/mysql_server.py"],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your_user",
"MYSQL_PASSWORD": "your_pass",
"MYSQL_DATABASE": "your_db"
}
}
}
}
🧪 Example Workflows
list_tables: Lists all tablesdescribe_table: Schema of a specific tableexecute_sql: Run select or data modification queriesmysql_slow_query_analysis: Detect slow queriesmysql_user_privileges: Audit user accessmysql_replication_lag_monitoring: Check lag in replication
🧰 Toolset Highlights
Access tools via code or LLM prompts:
mysql_query,list_mysql_tables,mysql_table_schemamysql_index_optimization_suggestions,mysql_deadlock_detectionmysql_ssl_tls_configuration_audit,mysql_backup_health_checkmysql_server_health_dashboard,mysql_event_scheduler, and dozens more
🔐 Security Considerations
- Store secrets in env vars or vault
- Do not expose server publicly
- Privilege validation and SSL audit included
🧪 Error Handling
- Connection errors
- SQL syntax issues
- Network timeouts
- Returns structured error response
💡 Development Structure
text
mcp-mysql-server/
├── mysql_server.py # Entry point
├── requirements.txt # Dependencies
├── README.md # Docs
└── pyproject.toml # Project metadata (optional)
✅ Testing Steps
- Ensure MySQL is running
- Set environment vars
- Run
python mysql_server.py - Try with
mcp dev mysql_server.py(if using MCP CLI)
🤝 Contributing
- Fork the repo
- Create feature/bug branches
- Submit PRs with description & tests
📄 FAQ
Q: What is MCP? A: Model Context Protocol (MCP) is an interface to give LLMs access to structured tools like databases, APIs, and system utilities.
Q: Can I use this with ChatGPT or Claude? Yes! It's designed for direct integration with AI/LLM tools that support tool-use or system-level automation.
Q: Is it safe to run this in production? It depends on your environment. Always restrict access, use read-only roles, and monitor logs.
📄 License
MIT License — Open source and free to use.
🔎 GitHub SEO Tips (apply on GitHub)
📣 Promote It
- Share on Reddit r/MachineLearning
- Post to LinkedIn or Twitter with GIF or screenshots
- Submit to awesome-LLM or similar curated lists
Let me know if you need an HTML version, web preview, or GitHub Pages site for this!
Owner
- Name: Mahipal
- Login: mukul975
- Kind: user
- Location: Berlin
- Twitter: Mukul_jangra
- Repositories: 1
- Profile: https://github.com/mukul975
Front End Developer
Citation (CITATION.cff)
cff-version: 1.2.0
title: "MCP MySQL Server"
message: "If you use this software, please cite it using these metadata."
type: software
authors:
- given-names: "Mahipal"
family-names: "Mahipal"
orcid: "https://orcid.org/0009-0003-4474-946X"
repository-code: "https://github.com/mukul975/mysql-mcp-server"
url: "https://github.com/mukul975/mysql-mcp-server"
abstract: >-
A comprehensive Model Context Protocol (MCP) server for MySQL databases
with 200+ tools for advanced database management, diagnostics, performance
analysis, security auditing, and AI-powered database interactions. Designed
to empower AI assistants and LLMs with sophisticated database access capabilities.
keywords:
- mysql
- database
- model-context-protocol
- mcp
- ai-tools
- database-management
- sql
- python
- diagnostics
- performance-analysis
- security-auditing
license: MIT
version: "1.0.0"
date-released: "2025-07-22"
preferred-citation:
type: software
title: "MCP MySQL Server: A Comprehensive Database Management Tool for AI Systems"
authors:
- given-names: "Mahipal"
family-names: "Mahipal"
year: 2025
url: "https://github.com/mukul975/mysql-mcp-server"
GitHub Events
Total
- Watch event: 1
- Delete event: 6
- Issue comment event: 17
- Push event: 9
- Pull request event: 8
- Create event: 6
Last Year
- Watch event: 1
- Delete event: 6
- Issue comment event: 17
- Push event: 9
- Pull request event: 8
- Create event: 6
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- mcp >=1.0.0
- mysql-connector-python >=8.0.0