Skip to main content
Glama
MySQL Server MCP Server

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 を提供します。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      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
      211 npm
      104
      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.
      1
      ISC
    • F
      license
      Not graded
      quality
      C
      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.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      A simple MCP server that executes SQL queries on a MariaDB database using a YAML config file.
      1
      MIT