Skip to main content
Glama
xianzong85

MySQL Server MCP Server

by xianzong85

mysql-server MCP サーバー

MySQLデータベースアクセス用のモデルコンテキストプロトコルサーバー

これはTypeScriptベースのMCPサーバーで、MySQLデータベースへのクエリツールを提供します。以下の機能を提供することで、MCPのコアコンセプトを実証します。

  • SQLクエリを実行するためのツール

  • 環境変数経由でのMySQLデータベースへの接続

特徴

ツール

  • query - SQLクエリを実行する

    • 必須パラメータとしてSQLクエリ文字列を受け取ります

    • クエリ結果を返します

Related MCP server: Angular Bootstrap MCP Server

構成

MCP サーバー構成で次の環境変数を設定します。

  • MYSQL_HOST: MySQLサーバーホスト

  • MYSQL_USER: MySQLユーザー名

  • MYSQL_PASSWORD: MySQLパスワード

  • MYSQL_DATABASE: MySQLデータベース名

発達

依存関係をインストールします:

npm install

サーバーを構築します。

npm run build

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

npm run watch

インストール

Claude Desktop で使用するには、サーバー設定を追加します。

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

{
  "mcpServers": {
    "mysql": {
      "command": "/path/to/mysql-server/build/index.js",
      "env": {
        "MYSQL_HOST": "your-mysql-host",
        "MYSQL_USER": "your-mysql-user",
        "MYSQL_PASSWORD": "your-mysql-password",
        "MYSQL_DATABASE": "your-mysql-database"
      }
    }
  }
}

デバッグ

MCPサーバーはstdio経由で通信するため、デバッグが困難になる場合があります。パッケージスクリプトとして提供されているMCP Inspectorの使用をお勧めします。

npm run inspector

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    A TypeScript-based MCP server that enables testing of REST APIs through Cline. This tool allows you to test and interact with any REST API endpoints directly from your development environment.
    1
    85 npm
    103
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A TypeScript-based MCP server that provides backend API handling and facilitates communication between microservices. Features an organized structure with controllers, routes, and models for easy extensibility and maintenance.
    284 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A TypeScript/Node.js MCP server that wraps the Metabase REST API, enabling AI agents to execute queries, explore schemas, and build dashboards through structured tool calls.
    41 npm
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A simple MCP server that executes SQL queries on a MariaDB database using a YAML config file.
    1
    MIT