yooztech_mcp_mysql — 基于 MCP 的 MySQL 工具

yooztech_mcp_mysql — 基于 MCP 的 MySQL 工具

yooztech-mcp-mysql•byyooztech

A read-only MCP server that provides MCP clients with safe MySQL database inspection and table-query capabilities.

License: MIT•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Connects to a project database by detecting the project type and reading its database configuration, without returning credentials to the AI.
  • •Lists accessible non-system databases, lists tables using an inferred or automatically selected database when none is passed, and infers the project's database name with optional minimized evidence statistics.
  • •Fetches table schemas, including column definitions, primary keys, indexes, and table comments.
  • •Runs safe table queries with table and column whitelists, parameterized statements, and a default limit of 100 capped at 1000.

BEST FOR

  • •Starting a secure MySQL workflow in MCP clients for projects that already contain database configuration.
  • •Discovering accessible databases and resolving the current project's database before table listing or row selection.
  • •Inspecting table schemas and querying limited rows while exploring a database.

ABOUT YOOZTECH-MCP-MYSQL

yooztech_mcp_mysql — 基于 MCP 的 MySQL 工具 is cataloged as an MCP server attributed to yooztech. A read-only MCP server that provides MCP clients with safe MySQL database inspection and table-query capabilities. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for yooztech_mcp_mysql — 基于 MCP 的 MySQL 工具 are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server handle database credentials?

Project configuration is read inside the MCP process; tool responses include only connection status, project type, and database name, and credentials are not returned to the AI.

What safety controls apply to table queries?

It obtains and validates table and column names from information_schema, rejects concatenation and multiple statements through parameterized queries, and enforces a default limit of 100 with a maximum of 1000.

Can the server infer the database used by a project?

Yes; it infers the database name from project content, returns only the database name by default, and can optionally include minimized, de-identified evidence statistics.

Upstream README

View this exact version on GitHub

README.md · 6f641086fc7c · Fetched 2026-11-13 08:12:05 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

yooztech_mcp_mysql —— 基于 MCP 的 MySQL 工具(只读、安全、支持库推断)

该 MCP 服务器在 MCP 客户端中提供安全的 MySQL 读取能力:

  • connect_project_database(project_root):识别项目类型,直接读取项目数据库配置并建立连接;凭据不会返回给 AI
  • list_databases():列出当前账号可访问的非系统库
  • infer_database(project_root=None, include_evidence=false):根据项目内容推断库名(默认仅返回 { db },可选返回最小化证据统计,不含文件路径/内容)
  • list_tables(db=None):列出库内表(未传 db 时使用已推断库或自动选择)
  • get_table_schema(table, db=None):获取表结构(列定义、主键、索引、表注释)
  • select_rows(table, db=None, columns=None, where=None, order_by=None, limit=100):从库表安全查询

安全设计

  • 表/列白名单:从 information_schema 动态获取并校验
  • 参数化查询:拒绝拼接与多语句
  • 限流:默认 LIMIT 100,最大 LIMIT 1000
  • 隐私:推断时不回传文件路径/内容;如需证据仅返回脱敏统计
  • 凭据隔离:项目配置只在 MCP 进程内部读取,工具响应仅包含连接状态、项目类型和数据库名

在 Cursor 中配置

在 Cursor 的设置中添加 MCP Server,示例(仅示意,不包含本地路径):

{
  "mcpServers": {
    "yooztech_mcp_mysql": {
      "command": "yooztech_mcp_mysql",
      "args": [],
      "env": {
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "3306",
        "DB_USER": "mcp_tool",
        "DB_PASS": "<your-strong-pass>"
      }
    }
  }
}

说明:

  • 以上配置假设你已通过包管理器安装本工具(例如 pip install yooztech_mcp_mysql),从而可直接使用控制台脚本 yooztech_mcp_mysql。
  • 若使用其他运行方式(如 uvx/容器),仅需将 command 与 args 改为相应启动方式即可,但不要在 README 中暴露你的本地路径。

使用 uvx 方式(推荐,免安装)

如希望在不全局安装包的情况下运行,可在 Cursor 中使用 uvx:

{
  "mcpServers": {
    "yooztech_mcp_mysql": {
      "command": "uvx",
      "args": ["yooztech_mcp_mysql"],
      "env": {
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "3306",
        "DB_USER": "mcp_tool",
        "DB_PASS": "<your-strong-pass>"
      }
    }
  }
}

提示:确保系统已安装 uv/uvx。企业私有镜像可通过 UV_INDEX/--index-url 进行加速配置。

环境变量

  • DB_HOST:数据库地址
  • DB_PORT:数据库端口
  • DB_USER:数据库只读账号(最小权限)
  • DB_PASS:数据库密码

推荐在数据库中为该工具创建最小权限账号(示例):

CREATE USER 'mcp_tool'@'10.0.%' IDENTIFIED BY '<your-strong-pass>';
GRANT SELECT ON *.* TO 'mcp_tool'@'10.0.%';
FLUSH PRIVILEGES;

如需进一步收紧权限,可按库或表粒度授予 SELECT。

使用建议(在 MCP 客户端中调用)

  • 如项目自带数据库配置,先调用 connect_project_database(project_root);支持常见 Laravel、Spring、Django、Rails、Node 和通用 .env 配置
  • 先调用 list_databases 查看可访问库
  • 再调用 infer_database 自动推断当前项目使用的库(默认仅返回 { db })
  • 随后调用 list_tables / select_rows(不传 db 时将使用推断库;如有歧义请显式传入 db)

版本与许可证

  • 版本遵循语义化版本(SemVer)
  • 许可证:MIT(详见包内 LICENSE)

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for yooztech_mcp_mysql — 基于 MCP 的 MySQL 工具 from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/yooztech-mcp-mysql)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage