mysql-mcp
mysql-mcp
MySQLデータベースへの安全な読み取り専用アクセスを提供する軽量なMCPサーバーです。
特徴
マルチデータベース — 複数のMySQLインスタンスに接続し、実行時に切り替え可能
読み取り専用 — 書き込み操作(
INSERT、UPDATE、DELETE、DROPなど)はブロックされます遅延接続 — プールは起動時ではなく初回使用時に作成されます
MCPネイティブ —
@modelcontextprotocol/sdkを基盤としており、あらゆるMCPクライアントで動作します
Related MCP server: mcp-database
セットアップ
データベース接続情報を記載したJSON設定ファイルを作成します:
{
"my-db": {
"host": "db.example.com",
"port": 3306,
"user": "readonly",
"password": "secret",
"database": "mydb",
"environment": "production",
"ssl": false
}
}MYSQL_DATABASES_CONFIG環境変数にそのファイルへのパスを指定します。サーバーを実行します:
npx tsx index.tsツール
ツール | 説明 |
| 設定済みのすべてのデータベースとアクティブな接続を一覧表示 |
| アクティブなデータベース接続を切り替え |
| 読み取り専用のSQLクエリを実行 |
MCPクライアント設定
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": ["tsx", "/path/to/mysql-mcp/index.ts"],
"env": {
"MYSQL_DATABASES_CONFIG": "/path/to/databases.json"
}
}
}
}ライセンス
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that provides read-only access to MySQL databases.4317 npm72MIT
- AlicenseAqualityCmaintenanceRead-only MySQL/MariaDB MCP server for running SELECT queries safely, with automatic read-only enforcement and query limits.36 npmMIT
- AlicenseNot gradedqualityDmaintenanceA readonly MCP server for MySQL databases that ensures safety by whitelisting only SELECT, SHOW, DESCRIBE, and EXPLAIN statements, with table blacklist support and configurable limits.MIT
- AlicenseNot gradedqualityDmaintenanceA secure, read-only MySQL database proxy using MCP protocol, enabling SQL queries and table inspections via HTTP.10 npm1MIT