Skip to main content
Glama

MySQL MCP Server

by kevinwatt

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

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

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

  1. 特征
    1. 安装
      1. 与Dive Desktop一起使用
        1. 工具文档
          1. 使用示例
            1. 手动启动
              1. 要求
                1. 执照
                  1. 作者
                    1. 关键词

                      Related MCP Servers

                      • -
                        security
                        A
                        license
                        -
                        quality
                        A 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,426
                        418
                        TypeScript
                        MIT License
                        • Linux
                        • Apple
                      • A
                        security
                        A
                        license
                        A
                        quality
                        An MCP server that provides read-only access to MySQL databases.
                        Last updated -
                        4
                        419
                        17
                        JavaScript
                        MIT License
                        • Linux
                        • Apple
                      • -
                        security
                        A
                        license
                        -
                        quality
                        A 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,426
                        MIT License
                      • A
                        security
                        A
                        license
                        A
                        quality
                        An MCP server that enables LLMs to perform blockchain operations on the Base network through natural language commands, including wallet management, balance checking, and transaction execution.
                        Last updated -
                        4
                        4
                        1
                        TypeScript
                        MIT License
                        • Apple

                      View all related MCP servers

                      MCP directory API

                      We provide all the information about MCP servers via our MCP API.

                      curl -X GET 'https://glama.ai/api/mcp/v1/servers/kevinwatt/mysql-mcp'

                      If you have feedback or need assistance with the MCP directory API, please join our Discord server