remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
Allows AI models to interact with MySQL databases through a standardized interface, enabling operations like connecting to a database, executing queries, listing tables, and describing table structures.
@f4ww4z/mcp-mysql-服务器
提供 MySQL 数据库操作的模型上下文协议服务器。该服务器使 AI 模型能够通过标准化接口与 MySQL 数据库交互。
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 MySQL 服务器:
手动安装
配置
服务器需要在您的 MCP 设置配置文件中设置以下环境变量:
可用工具
1. 连接数据库
使用提供的凭据建立与 MySQL 数据库的连接。
2. 查询
使用可选的准备好的语句参数执行 SELECT 查询。
3. 执行
使用可选的准备好的语句参数执行 INSERT、UPDATE 或 DELETE 查询。
4. 列表表
列出所连接数据库中的所有表。
5. describe_table
获取特定表的结构。
特征
- 通过自动清理来安全处理连接
- 查询参数的预处理语句支持
- 全面的错误处理和验证
- TypeScript 支持
- 自动连接管理
安全
- 使用准备好的语句来防止 SQL 注入
- 支持通过环境变量进行安全密码处理
- 执行前验证查询
- 完成后自动关闭连接
错误处理
服务器提供了常见问题的详细错误消息:
- 连接失败
- 无效查询
- 缺少参数
- 数据库错误
贡献
欢迎贡献!请随时向https://github.com/f4ww4z/mcp-mysql-server提交 Pull 请求。
执照
麻省理工学院
You must be authenticated.
该服务器使AI模型能够通过标准化接口与MySQL数据库进行交互。