by malove86
Access MySQL databases, run SQL queries, and retrieve data easily with configurable parameters. Compatible with MySQL Wo
Connects Claude to MySQL databases (including AWS RDS) to execute queries, explore schemas, and analyze table structures. Provides secure database access with SSL support and connection pooling.
MySQL is a community-built MCP server published by malove86 that provides AI assistants with tools and capabilities via the Model Context Protocol. Access MySQL databases, run SQL queries, and retrieve data easily with configurable parameters. Compatible with MySQL Wo It is categorized under databases.
You can install MySQL in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
MIT
MySQL is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Enable Claude to query your database directly using natural language
Example
Ask 'Show me top 10 customers by revenue this month' and get SQL results instantly
Eliminate manual SQL writing for ad-hoc queries, get insights 10x faster
Generate complex reports and analytics without leaving conversation
Example
Analyze sales trends, cohort retention, user behavior patterns conversationally
Democratize data access—non-technical team members can query databases
Understand database structure, relationships, and data models
Example
'Explain the user_orders table schema and its relationships'
Onboard engineers faster, explore unfamiliar databases efficiently
Share your MCP server with the developer community
We wired MySQL into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
According to our notes, MySQL benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
I recommend MySQL for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
MySQL reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Useful MCP listing: MySQL is the kind of server we cite when onboarding engineers to host + tool permissions.
Strong directory entry: MySQL surfaces stars and publisher context so we could sanity-check maintenance before adopting.
I recommend MySQL for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
According to our notes, MySQL benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
Useful MCP listing: MySQL is the kind of server we cite when onboarding engineers to host + tool permissions.
MySQL reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
showing 1-10 of 55
一个基于Model Context Protocol的MySQL数据库操作服务器。该服务器使AI模型能够通过标准化接口与MySQL数据库进行交互。
npx @malove86/mcp-mysql-server
服务器支持两种部署模式:
在MCP设置配置文件中使用命令行运行:
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": ["-y", "@malove86/mcp-mysql-server"],
"env": {
"MYSQL_HOST": "your_host",
"MYSQL_USER": "your_user",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database",
"MYSQL_PORT": "3306"
}
}
}
}
指向远程运行的MCP服务器:
{
"mcpServers": {
"mcp-mysql-server": {
"url": "http://your-server-address:port/mcp-mysql-server"
}
}
}
在远程服务器上,您需要设置环境变量后启动MCP服务器:
# 设置环境变量
export MYSQL_HOST=your_host
export MYSQL_USER=your_user
export MYSQL_PASSWORD=your_password
export MYSQL_DATABASE=your_database
export MYSQL_PORT=3306 # 可选,默认为3306
# 启动服务器
npx @malove86/mcp-mysql-server
注意:MYSQL_PORT是可选的,默认值为3306。
list_tables、query等工具,无需先调用connect_db使用提供的凭据建立与MySQL数据库的连接。如果已通过环境变量设置了连接,此工具是可选的。
{
"host": "localhost",
"user": "root",
"password": "your_password",
"database": "your_database",
"port": 3306 // 可选,默认为3306
}
执行SELECT查询,支持可选的预处理语句参数。
{
"sql": "SELECT * FROM users WHERE id = ?",
"params": [1] // 可选参数
}
列出已连接数据库中的所有表。
{} // 从v0.2.4开始不再需要任何参数
获取特定表的结构。
{
"table": "users"
}
欢迎贡献!请随时提交Pull Request到 https://github.com/Malove86/mcp-mysql-server.git
MIT
Run data quality queries to catch anomalies and inconsistencies
Example
Find duplicate records, missing values, orphaned foreign keys automatically
Maintain data integrity with less manual SQL work
Prerequisites
Time Estimate
15-30 minutes including configuration and testing
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
MCP server acts as bridge between Claude and database, translating natural language to SQL queries and returning results in structured format.
Protocols
Compatibility
✓ Use when
Use for ad-hoc data queries, exploratory analysis, report generation, schema exploration, and democratizing data access. Best for read-heavy analytics workloads.
✗ Avoid when
Avoid for production write operations, mission-critical transactions, real-time OLTP workloads, or when database contains sensitive PII without proper access controls. Use read replicas, not primary.