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.

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 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.

Upstream README

View this exact version on GitHub

README.md · 2e146b229ec7 · Fetched 2026-11-13 13:25:17 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.

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.

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