mysql_mcp_server_pro
Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
claude mcp add --transport stdio wenb1n-dev-mysql_mcp_server_pro python -m mysql_mcp_server_pro.server \ --env MYSQL_HOST="localhost" \ --env MYSQL_PORT="3306" \ --env MYSQL_ROLE="readonly" \ --env MYSQL_USER="your_username" \ --env MYSQL_DATABASE="your_database" \ --env MYSQL_PASSWORD="your_password"
How to use
This MCP server provides a MySQL-focused toolkit that exposes a set of tools for performing SQL operations, health checks, schema discovery, and advanced analysis. It supports multiple MCP transfer modes and can be accessed via standard MCP clients. The included tools let you execute SQL commands with permission-based filtering, convert Chinese field names to pinyin initials, analyze database health and index usage, inspect table structures and locks, and optimize queries based on execution plans. You can also invoke prompt-based workflows and chain tool calls through the built-in prompts. To begin, configure your environment with your MySQL connection details, select the desired MCP transfer mode (stdio, SSE, or Streamable Http), and start the server. Then connect with an MCP client or integrate via UV-based or Python-based execution paths as demonstrated in the configuration examples.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- MySQL database accessible from the host
- pip available to install the package
Installation steps:
-
Install the MCP server package
- Command: pip install mysql_mcp_server_pro
-
Prepare environment configuration (optional but recommended)
- Create a .env file or set environment variables directly. Example .env content:
MySQL Database Configuration
MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USER=your_username MYSQL_PASSWORD=your_password MYSQL_DATABASE=your_databaseOptional, default is 'readonly'. Available values: readonly, writer, admin
MYSQL_ROLE=readonly
- Create a .env file or set environment variables directly. Example .env content:
-
Run the server (example using Python module invocation)
- Command: python -m mysql_mcp_server_pro.server
-
(Optional) Run in specific MCP transfer modes or with OAuth as needed. See README for mode flags and OAuth options.
Note: Ensure network access between the MCP server and your MySQL instance. If you use a custom environment file, start the server with the appropriate envfile flag if supported by your run method.
Additional notes
Tips and common considerations:
- The toolset includes execute_sql (SQL execution with permission filtering), get_table_desc, get_table_lock, get_db_health_running, get_db_health_index_usage, and more. Use the role configuration to limit destructive operations to admin or writer roles.
- If you enable OAuth, ensure your client can obtain and refresh tokens as required by your deployment.
- The server supports multiple SQL statements separated by semicolons in a single execution call.
- For client integrations, you can run the server via uvx (for MCP clients) or via direct Python module invocation as shown in the mcp_config example. Ensure your chosen method aligns with your deployment and security requirements.
- Use the provided prompts (analyzing-mysql-prompt, query-table-data-prompt) to guide the model through complex tasks like schema analysis and data querying workflows.
- If you encounter connection issues, verify MYSQL_HOST, MYSQL_PORT, and network accessibility from the server host to the MySQL instance. Also confirm user privileges match the selected MYSQL_ROLE.
Related MCP Servers
mysql_mcp_server
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
MCP-Bridge
A middleware to provide an openAI compatible endpoint that can call MCP tools
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
SmartDB_MCP
Universal database MCP server connecting to MySQL, PostgreSQL, SQL Server, MariaDB,DM8,Oracle,not only provides basic database connection such as OAuth 2.0 authentication , health checks, SQL optimization, and index health detection
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
mcp_autogen_sse_stdio
This repository demonstrates how to use AutoGen to integrate local and remote MCP (Model Context Protocol) servers. It showcases a local math tool (math_server.py) using Stdio and a remote Apify tool (RAG Web Browser Actor) via SSE for tasks like arithmetic and web browsing.