MySQL数据库探索工具

MySQL Explorer MCP Server是一个实现Model Context Protocol (MCP)的工具,允许Claude Desktop直接与MySQL数据库交互,提供自动读取数据库架构和数据的功能。

  • by awand795
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 awand795/mcp-server-mysql

使用说明

MySQL Explorer MCP Server

Implementasi Model Context Protocol (MCP) yang memungkinkan Claude Desktop untuk berinteraksi langsung dengan database MySQL Anda. Server ini menyediakan tool untuk membaca seluruh skema dan data tabel secara otomatis.


🚀 Fitur Utama

  • Schema Discovery: Mendeteksi semua tabel dan struktur kolom secara otomatis.
  • Full Data Retrieval: Mengambil seluruh baris data dari database untuk dianalisis oleh Claude.
  • Deep Integration: Berjalan sebagai sidecar process untuk Claude Desktop.

🛠 Prasyarat

Sebelum memulai, pastikan perangkat Anda sudah terpasang:

  • Node.js (v18 atau lebih baru)
  • MySQL Server (Lokal atau Remote)
  • Claude Desktop App (Versi terbaru)

📦 Instalasi

  1. Clone atau Masuk ke Direktori Proyek:

    cd path/to/your/mysql-mcp-server
    
  2. Instal Dependensi:

    npm install
    
  3. Build Proyek (Compile TypeScript ke JS):

    npm run build
    

⚙️ Konfigurasi Claude Desktop

Untuk menghubungkan server ini, Anda harus mengedit file claude_desktop_config.json.

Lokasi File Konfigurasi:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Tambahkan konfigurasi berikut:

{
  "mcpServers": {
    "mysql-explorer": {
      "command": "node",
      "args": ["C:/absolute/path/to/your/project/build/index.js"],
      "env": {
        "DB_HOST": "localhost",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "your_password",
        "DB_NAME": "your_database_name"
      }
    }
  }
}