MySQL MCP Server
MySQL MCP サーバー
MySQLデータベースとの安全なやり取りを可能にするモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、AIアシスタントは制御されたインターフェースを介してテーブルの一覧表示、データの読み取り、SQLクエリの実行が可能になり、データベースの探索と分析をより安全かつ構造化できます。
特徴
利用可能な MySQL テーブルをリソースとして一覧表示する
表の内容を読む
適切なエラー処理でSQLクエリを実行する
環境変数による安全なデータベースアクセス
包括的なログ記録
Related MCP server: MCP MySQL Server
構成
次の環境変数を設定します。
MYSQL_HOST=localhost # Database host
MYSQL_PORT=3306 # Optional: Database port (defaults to 3306 if not specified)
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database使用法
クロード・デスクトップ
これをclaude_desktop_config.jsonに追加します:
{
"mcpServers": {
"mysql": {
"command": "python",
"args": [
"-m",
"src.mysql_mcp_server.server"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your_username",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database"
}
}
}
}スタンドアロンサーバーとして
# Clone the repository
git clone https://github.com/designcomputer/mysql_mcp_server.git
cd mysql_mcp_server
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m src.mysql_mcp_server.server発達
# Clone the repository
git clone https://github.com/designcomputer/mysql_mcp_server.git
cd mysql_mcp_server
# Create virtual environment
python -m venv py-mcp-mysql_venv
source py-mcp-mysql_venv/bin/activate # or `py-mcp-mysql_venv\Scripts\activate` on Windows
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytestセキュリティに関する考慮事項
環境変数や資格情報をコミットしないでください
必要最小限の権限を持つデータベースユーザーを使用する
本番環境での使用にクエリホワイトリストを実装することを検討する
すべてのデータベース操作を監視して記録する
セキュリティのベストプラクティス
このMCPサーバーは機能するためにデータベースへのアクセスが必要です。セキュリティのため:
最小限の権限を持つ専用のMySQLユーザーを作成する
ルート認証情報や管理者アカウントは使用しないでください
必要な操作のみにデータベースアクセスを制限する
監査目的でログを有効にする
データベースアクセスの定期的なセキュリティレビュー
詳細な手順については、 MySQL セキュリティ構成ガイドを参照してください。
制限付きMySQLユーザーの作成
適切な権限の設定
データベースアクセスの監視
セキュリティのベストプラクティス
⚠️ 重要: データベース アクセスを構成するときは、常に最小権限の原則に従ってください。
ライセンス
MIT ライセンス - 詳細については LICENSE ファイルを参照してください。
貢献
リポジトリをフォークする
機能ブランチを作成します(
git checkout -b feature/amazing-feature)変更をコミットします (
git commit -m 'Add some amazing feature')ブランチにプッシュする (
git push origin feature/amazing-feature)プルリクエストを開く
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides secure access to MySQL databases for AI assistants, enabling safe SQL queries, table information retrieval, and data insertion with built-in security protections.4542MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query MySQL databases with read-only access by default, supporting table listing, structure inspection, and SQL queries with optional write operation control.18MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to securely interact with MySQL databases through tools for query execution, schema inspection, and transaction management. It features built-in safety controls like row limits and query validation to ensure safe and standardized database access.454
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with MySQL databases, including listing tables, viewing schemas, and executing read-only SQL queries through natural language.6
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/amornpan/py-mcp-mysql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server