MySQL MCP Server Pro

Databases

Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展.

Your AI app calls MySQL MCP Server Pro, which does the databases work and sends the result back to the chat.

About MySQL MCP Server Pro

MySQL MCP Server Pro is a community MCP server from wenb1n-dev, filed in our directory under databases. Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展.

At a glance

Publisher
wenb1n-dev (community)
Runs
See the README for setup
Written in
Python
License
MIT
GitHub stars
249

How to set up MySQL MCP Server Pro

  1. Follow the install steps in the MySQL MCP Server Pro README; it is written in Python, so have that toolchain ready.
  2. Check the MySQL MCP Server Pro README for keys or settings; the registry lists none that MySQL MCP Server Pro requires.
  3. Add MySQL MCP Server Pro to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the MySQL MCP Server Pro tools to confirm the connection.
  5. Run one read-only task with MySQL MCP Server Pro first, and keep your app asking before each tool call until the results look right.

MySQL MCP Server Pro compared with similar servers

  • Milvus by zilliztech has fewer GitHub stars than MySQL MCP Server Pro (244 against 249); both are community servers, and both run locally.
  • MCPBench by modelscope has more GitHub stars than MySQL MCP Server Pro (251 against 249); both are community servers, and both run locally.
  • Parse Dmarc by dmarcguardhq has fewer GitHub stars than MySQL MCP Server Pro (238 against 249); both are community servers, and both run locally.

Before you connect MySQL MCP Server Pro

  • Give MySQL MCP Server Pro its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each MySQL MCP Server Pro tool call until you trust what it does with them.
  • Treat text that MySQL MCP Server Pro fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for MySQL MCP Server Pro on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for MySQL MCP Server Pro

How marketing and sales teams put MySQL MCP Server Pro to work, by company size. Pick the size closest to yours and start MySQL MCP Server Pro on one use case.

Small business

  • A small business with its own app can ask MySQL MCP Server Pro plain questions about customers and orders, without writing SQL.
  • Owners can use MySQL MCP Server Pro to pull a list of customers who haven't bought in 90 days and plan a win-back email.
  • MySQL MCP Server Pro runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing analysts can connect MySQL MCP Server Pro to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Lifecycle teams can use MySQL MCP Server Pro to build audience lists from product data and check counts before a send.
  • Start MySQL MCP Server Pro on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should point MySQL MCP Server Pro at a read replica with a read-only role, so agents query freely without risk to production data.
  • Data teams can expose curated views through MySQL MCP Server Pro, so marketing gets self-serve answers without access to raw customer tables.
  • MySQL MCP Server Pro is a community server, so have security review the code and pin a version before MySQL MCP Server Pro touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

MySQL MCP Server Pro README

From wenb1n-dev/mysql_mcp_server_pro on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

mcp_mysql_server_pro

Introduction

mcp_mysql_server_pro is not just about MySQL CRUD operations, but also includes database anomaly analysis capabilities and makes it easy for developers to extend with custom tools.

  • Supports all Model Context Protocol (MCP) transfer modes (STDIO, SSE, Streamable Http)
  • Supports OAuth2.0
  • Supports multiple SQL execution, separated by ";"
  • Supports querying database table names and fields based on table comments
  • Supports SQL execution plan analysis
  • Supports Chinese field to pinyin conversion
  • Supports table lock analysis
  • Supports database health status analysis
  • Supports permission control with three roles: readonly, writer, and admin
    "readonly": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN"],  # Read-only permissions
    "writer": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE"],  # Read-write permissions
    "admin": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE", 
             "CREATE", "ALTER", "DROP", "TRUNCATE"]  # Administrator permissions
    
  • Supports prompt template invocation

Tool List

Tool Name Description
execute_sql SQL execution tool that can execute ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE", "CREATE", "ALTER", "DROP", "TRUNCATE"] commands based on permission configuration
get_chinese_initials Convert Chinese field names to pinyin initials
get_db_health_running Analyze MySQL health status (connection status, transaction status, running status, lock status detection)
get_table_desc Search for table structures in the database based on table names, supporting multi-table queries
get_table_index Search for table indexes in the database based on table names, supporting multi-table queries
get_table_lock Check if there are row-level locks or table-level locks in the current MySQL server
get_table_name Search for table names in the database based on table comments and descriptions
get_db_health_index_usage Get the index usage of the currently connected mysql database, including redundant index situations, poorly performing index situations, and the top 5 unused index situations with query times greater than 30 seconds
optimize_sql Professional SQL performance optimization tool, providing expert optimization suggestions based on MySQL execution plans, table structure information, table data volume, and table indexes.
use_prompt_queryTableData Use built-in prompts to let the model construct a chain call of tools in mcp (not a commonly used fixed tool, you need to modify the code to enable it, see this class for details)

Prompt List

Prompt Name Description
analyzing-mysql-prompt This is a prompt for analyzing MySQL-related issues
query-table-data-prompt This is a prompt for querying table data using tools. If description is empty, it will be initialized as a MySQL database query assistant

Usage Instructions

Installation and Configuration
  1. Install Package
pip install mysql_mcp_server_pro
  1. Configure Environment Variables Create a .env file with the following content:
# MySQL Database Configuration
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
# Optional, default is 'readonly'. Available values: readonly, writer, admin
MYSQL_ROLE=readonly
  1. Run Service
# SSE mode
mysql_mcp_server_pro --mode sse --envfile /path/to/.env

## Streamable Http mode (default)
mysql_mcp_server_pro --envfile /path/to/.env

# Streamable Http  oauth Authentication
mysql_mcp_server_pro --oauth true
  1. mcp client

go to see see "Use uv to start the service" ^_^

Note:

  • The .env file should be placed in the directory where you run the command or use --envfile parameter to specify the path
  • You can also set these variables directly in your environment
  • Make sure the database configuration is correct and can connect
Run with uvx, Client Configuration
  • This method can be used directly in MCP-supported clients, no need to download the source code. For example, Tongyi Qianwen plugin, trae editor, etc.
{
    "mcpServers": {
        "mysql": {
            "command": "uvx",
            "args": [
                "--from",
                "mysql_mcp_server_pro",
                "mysql_mcp_server_pro",
                "--mode",
                "stdio"
            ],
            "env": {
                "MYSQL_HOST": "192.168.x.xxx",
                "MYSQL_PORT": "3306",
                "MYSQL_USER": "root",
                "MYSQL_PASSWORD": "root",
                "MYSQL_DATABASE": "a_llm",
                "MYSQL_ROLE": "admin"
            }
        }
    }
}
Local Development with Streamable Http mode
  • Use uv to start the service

Add the following content to your mcp client tools, such as cursor, cline, etc.

mcp json as follows:

{
  "mcpServers": {
    "mysql_mcp_server_pro": {
      "name": "mysql_mcp_server_pro",
      "type": "streamableHttp",
      "description": "",
      "isActive": true,
      "url": "http://localhost:3000/mcp/"
    }
  }
}

Modify the .env file content to update the database connection information with your database details:

# MySQL Database Configuration
MYSQL_HOST=192.168.xxx.xxx
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=root
MYSQL_DATABASE=a_llm
MYSQL_ROLE=admin

Start commands:

# Download dependencies
uv sync

# Start
uv run -m mysql_mcp_server_pro.server

# Custom env file location
uv run -m mysql_mcp_server_pro.server --envfile /path/to/.env

# oauth Authentication
uv run -m mysql_mcp_server_pro.server --oauth true
Local Development with SSE Mode
  • Use uv to start the service

Add the following content to your mcp client tools, such as cursor, cline, etc.

mcp json as follows:

{
  "mcpServers": {
    "mysql_mcp_server_pro": {
      "name": "mysql_mcp_server_pro",
      "description": "",
      "isActive": true,
      "url": "http://localhost:9000/sse"
    }
  }
}

Modify the .env file content to update the database connection information with your database details:

# MySQL Database Configuration
MYSQL_HOST=192.168.xxx.xxx
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=root
MYSQL_DATABASE=a_llm
MYSQL_ROLE=admin

Start commands:

# Download dependencies
uv sync

# Start
uv run -m mysql_mcp_server_pro.server --mode sse

# Custom env file location
uv run -m mysql_mcp_server_pro.server --mode sse --envfile /path/to/.env
Local Development with STDIO Mode

Add the following content to your mcp client tools, such as cursor, cline, etc.

mcp json as follows:

{
  "mcpServers": {
      "operateMysql": {
        "isActive": true,
        "name": "operateMysql",
        "command": "uv",
        "args": [
          "--directory",
          "/Volumes/mysql_mcp_server_pro/src/mysql_mcp_server_pro",    # Replace this with your project path
          "run",
          "-m",
          "mysql_mcp_server_pro.server",
          "--mode",
          "stdio"
        ],
        "env": {
          "MYSQL_HOST": "localhost",
          "MYSQL_PORT": "3306",
          "MYSQL_USER": "root", 
          "MYSQL_PASSWORD": "123456",
          "MYSQL_DATABASE": "a_llm",
          "MYSQL_ROLE": "admin"
       }
    }
  }
} 

Custom Tool Extensions

  1. Add a new tool class in the handles package, inherit from BaseHandler, and implement get_tool_description and run_tool methods

  2. Import the new tool in init.py to make it available in the server

OAuth2.0 Authentication

  1. Start the authentication service. By default, it uses the built-in OAuth 2.0 password mode authentication. You can modify your own authentication service address in the env file.
uv run -m mysql_mcp_server_pro.server --oauth true
  1. Visit the authentication service at http://localhost:3000/login. Default username and password are configured in the env file.

  2. Copy the token and add it to the request headers, for example:

{
  "mcpServers": {
    "mysql_mcp_server_pro": {
      "name": "mysql_mcp_server_pro",
      "type": "streamableHttp",
      "description": "",
      "isActive": true,
      "url": "http://localhost:3000/mcp/",
      "headers": {
        "authorization": "bearer TOKEN_VALUE"
      }
    }
  }
}

Examples

  1. Create a new table and insert data, prompt format as follows:
# Task
   Create an organizational structure table with the following structure: department name, department number, parent department, is valid.
# Requirements
 - Table name: department
 - Common fields need indexes
 - Each field needs comments, table needs comment
 - Generate 5 real data records after creation
  1. Query data based on table comments, prompt as follows:
Search for data with Department name 'Executive Office' in Department organizational structure table
  1. Analyze slow SQL, prompt as follows:
select * from t_jcsjzx_hjkq_cd_xsz_sk xsz
left join t_jcsjzx_hjkq_jcd jcd on jcd.cddm = xsz.cddm 
Based on current index situation, review execution plan and provide optimization suggestions in markdown format, including table index status, execution details, and optimization recommendations
  1. Analyze SQL deadlock issues, prompt as follows:
update t_admin_rms_zzjg set sfyx = '0' where xh = '1' is stuck, please analyze the cause
  1. Analyze the health status prompt as follows
Check the current health status of MySQL

Questions about MySQL MCP Server Pro

What is the MySQL MCP Server Pro MCP server?

Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展. MySQL MCP Server Pro is maintained by wenb1n-dev on GitHub at wenb1n-dev/mysql_mcp_server_pro, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the MySQL MCP Server Pro MCP server?

MySQL MCP Server Pro doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (wenb1n-dev/mysql_mcp_server_pro). Like most servers, MySQL MCP Server Pro ends with a command or URL you paste into your AI app's MCP config.

Does MySQL MCP Server Pro need an API key?

The registry lists no required keys for MySQL MCP Server Pro. Check the MySQL MCP Server Pro README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is MySQL MCP Server Pro an official MCP server?

No. MySQL MCP Server Pro is a community server maintained by wenb1n-dev. Community servers can be excellent; read the code and the open issues before you give MySQL MCP Server Pro access to company data.

What license is MySQL MCP Server Pro under?

MySQL MCP Server Pro is released under the MIT license, according to its GitHub repository. The license covers the code of MySQL MCP Server Pro; the service it connects to has its own terms.