Skip to main content
Glama
meanands

SQL MCP Server for Claude Desktop

by meanands

Claude デスクトップ用の SQL MCP サーバー

Claude Desktop を介した、ローカル MySQL データベースへの自然言語インターフェース。この MCP (Machine Communication Protocol) サーバーにより、Claude はローカル MySQL データベースに対して SQL クエリを実行できるため、自然言語でデータベースを操作できるようになります。

特徴

  • Claudeによる自然言語からSQLクエリへの変換

  • ローカル MySQL データベースへの安全な接続

  • 複数のデータベースのサポート

  • データの一貫性を保つためのトランザクション管理

  • パフォーマンス向上のための接続プール

  • すべての種類の SQL クエリ (SELECT、INSERT、UPDATE、DELETE など) のサポート

Related MCP server: MySQL MCP Server

前提条件

  • Python 3.8以上

  • MySQLサーバーがインストールされ、実行中

  • クロードデスクトップアプリケーション

  • 仮想環境(推奨)

インストール

  1. このリポジトリをクローンします:

git clone git@github.com:meanands/mysql-mcp.git
cd mysql-mcp
  1. 仮想環境を作成してアクティブ化します。

# For macOS/Linux
python -m venv venv
source venv/bin/activate

# For Windows
python -m venv venv
venv\Scripts\activate
  1. 依存関係をインストールします:

pip install -r requirements.txt
  1. MySQL 資格情報を使用して、プロジェクト ルートに.envファイルを作成します。

MYSQL_HOST=localhost
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
  1. run.sh内のディレクトリ パスを更新します。

# Open run.sh and replace this line:
cd /Users/yourname/code/sql-mcp
# with your actual project directory path, for example:
cd /Users/yourname/projects/mysql-mcp
  1. 実行スクリプトを実行可能にします。

chmod +x run.sh

Claude Desktopでの設定

  1. Claude DesktopのMCP構成を開く

  2. 次の構成を追加します。

{
  "sql": {
    "command": "/absolute/path/to/your/mysql-mcp/run.sh"
  }
}

/absolute/path/to/your/mysql-mcpプロジェクト ディレクトリへの実際の絶対パスに置き換えます。

使用法

設定が完了すると、Claude Desktop を通じて自然言語でデータベースを操作できるようになります。例:

  1. データベースの選択とテーブルの作成:

Use the 'employees' database and create a table for storing employee information with fields for name, email, and department.
  1. データの挿入:

Insert a new employee named John Doe with email john.doe@example.com in the Engineering department.
  1. データのクエリ:

Show me all employees in the Engineering department.

重要な注意事項

  • run.sh スクリプトと Claude Desktop 構成では常に絶対パスを使用します。

  • MCP サーバーを使用する前に、MySQL サーバーが実行中であることを確認してください。

  • .env ファイルを安全に保ち、バージョン管理にコミットしないでください。

  • MCPサーバーは、デフォルトのプールサイズが5接続である接続プールを使用します。

トラブルシューティング

  1. 「接続拒否」エラーが発生した場合は、MySQLサーバーが動作していることを確認してください。

  2. 認証エラーが発生した場合は、.envファイル内の資格情報を確認してください。

  3. 権限エラーの場合は、MySQLユーザーが実行しようとしている操作に対して適切な権限を持っていることを確認してください。

セキュリティに関する考慮事項

  • 機密性の高い認証情報を .env ファイルに保存する

  • 適切な権限を持つ MySQL ユーザーを使用する (root の使用は避ける)

  • 仮想環境と依存関係を最新の状態に保つ

  • ローカルホスト以外のMySQLサーバーにアクセスする場合はネットワークセキュリティを考慮する

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A connector that gives Claude direct access to MySQL databases through the Model Context Protocol, enabling natural language querying, schema exploration, and database management.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Connects AI assistants like Claude Desktop directly to MySQL databases, enabling natural language interaction for schema inspection, data querying, CRUD operations, and database administration tasks.
    9
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables Claude Desktop to execute read-only SQL queries on MySQL databases via natural language, with dynamic connection switching and built-in security.
    3
    258
    7
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables Claude Code to directly operate MySQL databases through natural language, supporting multi-environment profiles, security modes, and 11 tools.
    11
    71
    1
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.

  • Talk to your live-events CRM (campaigns, analytics, paid ads, segments) in Claude and ChatGPT.

View all MCP Connectors

Latest Blog Posts

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/meanands/mysql-mcp'

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