Skip to main content
Glama
kevinwatt

MySQL MCP Server

by kevinwatt

MySQL MCP サーバー

MySQL データベースと統合し、LLM に安全なデータベース アクセス機能を提供する MCP サーバー実装。

特徴

  • 読み取り操作

    • 読み取り専用のSELECTクエリを実行する

    • すべてのデータベーステーブルを一覧表示する

    • テーブル構造を表示

    • スキーマ情報を表示する

  • 書き込み操作

    • トランザクションサポートを使用してINSERT/UPDATE/DELETEを実行する

    • データの安全性のためのパラメータ化されたクエリ

    • 影響を受ける行と挿入IDを返します

  • 安全

    • SELECTクエリの読み取り専用トランザクションモード

    • クエリの長さと結果のサイズ制限

    • パフォーマンス監視とログ記録

    • 自動取引処理

Related MCP server: DatabaseMCP

インストール

npm install -g @kevinwatt/mysql-mcp

Dive Desktopでの使用

  1. Diveデスクトップで「+ MCPサーバーを追加」をクリックします。

  2. 次の設定をコピーして貼り付けます。

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": [
        "-y",
        "@kevinwatt/mysql-mcp"
      ],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "",
        "MYSQL_DB": "your_database"
      }
    }
  }
}
  1. 「保存」をクリックしてMCPサーバーをインストールします

ツールドキュメント

  • mysql_クエリ

    • 読み取り専用のSELECTクエリを実行する

    • 入力:

      • sql (文字列): 実行するSQL SELECTクエリ

    • 制限:

      • クエリの最大長: 4096文字

      • 結果の最大行数: 1000

      • クエリタイムアウト: 30秒

  • mysql_execute

    • データ変更操作を実行する

    • 入力:

      • sql (文字列): SQL文 (INSERT/UPDATE/DELETE)

      • params (配列、オプション): SQL文のパラメータ

    • 特徴:

      • 影響を受けた行数を返す

      • 最後の挿入IDを返す

      • 自動取引処理

  • リストテーブル

    • 現在のデータベース内のすべてのテーブルを一覧表示する

    • 入力は不要です

  • テーブルの説明

    • テーブル構造を表示

    • 入力:

      • table (文字列): 記述するテーブル名

使用例

LLM に次のことを依頼してください。

"Show me all tables in the database"
"Describe the structure of users table"
"Select all active users from the database"
"Insert a new record into orders table"

手動スタート

必要に応じて、サーバーを手動で起動します。

npx @kevinwatt/mysql-mcp

要件

  • Node.js 18歳以上

  • MySQLサーバー

  • MCP対応LLMサービス

ライセンス

マサチューセッツ工科大学

著者

デウェイ・イェン

キーワード

  • マクピー

  • MySQL

  • データベース

  • ダイビング

  • 法学博士

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A high-performance MCP server that enables AI assistants to safely interact with MySQL databases through secure CRUD operations, schema inspection, and parameterized queries with built-in SQL injection prevention.
    1
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    An MCP server that enables AI agents to safely explore and interact with MySQL databases through dynamic tool generation from stored procedures. It provides database discovery capabilities and intelligent procedure categorization while enforcing security restrictions to prevent data modification.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A MySQL MCP server for secure database interaction, enabling schema inspection, query execution, and RBAC via AI coding assistants.
    392 npm
    5
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A secure and efficient MCP server for MySQL database operations, enabling LLMs to execute SQL queries with read-only access by default and optional write permissions.
    3
    MIT