@davewind/mysql-mcp-服务器
提供对 Mysql 数据库的只读访问的模型上下文协议 (MCP) 服务器。该服务器使 LLM 能够检查数据库模式并执行只读查询。
主要特点
1.只读数据库访问:通过 SQL 验证和只读事务强制执行只读操作
2.Schema Discovery:自动识别并公开数据库表结构
3.SQL查询执行:提供接受并执行SELECT语句的查询工具
4.模型上下文协议合规性:实现 MCP 规范,与兼容的 LLM 无缝集成
5.配置简单:只需极少的配置即可轻松设置
工具
- 询问
- 对连接的数据库执行只读 SQL 查询
- 输入:
sql
(字符串):要执行的 SQL 查询 - 所有查询都在只读事务中执行
资源
服务器为数据库中的每个表提供架构信息:
- 表模式(
mysql://user:password@localhost:3306/database
)- 每个表的 JSON 架构信息
- 包括列名和数据类型
- 从数据库元数据中自动发现
安装
配置
MCP设置配置文件:
建议使用
测试
替换 mysql://user@localhost/ 和 npm run inspector
环境
系统架构
MySQL MCP 服务器充当 LLM 和 MySQL 数据库之间的中介,根据模型上下文协议处理请求。
组件交互
组件交互
安全模型
MySQL MCP 服务器实现了严格的安全模型,以确保数据库访问是只读的。
安全措施包括:
1.SQL 查询验证仅允许 SELECT 语句 2.在 READ ONLY 事务中执行所有查询 3.不支持数据修改操作(INSERT、UPDATE、DELETE 等) 4.不支持数据库模式修改(CREATE、ALTER、DROP 等)
与法学硕士 (LLM) 的整合
MySQL MCP 服务器旨在与任何支持模型上下文协议 (MCP) 的 LLM 系统兼容。它遵循 MCP 规范,通过 stdio 上的 JSON-RPC 进行通信。
执照
麻省理工学院
This server cannot be installed
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.
为 LLM 提供 MySQL 数据库只读访问权限的服务器,允许他们检查数据库模式并执行只读查询。
Related MCP Servers
- -securityAlicense-qualityEnables LLMs to interact with MySQL databases by inspecting schemas and executing safe, read-only queries within transactions.Last updated -6JavaScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that provides read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.Last updated -5,426418TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server providing read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.Last updated -5,426TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that provides read-only access to MySQL databases, enabling LLMs to inspect database schemas and execute read-only queries.Last updated -5,426MIT License