mysqldb-mcp-server MCP server
@burakdirin
关于 mysqldb-mcp-server MCP server
An MCP server implementation that enables Claude AI to interact with MySQL databases.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mysqldb-mcp-server": {
"command": "uv",
"args": [
"pip",
"install",
"mysqldb-mcp-server"
]
}
}
}工具
2Connects to a specific MySQL database
Executes MySQL queries
概览
What is mysqldb-mcp-server?
mysqldb-mcp-server is a Model Context Protocol (MCP) server that provides tools to connect to and query MySQL databases. It is designed for AI assistants, like Claude, that need to interact directly with MySQL databases through natural language or structured commands.
How to use mysqldb-mcp-server?
Install the package using pip install mysqldb-mcp-server or uv pip install mysqldb-mcp-server. Configure it with environment variables for MySQL connection (host, user, password, optional database, read-only mode). Then add it to your MCP client (e.g., Claude Desktop) by editing the client’s configuration file and specifying the command and environment variables. You can also install it automatically via Smithery.
Key features of mysqldb-mcp-server
- Connects to a MySQL database using the
connect_databasetool. - Executes SQL queries with the
execute_querytool. - Supports multiple semicolon-separated queries in one call.
- Offers an optional read-only mode to prevent data modification.
- Configurable via environment variables for host, user, and password.
Use cases of mysqldb-mcp-server
- Let an AI assistant query a MySQL database to answer user questions.
- Execute administrative SQL statements (e.g., SELECT, INSERT) from a chat interface.
- Interact with a development or testing database in read-only mode to avoid accidental writes.
FAQ from mysqldb-mcp-server
What environment variables are required?
MYSQL_HOST (default “localhost”), MYSQL_USER (default “root”), and MYSQL_PASSWORD (default empty). MYSQL_DATABASE is optional, and MYSQL_READONLY disables write queries when set to “1” or “true”.
What tools does mysqldb-mcp-server provide?
It provides two tools: connect_database (takes a database string) and execute_query (takes a query string). Both return results in JSON format.
How do I install mysqldb-mcp-server?
You can install it via pip (pip install mysqldb-mcp-server) or uv (uv pip install mysqldb-mcp-server). For use with Claude Desktop, add a configuration entry pointing to the installed package via uvx.
Can I execute multiple queries in one call?
Yes. The execute_query tool accepts multiple SQL statements separated by semicolons and returns results for all queries.
How do I enable read-only mode?
Set the environment variable MYSQL_READONLY to “1” or “true”. When enabled, the server will refuse any queries that attempt to modify data.
其他 分类下的更多 MCP 服务器
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.

EverArt
modelcontextprotocolModel Context Protocol Servers
Maestro
mobile-dev-incPainless E2E Automation for Mobile and Web
Inbox Zero AI MCP
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
评论