MySQL MCP Server

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

  • Enables secure access to MySQL databases with capabilities for reading data (SELECT queries, listing tables, viewing schemas), writing data (INSERT/UPDATE/DELETE with transaction support), and security features like read-only transaction modes and parameterized queries.

  • Requires Node.js 18+ as a runtime environment for the server to operate.

MySQL MCP 服务器

与 MySQL 数据库集成的 MCP 服务器实现,为 LLM 提供安全的数据库访问功能。

特征

  • 读取操作
    • 执行只读 SELECT 查询
    • 列出所有数据库表
    • 显示表结构
    • 查看架构信息
  • 写入操作
    • 使用事务支持执行 INSERT/UPDATE/DELETE
    • 数据安全的参数化查询
    • 返回受影响的行和插入 ID
  • 安全
    • SELECT 查询的只读事务模式
    • 查询长度和结果大小限制
    • 性能监控和日志记录
    • 自动交易处理

安装

npm install -g @kevinwatt/mysql-mcp

Dive Desktop一起使用

  1. 在 Dive Desktop 中点击“+ 添加 MCP 服务器”
  2. 复制并粘贴此配置:
{ "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" } } } }
  1. 点击“保存”安装 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
  • 数据库
  • 潜水
  • 法学硕士
  • 人工智能
-
security - not tested
A
license - permissive license
-
quality - not tested

与 MySQL 数据库集成的 MCP 服务器,通过 LLM 驱动的接口实现安全的读写操作,并支持事务处理和性能监控。

  1. Features
    1. Installation
      1. Usage with Dive Desktop
        1. Tool Documentation
          1. Usage Examples
            1. Manual Start
              1. Requirements
                1. License
                  1. Author
                    1. Keywords
                      ID: 0zlx06wtft