Skip to main content
Glama

MySQL MCP Server

by LeonMelamud

MySQL MCP サーバー

MySQLデータベースへの直接アクセスを提供する強力なMCPサーバー。このサーバーにより、AIエージェントはMySQLデータベースと対話し、SQLクエリを実行し、シンプルなインターフェースを通じてデータベースコンテンツを管理できるようになります。

特徴

リソース

  • データベースに保存されているノートにnote:///{id} URI 経由でアクセスします。
  • 各メモにはタイトルと内容があります
  • シンプルなコンテンツアクセスのためのプレーンテキスト MIME タイプ

ツール

  • create_note - データベースに新しいテキストノートを作成する
    • タイトルとコンテンツを必須パラメータとして受け取ります
    • MySQLデータベースにメモを保存する
  • list_tables - 接続されたデータベース内のすべてのテーブルを一覧表示します
  • count_tables - データベース内のテーブルの合計数を取得します
  • search_tables - LIKEパターンを使用してテーブルを検索する
  • describe_table - 特定のテーブルの構造を取得する
  • execute_sql - カスタムSQLクエリを実行する

前提条件

  • Node.js 18以上
  • MySQLサーバーがインストールされ、実行中
  • 適切な権限を持つデータベース

設定

  1. このリポジトリをクローンします:
    git clone git@github.com:LeonMelamud/mysql-mcp.git cd mysql-mcp
  2. 依存関係をインストールします:
    npm install
  3. MySQL 接続の詳細を含む.envファイルをルート ディレクトリに作成します。
    MYSQL_HOST=localhost MYSQL_USER=your_username MYSQL_PASSWORD=your_password MYSQL_DATABASE=your_database
  4. サーバーを構築します。
    npm run build

インストール

クロードデスクトップ向け

Claude Desktop 構成ファイルにサーバー構成を追加します。

MacOS の場合: ~/Library/Application Support/Claude/claude_desktop_config.json Windows の場合: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "mysql": { "command": "node", "args": ["/path/to/mysql-server/build/index.js"], "env": { "MYSQL_HOST": "localhost", "MYSQL_USER": "your_username", "MYSQL_PASSWORD": "your_password", "MYSQL_DATABASE": "your_database" } } } }

クラインのために

Cline MCP 設定ファイルにサーバー設定を追加します。

MacOS の場合: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json Windows の場合: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

{ "mcpServers": { "mysql": { "command": "node", "args": ["/path/to/mysql-server/build/index.js"], "env": { "MYSQL_HOST": "localhost", "MYSQL_USER": "your_username", "MYSQL_PASSWORD": "your_password", "MYSQL_DATABASE": "your_database" }, "disabled": false, "autoApprove": [] } } }

使用例

インストールが完了すると、Claude との会話で MySQL MCP サーバーを使用できるようになります。

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

Please list all the tables in my MySQL database.

SQLクエリを実行する

Run this SQL query: SELECT * FROM users LIMIT 5

メモを作成する

Create a note titled "Meeting Notes" with the content "Discussed project timeline and assigned tasks."

発達

自動リビルドを使用した開発の場合:

npm run watch

デバッグ

MCP Inspector を使用してサーバーをデバッグします。

npm run inspector

インスペクターは、ブラウザでデバッグ ツールにアクセスするための URL を提供します。

ライセンス

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

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

AI エージェントが MySQL データベースと対話し、SQL クエリを実行し、シンプルなインターフェースを通じてデータベース コンテンツを管理できるようにする強力なサーバーです。

  1. 特徴
    1. リソース
    2. ツール
  2. 前提条件
    1. 設定
      1. インストール
        1. クロードデスクトップ向け
        2. クラインのために
      2. 使用例
        1. データベース内のすべてのテーブルを一覧表示する
        2. SQLクエリを実行する
        3. メモを作成する
      3. 発達
        1. デバッグ
      4. ライセンス

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          This server enables AI models to interact with MySQL databases through a standardized interface.
          Last updated -
          5
          646
          61
          JavaScript
          MIT License
          • Linux
          • Apple
        • -
          security
          A
          license
          -
          quality
          A server that enables AI models to interact with MySQL databases through a Model Control Protocol, providing tools for table creation, schema inspection, query execution, and data retrieval.
          Last updated -
          20
          Python
          MIT License
          • Linux
          • Apple
        • A
          security
          A
          license
          A
          quality
          Connect and interact with MySQL databases seamlessly. Execute SQL queries, manage database connections, and retrieve data directly through AI assistants. Enhance your AI capabilities with structured access to your MySQL data.
          Last updated -
          9
          14
          3
          TypeScript
          MIT License
        • -
          security
          F
          license
          -
          quality
          Enables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.
          Last updated -
          Python
          • Linux
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/LeonMelamud/mysql-mcp'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server