MySQL MCP服务器
About
在 cursor 工具中通过 mysql mcp 服务读取本地 mysql 库,方便通过 AI 来编程开发
Details
- Author
- lichuanrong7
- GitHub stars
- 17
- Downloads
- 476
- Categories
- Database, API
Jump to
- 支持SELECT、INSERT、UPDATE、DELETE等SQL语句执行
- 获取数据库表的详细结构信息
- 为AI提供实时数据库访问能力
- 通过环境变量配置数据库连接参数
- 内置CORS支持,便于前端应用集成
- 完整实现MCP协议,方便与Cursor AI集成
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MySQL MCP服务器Command (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
安装依赖并配置环境变量后,启动服务,然后在Cursor编辑器的MCP扩展管理界面添加服务URL http://localhost:3100/manifest.json 并激活。激活后可在Cursor中使用自然语言操作数据库。
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mysql mcp\u670d\u52a1\u5668": {
"mysql-mcp-server-lichuanrong7": {
"command": "docker",
"args": [
"build",
"-t",
"mysql-mcp-server",
"."
]
}
}
}
}
McpServers
{
"mysql-mcp-server-lichuanrong7": {
"command": "docker",
"args": [
"build",
"-t",
"mysql-mcp-server",
"."
]
}
}
MySQL MCP服务器
<div align="center">
<h3>MySQL MCP服务</h3>
<p>为Cursor提供MySQL数据库连接与查询能力的MCP服务</p>
</div>
📖 项目介绍
MySQL MCP服务是一个基于Node.js开发的API服务,为Cursor AI提供直接访问MySQL数据库的能力。该服务遵循MCP(Model Control Platform)协议规范,使AI能够通过标准化接口执行SQL查询、获取表结构信息,以及执行数据操作。
✨ 功能特性
- SQL查询执行:支持执行各种SQL语句(SELECT, INSERT, UPDATE, DELETE等)
- 表结构查询:获取数据库表的详细结构信息
- 实时数据访问:为AI提供实时数据库访问能力
- 安全连接:支持通过环境变量配置数据库连接参数
- 跨域支持:内置CORS支持,便于前端应用集成
- 标准化响应:统一的API响应格式,简化集成和使用
- MCP协议支持:完整实现MCP协议,方便与Cursor AI集成
🔧 技术栈
- 运行环境:Node.js
- 主要框架:Express.js
- 数据库驱动:mysql2
- 环境变量:dotenv
- 跨域支持:cors
🚀 安装与部署
前置条件
- Node.js 14.x 或更高版本
- MySQL数据库可连接
- Git(可选,用于克隆代码)
安装步骤
1. 克隆代码仓库
git clone https://github.com/lichuanrong7/mysql-mcp-server.git
cd mysql-mcp-server
2. 安装依赖
npm install
3. 配置环境变量
创建或编辑 .env 文件,添加以下配置:
```
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



