Allows connection to and operations on a local MySQL database, including querying databases, viewing tables, and executing parameterized queries
MCP MySQL 本地数据库服务
MCP MySQL服务是一个轻量级的个人使用服务程序,用于连接和操作本地MySQL数据库。此服务可作为Cursor的MCP服务使用,通过API接口使Cursor能够轻松地执行各种数据库操作。
特性
- 连接本地MySQL数据库
- 提供RESTful API进行数据库操作
- 支持参数化查询防止SQL注入
- 支持SSE (Server-Sent Events) 推送能力
- 支持作为Cursor MCP服务集成
快速开始
前置条件
- Node.js (v14+)
- MySQL服务器
安装
- 克隆此仓库
- 安装依赖
- 创建并配置
.env
文件
运行
开发模式(自动重启):
API接口
获取所有数据库
获取数据库的所有表
获取表结构
执行查询
SSE连接
在Cursor中使用
SSE方式
Command方式
安全性考虑
- 此服务仅限本地使用,不建议暴露到公网
- 使用API密钥保护接口
- 默认只允许执行SELECT查询
许可证
MIT
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Facilitates interaction with a local MySQL database via a RESTful API, supporting database queries and real-time updates with integration for Cursor MCP services.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityEnables interaction with a MySQL database via JSON commands, supporting read-only queries, test execution of write queries, and table information retrieval through Docker.Last updated -4195JavaScriptMIT License
- AsecurityAlicenseAqualityConnect and interact with MySQL databases seamlessly. Execute SQL queries, manage database connections, and retrieve data directly through AI assistants. Enhance your AI capabilities with structured access to your MySQL data.Last updated -9114TypeScriptMIT License
- -securityFlicense-qualityA tool that provides simple API to execute SQL queries and manage MySQL databases, designed to integrate with Cursor IDE for AI assistants to directly perform database operations.Last updated -Python
- -securityFlicense-qualityAllows Cursor to interact with MySQL databases through the MCP protocol, enabling creation, querying, modification and deletion of database tables and records.Last updated -5JavaScript