MariaDB MCP Server
MariaDB / MySQL データベースアクセス MCP サーバー
この MCP サーバーは、MariaDB / MySQL データベースへのアクセスを提供します。
これにより、次のことが可能になります。
利用可能なデータベースの一覧
データベース内のテーブルを一覧表示する
テーブルスキーマを説明する
SQLクエリを実行する
セキュリティ機能
読み取り専用アクセス デフォルト: SELECT、SHOW、DESCRIBE、EXPLAIN
クエリ検証: SQLインジェクションを防ぎ、データ変更の試みをブロックします
クエリタイムアウト: 長時間実行されるクエリがリソースを消費するのを防ぎます
行制限: 過剰なデータ返送を防止
Related MCP server: MySQL MCP Server
インストール
オプション1: ソースからビルドする
# Clone the repository
git clone https://github.com/bretoreta/mariadb-mcp-server.git
cd mariadb-mcp-server
# Install dependencies and build
pnpm install
pnpm run build2. 環境変数を設定する
サーバーには次の環境変数が必要です。
MARIADB_HOST: データベースサーバーのホスト名
MARIADB_PORT: データベースサーバポート(デフォルト: 3306)
MARIADB_USER: データベースのユーザー名
MARIADB_PASSWORD: データベースパスワード
MARIADB_DATABASE: デフォルトのデータベース名(オプション)
MARIADB_ALLOW_INSERT: 偽
MARIADB_ALLOW_UPDATE: 偽
MARIADB_ALLOW_DELETE: 偽
MARIADB_TIMEOUT_MS: 10000
MARIADB_ROW_LIMIT: 1000
3. MCP設定に追加
MCP 設定ファイルに次の構成を追加します。
ソースからビルドした場合:
{
"mcpServers": {
"mariadb": {
"command": "node",
"args": ["/path/to/mariadb-mcp-server/dist/index.js"],
"env": {
"MARIADB_HOST": "your-host",
"MARIADB_PORT": "3306",
"MARIADB_USER": "your-user",
"MARIADB_PASSWORD": "your-password",
"MARIADB_DATABASE": "your-default-database",
"MARIADB_ALLOW_INSERT": "false",
"MARIADB_ALLOW_UPDATE": "false",
"MARIADB_ALLOW_DELETE": "false",
"MARIADB_TIMEOUT_MS": "10000",
"MARIADB_ROW_LIMIT": "1000",
},
"disabled": false,
"autoApprove": []
}
}
}利用可能なツール
データベース一覧
MariaDB / MySQLサーバー上のアクセス可能なすべてのデータベースを一覧表示します。パラメータ: なし
例:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"sessionId": "session_id from /sse call",
"name": "list_databases"
}
}リストテーブル
指定されたデータベース内のすべてのテーブルを一覧表示します。
パラメータ:
database(オプション): データベース名(指定されていない場合はデフォルトを使用)
例:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"sessionId": "session_id from /sse call",
"name": "list_tables",
"database": "my_database_name"
}
}テーブルの説明
特定のテーブルのスキーマを表示します。
パラメータ:
database(オプション): データベース名(指定されていない場合はデフォルトを使用)table(必須): テーブル名
例:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"sessionId": "session_id from /sse call",
"name": "describe_table",
"database": "my_database_name",
"table": "my_table_name"
}
}クエリ実行
SQL クエリを実行します。
パラメータ:
query(必須): SQLクエリdatabase(オプション): データベース名(指定されていない場合はデフォルトを使用)
例:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"sessionId": "session_id from /sse call",
"name": "execute_query",
"query": "SELECT * FROM my_table LIMIT 10"
}
}テスト
サーバーは MariaDB を自動的にテストし、MariaDB セットアップの機能性を検証します。
トラブルシューティング
問題が発生した場合:
サーバーログでエラーメッセージを確認してください
MariaDBの資格情報と接続の詳細を確認する
MariaDBユーザーに適切な権限があることを確認する
クエリが読み取り専用であり、適切にフォーマットされていることを確認してください
インスピレーション https://github.com/rjsalgado/mariadb-mcp-server
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。
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 Servers
- AlicenseAqualityDmaintenanceEnables interaction with MariaDB databases through secure read-only operations. Supports database exploration, schema inspection, and SQL query execution with comprehensive logging and connection pooling.52MIT
- FlicenseNot gradedqualityDmaintenanceEnables safe interaction with MySQL databases through SELECT queries, table structure inspection, and database schema exploration. Provides read-only access to query data and examine database metadata.1
- AlicenseAqualityCmaintenanceEnables read-only MySQL database access, allowing listing databases, tables, describing schemas, and executing SELECT/SHOW/DESCRIBE/EXPLAIN queries.7674MIT
- AlicenseAqualityCmaintenanceProvides read-only MySQL query execution, database/table browsing, and table structure inspection with SQL safety validation.515MIT
Related MCP Connectors
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Explore your Messages SQLite database to browse tables and inspect schemas with ease. Run flexible…
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
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/bretoreta/mariadb-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server