MySQL MCP服务器
@lichuanrong7
About MySQL MCP服务器
在 cursor 工具中通过 mysql mcp 服务读取本地 mysql 库,方便通过 AI 来编程开发
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mysql-mcp-server-lichuanrong7": {
"command": "docker",
"args": [
"build",
"-t",
"mysql-mcp-server",
"."
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MySQL MCP服务器?
MySQL MCP服务器是一个基于Node.js的API服务,为Cursor AI提供直接访问MySQL数据库的能力。它遵循MCP(Model Control Platform)协议规范,使AI能够通过标准化接口执行SQL查询、获取表结构信息以及执行数据操作。
How to use MySQL MCP服务器?
安装依赖并配置环境变量后,启动服务,然后在Cursor编辑器的MCP扩展管理界面添加服务URL http://localhost:3100/manifest.json 并激活。激活后可在Cursor中使用自然语言操作数据库。
Key features of MySQL MCP服务器
- 支持SELECT、INSERT、UPDATE、DELETE等SQL语句执行
- 获取数据库表的详细结构信息
- 为AI提供实时数据库访问能力
- 通过环境变量配置数据库连接参数
- 内置CORS支持,便于前端应用集成
- 完整实现MCP协议,方便与Cursor AI集成
Use cases of MySQL MCP服务器
- 在Cursor中通过自然语言查询数据库记录
- 获取指定表的字段、类型等结构信息
- 执行数据插入、更新、删除等操作
- 统计数据库中的订单状态分布等聚合数据
FAQ from MySQL MCP服务器
如何启动与停止服务?
使用 ./start.sh 启动服务,使用 ./stop.sh 停止服务;或通过 npm run dev(开发模式)和 npm start(生产模式)启动。
数据库连接失败怎么办?
验证.env中的数据库连接信息是否正确,确认数据库服务是否运行,并检查网络连接和防火墙设置。
服务无法启动怎么办?
检查端口是否被占用(如 lsof -i :3100),确认Node.js版本是否兼容(要求14.x或更高),并查看日志文件 ./logs/mysql-mcp-*.log。
如何验证服务是否正常运行?
执行 curl http://localhost:3100/manifest.json 检查服务是否返回JSON清单。
是否支持Docker部署?
是。可通过 docker build -t mysql-mcp-server . 构建镜像,并使用 docker-compose up -d 启动。
More Databases MCP servers

Redis
modelcontextprotocolModel Context Protocol Servers
mcp_mysql_server
wenb1n-devModel Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
Elasticsearch/OpenSearch MCP Server
cr7258A Model Context Protocol (MCP) server implementation that provides Elasticsearch and OpenSearch interaction.
MCP MongoDB Server
kiliczshA Model Context Protocol Server for MongoDB
Sail MCP Server for Spark SQL
lakehqDrop-in Apache Spark replacement written in Rust, unifying batch processing, stream processing, and compute-intensive AI workloads.
Comments