MySQL MCP Server

MySQL MCP Server

mysql_mcp_servers•byota-eita

An MCP server that provides an interface to interact with MySQL databases, including listing tables, reading data, and executing SQL queries.

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

WHAT IT DOES

  • •Lists tables in a MySQL database.
  • •Reads data from a table, up to a maximum of 100 rows.
  • •Executes SQL queries including SELECT, SHOW TABLES, INSERT, UPDATE, and DELETE.
  • •Provides MCP endpoints for listing resources, reading resources, listing tools, and calling tools.

BEST FOR

  • •Connecting to a MySQL server from a WSL environment.
  • •Querying and managing MySQL databases through MCP tools.

ABOUT MYSQL_MCP_SERVERS

MySQL MCP Server is cataloged as an MCP server attributed to ota-eita. An MCP server that provides an interface to interact with MySQL databases, including listing tables, reading data, and executing SQL queries. 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 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.

FREQUENTLY ASKED QUESTIONS

What environment variables does the server use to connect to MySQL?

The server uses MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE environment variables.

How can the server be run?

The server can be run directly, as a module, or in a Docker container.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 2e146b229ec7 · 采集于 2026-11-13 13:25:17 UTC

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

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

MySQL MCP Server

このプロジェクトは、MCP (Model Context Protocol) を使用してMySQLデータベースとやり取りするためのサーバーを提供します。WSL環境でMySQLデータベースにアクセスするためのインターフェースを提供します。

機能

  • MySQLデータベース内のテーブル一覧の取得
  • テーブルからのデータ読み取り(最大100行)
  • SQLクエリの実行(SELECT、SHOW TABLES、INSERT、UPDATE、DELETEなど)

プロジェクト構造

src/mysql_mcp_server/
├── __init__.py        # パッケージ初期化
├── config/           # 設定関連モジュール
│   ├── __init__.py  
│   └── settings.py   # データベース設定
├── database/         # データベース操作モジュール
│   ├── __init__.py  
│   ├── connection.py # DB接続処理
│   └── errors.py     # エラークラス
├── tools/            # ツールモジュール
│   ├── __init__.py  
│   └── sql_tools.py  # SQL実行ツール
└── server.py         # MCPサーバーメイン

インストールと実行

前提条件

  • Python 3.11以上
  • MySQLサーバー(ローカルまたはリモート)
  • 仮想環境(virtualenv)
  • Docker(Dockerを使用する場合)

セットアップ

  1. リポジトリをクローン:

    git clone <repository-url>
    cd mysql_mcp_server
    
  2. 仮想環境を作成し、アクティベート:

    python -m venv .venv
    source .venv/bin/activate  # Linuxの場合
    
  3. 依存関係をインストール:

    pip install -r requirements.txt .
    
  4. セットアップスクリプトを実行して、実行スクリプトに実行権限を付与:

    chmod +x setup.sh
    ./setup.sh
    

実行方法

以下のいずれかの方法でサーバーを実行できます:

1. 直接実行

./run_direct.sh

2. モジュールとして実行

./run_module.sh

3. Dockerコンテナで実行

# Dockerイメージをビルド
docker build -t mysql-mcp-server:latest .

# コンテナを実行
./run_docker.sh

環境変数

サーバーは以下の環境変数を使用してMySQLに接続します:

  • MYSQL_HOST: MySQLサーバーのホスト(デフォルト: host.docker.internal)
  • MYSQL_PORT: MySQLサーバーのポート(デフォルト: 13306)
  • MYSQL_USER: MySQLユーザー名
  • MYSQL_PASSWORD: MySQLパスワード
  • MYSQL_DATABASE: 使用するデータベース名

MCPプロトコル

このサーバーはMCP(Model Control Protocol)を実装しており、以下のエンドポイントを提供します:

  • list_resources: データベース内のテーブル一覧を取得
  • read_resource: 特定のテーブルからデータを読み取り
  • list_tools: 利用可能なツール(SQLクエリの実行)を一覧表示
  • call_tool: SQLクエリを実行

WSL連携

WSL(Windows Subsystem for Linux)環境内のMySQLサーバーに接続する場合:

  1. WSL内のMySQLサーバーが起動していることを確認
  2. WSL内のMySQLがリモート接続を許可するように設定されていることを確認
    • /etc/mysql/mysql.conf.d/mysqld.cnfファイルでbind-addressを0.0.0.0に変更
    • 使用するMySQLユーザーにリモートからのアクセス権限を付与
  3. Windows側のファイアウォールがMySQLポート(デフォルト13306)への接続を許可していることを確認

開発

Noxセッション

このプロジェクトは、テスト、フォーマット、リントのためのNoxセッションを提供しています。

  1. Noxをインストール:

    pip install nox
    
  2. 全てのテストを実行:

    nox -s test
    
  3. コードをフォーマット:

    nox -s format
    
  4. リントチェックを実行:

    nox -s lint
    

直接テストを実行

pytest tests/

コードカバレッジを確認

pytest --cov=src.mysql_mcp_server tests/

ライセンス

このプロジェクトはMITライセンスの下で公開されています。

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 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_servers)

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