mysql
A server application designed on top of MCP to interact with Cursor and MySQL.
claude mcp add --transport stdio mineru98-mysql-mcp-server docker run -d --name mcp-mysql -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASSWORD=mcpTest1234!!! -e MYSQL_DATABASE=mcp_test -e MCP_PORT=8081 -p 3306:3306 mineru/mcp-mysql:1.0.0 \ --env MCP_PORT="8081" \ --env MYSQL_HOST="localhost" \ --env MYSQL_PORT="3306" \ --env MYSQL_USER="root" \ --env MYSQL_DATABASE="mcp_test" \ --env MYSQL_PASSWORD="your-database-password"
How to use
This MCP server provides a set of tools to interact with a MySQL database via the Model Context Protocol. The server exposes executors such as create_table, desc_table, explain, insert_query, show_tables, and select_query, enabling an AI model to programmatically manage schema, inspect tables, run queries, and fetch results. Tools are registered and accessible through the MCP interface, allowing dynamic tool discovery and execution. To use it, connect to the MCP server (typically on port 8081 inside your deployment) and request the list of available tools, then issue tool-specific execution requests with the appropriate parameters. The architecture separates the AI-facing controller from the Executors (which perform actual database operations), ensuring a clean model-to-action workflow.
How to install
Prerequisites:
- Docker (and Docker Compose if using docker-compose)
- Access to a MySQL instance or the ability to run one in Docker
- Basic familiarity with environment variables for database credentials
Option A: Docker
-
Pull and run the server with the provided environment variables:
docker run -d --name mcp-mysql
-e MYSQL_HOST=localhost
-e MYSQL_PORT=3306
-e MYSQL_USER=root
-e MYSQL_PASSWORD=mcpTest1234!!!
-e MYSQL_DATABASE=mcp_test
-e MCP_PORT=8081
-p 3306:3306 mineru/mcp-mysql:1.0.0 -
Ensure the MySQL instance is accessible at the configured host/port and that MCP_PORT (8081 by default) is reachable.
Option B: Docker Compose
-
Use the pre-configured setup:
docker-compose up -d
-
The stack will start the MySQL database and the MCP server as defined in the compose file.
Option C: Python (development)
-
Install dependencies:
pip install -r requirements.txt
-
Run the server:
python mysql_mcp_server/main.py run
Note: Ensure .env contains the required credentials if using the Python setup.
Additional notes
Tips and considerations:
- Keep database credentials secure. Use strong passwords in production and consider using a secrets manager.
- The MCP tools include create_table, desc_table, explain, insert_query, show_tables, and select_query. Tools must be imported and registered in the server as described in the repository documentation.
- If you modify tools, update the init.py exports so the TOOLS_DEFINITION set remains accurate.
- For security, enable network-restriction or authentication on the MCP endpoint to prevent unauthorized access.
- When running via Docker, ensure MySQL_HOST points to a reachable host (localhost may refer to the container itself; use host.docker.internal or an external hostname as needed).
- Check logs via docker logs mcp-mysql or the equivalent Python process logs for troubleshooting.
Related MCP Servers
mysql_mcp_server
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
AgentChat
AgentChat 是一个基于 LLM 的智能体交流平台,内置默认 Agent 并支持用户自定义 Agent。通过多轮对话和任务协作,Agent 可以理解并协助完成复杂任务。项目集成 LangChain、Function Call、MCP 协议、RAG、Memory、Milvus 和 ElasticSearch 等技术,实现高效的知识检索与工具调用,使用 FastAPI 构建高性能后端服务。
ReActMCP
ReActMCP is a reactive MCP client that empowers AI assistants to instantly respond with real-time, Markdown-formatted web search insights powered by the Exa API.
mysql -sse
MySQL query server based on the MCP sse.Multi-level SQL risk control & injection protection Docker support for quick deployment
jmeter
✨ JMeter Meets AI Workflows: Introducing the JMeter MCP Server! 🤯
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian