mysql-mcp MCP Server

这是一个专为 Cursor 设计的MySQL数据库 MCP (Model Context Protocol) 服务,提供表结构查询、文档生成和数据查询功能。

Local serverstdio

What is the mysql-mcp Server?

mysql-mcp is an MCP project maintained in the gcluowenqiang/mysql-mcp repository. The maintainer describes its purpose as “这是一个专为 Cursor 设计的MySQL数据库 MCP (Model Context Protocol) 服务,提供表结构查询、文档生成和数据查询功能。”. Read the project documentation for the complete scope.

Local setup

The project provides a local client configuration using python. Follow the repository’s build and installation steps before copying it, and replace example paths with the paths on your own computer.

Configuration values

The example declares MYSQL_HOST, MYSQL_PORT, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_SECURITY_MODE, MYSQL_ALLOWED_SCHEMAS, MYSQL_ENABLE_QUERY_LOG. Secret-looking values have been replaced with placeholders. Required and optional labels are shown only when the documentation states them.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

How to install the mysql-mcp Server

{
  "mcpServers": {
    "mysql-mcp": {
      "command": "python",
      "args": [
        "F:/path/to/mysql-mcp/main.py"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USERNAME": "your_username",
        "MYSQL_PASSWORD": "YOUR_MYSQL_PASSWORD",
        "MYSQL_DATABASE": "your_database",
        "MYSQL_SECURITY_MODE": "readonly",
        "MYSQL_ALLOWED_SCHEMAS": "*",
        "MYSQL_ENABLE_QUERY_LOG": "false"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
MYSQL_HOSTDeclared in the maintainer’s client configuration.Check documentation
MYSQL_PORTDeclared in the maintainer’s client configuration.Check documentation
MYSQL_USERNAMEDeclared in the maintainer’s client configuration.Check documentation
MYSQL_PASSWORDDeclared in the maintainer’s client configuration.Check documentation
MYSQL_DATABASEDeclared in the maintainer’s client configuration.Check documentation
MYSQL_SECURITY_MODEDeclared in the maintainer’s client configuration.Check documentation
MYSQL_ALLOWED_SCHEMASDeclared in the maintainer’s client configuration.Check documentation
MYSQL_ENABLE_QUERY_LOGDeclared in the maintainer’s client configuration.Check documentation