MySQL MCP Server
MySQL MCP 服务器
与 MySQL 数据库集成的 MCP 服务器实现,为 LLM 提供安全的数据库访问功能。
特征
读取操作
执行只读 SELECT 查询
列出所有数据库表
显示表结构
查看架构信息
写入操作
使用事务支持执行 INSERT/UPDATE/DELETE
数据安全的参数化查询
返回受影响的行和插入 ID
安全
SELECT 查询的只读事务模式
查询长度和结果大小限制
性能监控和日志记录
自动交易处理
Related MCP server: DatabaseMCP
安装
npm install -g @kevinwatt/mysql-mcp与Dive Desktop一起使用
在 Dive Desktop 中点击“+ 添加 MCP 服务器”
复制并粘贴此配置:
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": [
"-y",
"@kevinwatt/mysql-mcp"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "",
"MYSQL_DB": "your_database"
}
}
}
}点击“保存”安装 MCP 服务器
工具文档
mysql_query
执行只读 SELECT 查询
输入:
sql(字符串):要执行的 SQL SELECT 查询
限制:
最大查询长度:4096 个字符
最大结果行数:1000
查询超时:30秒
mysql_execute
执行数据修改操作
输入:
sql(字符串):SQL 语句(INSERT/UPDATE/DELETE)params(数组,可选):SQL 语句的参数
特征:
返回受影响的行数
返回最后一个插入 ID
自动交易处理
列表表
列出当前数据库中的所有表
无需输入
描述表
显示表结构
输入:
table(字符串):要描述的表名称
使用示例
要求你的法学硕士:
"Show me all tables in the database"
"Describe the structure of users table"
"Select all active users from the database"
"Insert a new record into orders table"手动启动
如果需要,请手动启动服务器:
npx @kevinwatt/mysql-mcp要求
Node.js 18+
MySQL服务器
MCP 兼容的 LLM 服务
执照
麻省理工学院
作者
颜德伟
关键词
甲基氯丙烯
mysql
数据库
潜水
法学硕士
人工智能
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Cloud-hosted MCP server for secure AI access to enterprise data sources via CData Connect AI.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA high-performance MCP server that enables AI assistants to safely interact with MySQL databases through secure CRUD operations, schema inspection, and parameterized queries with built-in SQL injection prevention.1-
- FlicenseNot gradedqualityBmaintenanceAn MCP server that enables AI agents to safely explore and interact with MySQL databases through dynamic tool generation from stored procedures. It provides database discovery capabilities and intelligent procedure categorization while enforcing security restrictions to prevent data modification.-
- AlicenseNot gradedqualityDmaintenanceA MySQL MCP server for secure database interaction, enabling schema inspection, query execution, and RBAC via AI coding assistants.392 npm5MIT
- AlicenseNot gradedqualityCmaintenanceA secure and efficient MCP server for MySQL database operations, enabling LLMs to execute SQL queries with read-only access by default and optional write permissions.3MIT