Skip to main content
Glama

mysqldb-mcp-server

mysqldb-mcp-server MCP 服务器

MySQL 数据库 MCP 服务器项目。

安装

您可以使用uv安装该软件包:

uv pip install mysqldb-mcp-server

或者使用pip

pip install mysqldb-mcp-server

成分

工具

服务器提供了两个工具:

  • connect_database :连接到特定的 MySQL 数据库
    • database参数:要连接的数据库的名称(字符串)
    • 连接成功时返回确认消息
  • execute_query MySQL 查询
    • query参数:要执行的 SQL 查询/查询(字符串)
    • 以 JSON 格式返回查询结果
    • 可以发送多个查询,以分号分隔

配置

服务器使用以下环境变量:

  • MYSQL_HOST :MySQL 服务器地址(默认:“localhost”)
  • MYSQL_USER :MySQL 用户名(默认值:“root”)
  • MYSQL_PASSWORD :MySQL 密码(默认值:“”)
  • MYSQL_DATABASE :初始数据库(可选)
  • MYSQL_READONLY :只读模式(设置为 1/true 以启用,默认值:false)

快速入门

安装

克劳德桌面

MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "mysqldb-mcp-server": { "command": "uv", "args": [ "--directory", "/Users/burakdirin/Projects/mysqldb-mcp-server", "run", "mysqldb-mcp-server" ], "env": { "MYSQL_HOST": "localhost", "MYSQL_USER": "root", "MYSQL_PASSWORD": "password", "MYSQL_DATABASE": "[optional]", "MYSQL_READONLY": "true" } } } }
{ "mcpServers": { "mysqldb-mcp-server": { "command": "uvx", "args": [ "mysqldb-mcp-server" ], "env": { "MYSQL_HOST": "localhost", "MYSQL_USER": "root", "MYSQL_PASSWORD": "password", "MYSQL_DATABASE": "[optional]", "MYSQL_READONLY": "true" } } } }

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 MySQL 数据库集成服务器:

npx -y @smithery/cli install @burakdirin/mysqldb-mcp-server --client claude

发展

构建和发布

准备分发包:

  1. 同步依赖项并更新锁文件:
uv sync
  1. 构建软件包分发版:
uv build

这将在dist/目录中创建源和轮子分布。

  1. 发布到 PyPI:
uv publish

注意:您需要通过环境变量或命令标志设置 PyPI 凭据:

  • 令牌: --tokenUV_PUBLISH_TOKEN
  • 或用户名/密码: --username / UV_PUBLISH_USERNAME--password / UV_PUBLISH_PASSWORD

调试

由于 MCP 服务器通过 stdio 运行,调试起来可能比较困难。为了获得最佳调试体验,我们强烈建议使用MCP Inspector

您可以使用以下命令通过npm启动 MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /Users/burakdirin/Projects/mysqldb-mcp-server run mysqldb-mcp-server

启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。

-
security - not tested
A
license - permissive license
-
quality - not tested

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.

一个 MCP 服务器,支持 MySQL 数据库与 Claude 集成。您可以执行 SQL 查询并管理数据库连接。

  1. 安装
    1. 成分
      1. 工具
    2. 配置
      1. 快速入门
        1. 安装
        2. 通过 Smithery 安装
      2. 发展
        1. 构建和发布
        2. 调试

      Related MCP Servers

      • -
        security
        F
        license
        -
        quality
        A server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.
        Last updated -
        Python
      • 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 server that provides MySQL database operations through SSE (Server-Sent Events) based on the MCP (Model-Controller-Provider) framework, enabling real-time data transmission from MySQL databases.
        Last updated -
        15
        Python
        MIT License
        • Linux
        • Apple
      • A
        security
        F
        license
        A
        quality
        MCP server that allows Claude AI to interact directly with MySQL databases, enabling query execution and table information retrieval through natural language.
        Last updated -
        1
        6
        3
        JavaScript

      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/burakdirin/mysqldb-mcp-server'

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