MySQL Readonly MCP Server

MySQL Readonly MCP Server

mysql-mcp-the-nine-nation•bythe-nine-nation

An MCP-based MySQL read-only query server that provides a safe read-only query interface to MySQL databases.

License: Not specified•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Supports read-only query operations against MySQL databases.
  • •Manages database connections using a connection pool.
  • •Automatically limits the number of query results.
  • •Provides built-in security checks to prevent non-read-only operations and uses parameterized queries to prevent SQL injection.

BEST FOR

  • •Giving models safe read-only access to MySQL data through MCP.
  • •Teams that want to describe their database tables in a resource description file to help models understand the schema.

ABOUT MYSQL-MCP-THE-NINE-NATION

MySQL Readonly MCP Server is cataloged as an MCP server attributed to the-nine-nation. An MCP-based MySQL read-only query server that provides a safe read-only query interface to MySQL databases. 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: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

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 MySQL Readonly MCP Server 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.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 1c32ca1dd4c9 · 采集于 2026-11-13 10:56:01 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MySQL Readonly MCP Server

这是一个基于MCP(Model Context Protocol)的MySQL只读查询服务器,它允许通过安全的只读查询接口访问MySQL数据库。

功能特点

  • 支持MySQL数据库的只读查询操作
  • 使用连接池管理数据库连接
  • 自动限制查询结果数量
  • 支持参数化查询
  • 提供格式化的查询结果输出
  • 内置安全检查,防止非只读操作

环境要求

  • Python 3.10+
  • MySQL 5.7+
  • aiomysql

安装

git clone https://github.com/the-nine-nation/mysql-mcp.git
pip install -e .

使用方法

以cursor为例,将如下字典放入config.json: 其中 sys.executable为python虚拟环境的执行文件,通常名字为python,conda或uv下皆可以 mysql_mcp_py为main.py文件的绝对路径

    "mysql": {
        "command": sys.executable,
        "args": [mysql_mcp_py],
        "env": {
            "MYSQL_ENABLED": "true",
            "MYSQL_HOST": "mysql数据库的ip",
            "MYSQL_PORT": "mysql数据库的端口",
            "MYSQL_DATABASE": "mysql数据库的名称",
            "MYSQL_USERNAME": "mysql数据库的用户名",
            "MYSQL_PASSWORD": "mysql数据库的密码",
            "MYSQL_POOL_MINSIZE": "1",
            "MYSQL_POOL_MAXSIZE": "10",
            "MYSQL_RESOURCE_DESC_FILE": "mysql数据库的资源描述文件路径"
        }
    }

请注意: 1.MYSQL_RESOURCE_DESC_FILE是一个说明,可以将数据库中一些信息放入其中,例如什么表是做什么用的,能够提升模型理解能力. 2.MYSQL_ENABLED默认可以不用填

安全特性

  • 只允许只读操作
  • 防止多语句执行
  • 自动限制查询结果数量
  • 使用参数化查询防止SQL注入

注意事项

  • 确保数据库用户只有只读权限
  • 资源描述文件是必需的,用于定义可用的查询接口
  • 查询结果默认限制为20行,可通过环境变量调整

贡献

欢迎提交Issue和Pull Request。

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 MySQL Readonly MCP Server 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/mysql-mcp-the-nine-nation)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

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

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

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