MCP Server for MySQL

by hkk101
Verified
MIT License
1,219

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Provides read-only access to MySQL databases, allowing inspection of database schemas and execution of read-only SQL queries against the connected database.

NodeJS ベースの MySQL 用 MCP サーバー

MySQLデータベースへの読み取り専用アクセスを提供するモデルコンテキストプロトコル(CMP)サーバー。このサーバーにより、LLMはデータベーススキーマを検査し、読み取り専用クエリを実行できます。

コンポーネント

ツール

  • mysql_クエリ
    • 接続されたデータベースに対して読み取り専用のSQLクエリを実行する
    • 入力: sql (文字列): 実行するSQLクエリ
    • すべてのクエリは読み取り専用トランザクション内で実行されます

リソース

サーバーは、データベース内の各テーブルのスキーマ情報を提供します。

  • テーブルスキーマ
    • 各テーブルのJSONスキーマ情報
    • 列名とデータ型が含まれます
    • データベースのメタデータから自動的に検出

Claude Desktopでの使用

このサーバーを Claude Desktop アプリで使用するには、 claude_desktop_config.jsonの「mcpServers」セクションに次の構成を追加します。

{ "mcpServers": { "mcp_server_mysql": { "command": "npx", "args": [ "-y", "@benborla29/mcp-server-mysql", ], "env": { "MYSQL_HOST": "127.0.0.1", "MYSQL_PORT": "3306", "MYSQL_USER": "root", "MYSQL_PASS": "", "MYSQL_DB": "db_name" } } } }

/db_nameをデータベース名に置き換えるか、空白のままにしてすべてのデータベースを取得します。

トラブルシューティング

「MCP サーバー mcp-server-mysql に接続できませんでした」というエラーが発生した場合は、以下の構成のように、必要なすべてのバイナリのパスを明示的に設定する必要がある場合があります。

{ "mcpServers": { "mcp_server_mysql": { "command": "/path/to/npx/binary/npx", "args": [ "-y", "@benborla29/mcp-server-mysql", ], "env": { "MYSQL_HOST": "127.0.0.1", "MYSQL_PORT": "3306", "MYSQL_USER": "root", "MYSQL_PASS": "", "MYSQL_DB": "db_name" "PATH": "/path/to/node/bin:/usr/bin:/bin" <-- Add this } } } }

ライセンス

このMCPサーバーはMITライセンスに基づいてライセンスされています。つまり、MITライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。

-
security - not tested
A
license - permissive license
-
quality - not tested

MySQL データベースへの読み取り専用アクセスを提供し、LLM がデータベース スキーマを検査し、読み取り専用クエリを実行できるようにするモデル コンテキスト プロトコル サーバー。

  1. Components
    1. Tools
    2. Resources
  2. Usage with Claude Desktop
    1. Troubleshooting
      1. License
        ID: 1hvoe30klo