Skip to main content

MySQL MCP Server with GUI config panel and YAML import

Project description

MySQL MCP Server

一个带 GUI 配置面板的 MySQL MCP Server,外部使用方式对齐 mcp_ssh,底层改为 MySQL 连接与表操作。

功能

  • 多连接管理 - 保存多个 MySQL 连接并选择当前活动连接
  • GUI 配置面板 - mysqlgui 一键启动,可视化管理连接
  • YAML 导入 - 支持从 Java application.yml/.yaml 自动提取 MySQL 配置
  • 一键安装 - 安装到 Windsurf / Cursor / Claude Code / Codex
  • MCP 协议 - 通过 stdio 暴露 MySQL 工具
  • 全表操作 - 支持查询、DDL、CRUD、表结构查看

安装

pip install mysqlmcp-r

安装完成后即可直接使用命令行入口,不需要额外打包 PyInstaller exe。

pip 安装后如何直接启动 GUI

mysqlgui

mysqlguipip 根据 pyproject.toml 里的 project.scripts 自动生成的启动命令。
同理,安装后也可以直接使用:

mysqlmcp
mysqlmcp-install

在 Windows 下,你看到的通常会是 mysqlgui.exe / mysqlmcp.exe 这类命令包装器;它们由 pip 自动创建,不是额外单独打包出来的独立 exe。

如果安装后提示找不到 mysqlgui,通常是 Python 的 Scripts 目录没有加入 PATH。此时可先尝试:

python -m mysql_mcp.cli --gui

命令一览

命令 说明
mysqlmcp 以 MCP Server 模式运行
mysqlgui 启动 GUI 配置面板
mysqlmcp-install 安装到所有 IDE
mysqlmcp-install-windsurf 安装到 Windsurf
mysqlmcp-install-cursor 安装到 Cursor
mysqlmcp-install-claudecode 安装到 Claude Code
mysqlmcp-install-codex 安装到 Codex

快速开始

# 1. 安装
pip install mysqlmcp-r

# 2. 打开 GUI 管理连接
mysqlgui

# 3. 安装到 IDE
mysqlmcp-install-codex

# 4. 或直接启动 MCP Server
mysqlmcp

GUI 支持

  • 手动填写 host / port / username / password / database / charset
  • 在“添加/编辑连接”弹窗中选择 YAML 文件自动导入 MySQL datasource
  • 测试连接
  • 指定当前活动连接

MCP Tools

  • list_servers
  • connect
  • disconnect
  • get_status
  • exec_sql(禁止执行 DROP TABLETRUNCATE TABLEDROP DATABASE
  • list_databases
  • list_tables
  • describe_table
  • show_create_table
  • list_columns
  • create_table
  • alter_table
  • rename_table
  • insert_rowsrows 必须是对象数组,支持多行批量插入)
  • update_rowswhere_clause 支持 ?%s
  • delete_rowswhere_clause 支持 ?%s

手动 MCP 配置

{
  "mcpServers": {
    "mysql": {
      "command": "mysqlmcp"
    }
  }
}

开发测试

python -m pytest -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mysqlmcp_r-0.1.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mysqlmcp_r-0.1.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file mysqlmcp_r-0.1.1.tar.gz.

File metadata

  • Download URL: mysqlmcp_r-0.1.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mysqlmcp_r-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5bec4406b6ba7b17c7f990d77ddf5b43bbefddf657305da651d2c6e94b6b848e
MD5 ed01c61756d4db5b24bb3da60513c9bf
BLAKE2b-256 dd58db15cb3da994d68eae1cbae7ae0f0bfe7d5ff045dcf294b16c2fcc4dfece

See more details on using hashes here.

File details

Details for the file mysqlmcp_r-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mysqlmcp_r-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mysqlmcp_r-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fd34836fa2d980ebf8b0902c3091519f23705cc4dd451004ae2659f89206645
MD5 221ad125ac0f76b7b9032be00c26b4b4
BLAKE2b-256 cd5f45f946629520c6bf3ea9ffe81338594281c409ac68f88bf735deefe270c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page