Simple MCP MySQL Server
A lightweight MCP server for MySQL, built with python
Overview
Simple MCP MySQL Server is a lightweight Model Context Protocol (MCP) server built with Python that enables secure interaction with MySQL databases, allowing AI assistants to execute SQL queries and retrieve data through a controlled interface.
To use the server, clone the repository, install dependencies, set the required environment variables for database access, and run the server using the provided commands. You can also configure it to work with Claude Desktop for easier access.
- List all MySQL tables in the database - Retrieve detailed schema information for all tables - Execute read-only SQL queries with proper error handling - Secure database access through environment variables - Simple configuration and deployment
- Enabling AI assistants to interact with MySQL databases securely.
- Facilitating data retrieval and manipulation through SQL queries.
- Providing a controlled environment for executing database operations.
Add to your AI client
Use these steps to connect Simple MCP MySQL Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp-mysql-server-alexcc4": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-mysql-server-alexcc4"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp-mysql-server-alexcc4": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-mysql-server-alexcc4"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp-mysql-server-alexcc4": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-mysql-server-alexcc4"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp-mysql-server-alexcc4": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-mysql-server-alexcc4"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-mysql-server-alexcc4": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-mysql-server-alexcc4"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp-mysql-server-alexcc4": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp-mysql-server-alexcc4"
]
}
}
}FAQ
Is the server secure for production use?
Yes, it is designed with security considerations, including using a database user with minimal permissions and avoiding root credentials.
What are the requirements to run the server?
You need Python 3.12.2+, a MySQL server, and the 'uv' package for optimal performance.
Can I use this server with other AI assistants?
Yes, it can be integrated with any AI assistant that supports the Model Context Protocol.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2691,"uuid":"1cefc328-0ce0-412d-b057-fae6b089abca","name":"mcp-mysql-server","title":"Simple MCP MySQL Server","description":"A lightweight MCP server for MySQL, built with python","avatar_url":"https://avatars.githubusercontent.com/u/5210569?v=4","created_at":"$D2025-03-13T09:39:09.664Z","updated_at":"$D2025-03-13T09:50:31.909Z","status":"created","author_name":"alexcc4","author_avatar_url":"https://avatars.githubusercontent.com/u/5210569?v=4","tags":"mysql,python,mcp-server","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/alexcc4/mcp-mysql-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"\",\"language\":\"Python\",\"is_official\":false,\"latest_commit_time\":\"2025-03-09 23:57:30\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]