KM

kevinwatt/mysql-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

18 stars 10 forks 品質 61 トレンド 22MIT

MySQLデータベースと統合するMCPサーバーの実装で、LMSのセキュアなデータベースアクセス機能を提供します.

概要

MySQLデータベースと統合するMCPサーバーの実装で、LMSのセキュアなデータベースアクセス機能を提供します。 * *読み取り専用SELECTクエリを実行 * すべてのデータベーステーブルをリスト * 表構造を表示 * スキーマ情報の表示 * * トランザクションサポートでINSERT / UPDATE / DELETEを実行 * データ安全のためのパラメータ化されたクエリ * 影響を受けた行とインサートIDを返す * * SELECTクエリの読み取り専用トランザクションモード * クエリの長さと結果のサイズ制限 * パフォーマンス監視とロギング * 自動トランザクション処理 1. 「+ MCP サーバーを追加」をクリック 2. この設定をコピーして貼り付けます。 3.

概要(AI 翻訳)

MySQLデータベースと統合するMCPサーバーの実装で、LMSのセキュアなデータベースアクセス機能を提供します。

##特徴

***続きを読む *読み取り専用SELECTクエリを実行 *すべてのデータベーステーブルのリスト *テーブルの構造を表示して下さい

  • スキーマ情報を見る *Writeオペレーション
  • トランザクションサポートで INSERT/UPDATE/DELETE を実行 *データ安全のための変数化された照会
  • 影響を受ける行とインサートIDを返す
  • セキュリティ
  • SELECTクエリの読み取り専用トランザクションモード
  • クエリの長さと結果のサイズ制限 *性能の監視およびロギング *自動取引処理

インストール

ダイブデスクトップでの使用

  1. ダイブデスクトップで「+ MCP サーバーを追加」をクリック

  2. この設定をコピーして貼り付ける:

  3. 「保存」をクリックしてMCPサーバーをインストール

ツールドキュメント

mysql query* は、 *読み取り専用SELECTクエリを実行 *入力:

  • sql (文字列): SQL SELECT クエリを実行する *限界:
  • 最大問い合わせ長さ:4096文字
  • 最大結果行数:1000
  • クエリタイムアウト:30秒

*mysql execute

  • データ変更操作を実行 *入力:
  • sql (文字列): SQL文 (INSERT/UPDATE/DELETE)

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

MySQL MCP Server

An MCP server implementation that integrates with MySQL databases, providing secure database access capabilities for LLMs.

Features

  • Read Operations
    • Execute read-only SELECT queries
    • List all database tables
    • Show table structures
    • View schema information
  • Write Operations
    • Execute INSERT/UPDATE/DELETE with transaction support
    • Parameterized queries for data safety
    • Returns affected rows and insert IDs
  • Security
    • Read-only transaction mode for SELECT queries
    • Query length and result size limits
    • Performance monitoring and logging
    • Automatic transaction handling

Installation

npm install -g @kevinwatt/mysql-mcp

Usage with Dive Desktop

  1. Click “+ Add MCP Server” in Dive Desktop
  2. Copy and paste this configuration:
{
  "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. Click “Save” to install the MCP server

Tool Documentation

  • mysql_query

    • Execute read-only SELECT queries
    • Inputs:
      • sql (string): SQL SELECT query to execute
    • Limits:
      • Maximum query length: 4096 characters
      • Maximum result rows: 1000
      • Query timeout: 30 seconds
  • mysql_execute

    • Execute data modification operations
    • Inputs:
      • sql (string): SQL statement (INSERT/UPDATE/DELETE)
      • params (array, optional): Parameters for the SQL statement
    • Features:
      • Returns affected rows count
      • Returns last insert ID
      • Automatic transaction handling
  • list_tables

    • List all tables in current database
    • No inputs required
  • describe_table

    • Show table structure
    • Inputs:
      • table (string): Table name to describe

Usage Examples

Ask your LLM to:

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

Manual Start

If needed, start the server manually:

npx @kevinwatt/mysql-mcp

Requirements

  • Node.js 18+
  • MySQL Server
  • MCP-compatible LLM service

License

MIT

Author

Dewei Yen

Keywords

  • mcp
  • mysql
  • database
  • dive
  • llm
  • ai
GitHub で README 全文を見る

インストール

npx -y @kevinwatt/mysql-mcp
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "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" } } } }