mcp_mysql_server

by MCP-Mirror

317 downloads
Not rated
GitHub

About

mcpmysqlserver is a MySQL database MCP server that supports CRUD operations, database anomaly analysis, and custom tool extensions. It is intended for developers who need to interact with MySQL databases through an MCP client with role‑based permissions and built-in diagnostics.

Details

Author
MCP-Mirror
Downloads
317
Categories
Database

- Execute multiple SQL statements separated by ";"
- Query table names and fields using table comments
- Analyze SQL execution plans
- Convert Chinese field names to pinyin initials
- Detect row-level and table-level locks
- Assess MySQL health status (connections, transactions, locks)
- Permission control with three roles (readonly, writer, admin)
- Supports both STDIO and SSE transport modes

Install the package with pip install mysql_mcp_server_pro, create a .env file with MySQL connection details and the desired role (readonly, writer, or admin), then start the server via mysql_mcp_server_sse for SSE mode or using uvx/uv for STDIO mode. Configure your MCP client with the appropriate JSON settings.

mcp_mysql_server

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 both STDIO and SSE modes
- 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 |

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

2. Configure Environment Variables
Create a .env file with the following content:
```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.