MariaDB MCP Server
MariaDB / MySQL-Datenbankzugriff MCP-Server
Dieser MCP-Server bietet Zugriff auf MariaDB-/MySQL-Datenbanken.
Es ermöglicht Ihnen:
Verfügbare Datenbanken auflisten
Auflisten von Tabellen in einer Datenbank
Beschreiben von Tabellenschemata
Ausführen von SQL-Abfragen
Sicherheitsfunktionen
Nur-Lese-Zugriff Standard : SELECT, SHOW, DESCRIBE und EXPLAIN
Abfragevalidierung : Verhindert SQL-Injection und blockiert alle Versuche zur Datenänderung
Abfrage-Timeout : Verhindert, dass Abfragen mit langer Laufzeit Ressourcen verbrauchen
Zeilenbegrenzung : Verhindert übermäßige Datenrückgabe
Related MCP server: MySQL MCP Server
Installation
Option 1: Aus der Quelle erstellen
# 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. Umgebungsvariablen konfigurieren
Der Server benötigt die folgenden Umgebungsvariablen:
MARIADB_HOST: Hostname des Datenbankservers
MARIADB_PORT: Datenbankserver-Port (Standard: 3306)
MARIADB_USER: Datenbankbenutzername
MARIADB_PASSWORD: Datenbankkennwort
MARIADB_DATABASE: Standarddatenbankname (optional)
MARIADB_ALLOW_INSERT: falsch
MARIADB_ALLOW_UPDATE: falsch
MARIADB_ALLOW_DELETE: falsch
MARIADB_TIMEOUT_MS: 10000
MARIADB_ROW_LIMIT: 1000
3. Zu den MCP-Einstellungen hinzufügen
Fügen Sie Ihrer MCP-Einstellungsdatei die folgende Konfiguration hinzu:
Wenn Sie aus der Quelle erstellt haben:
{
"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": []
}
}
}Verfügbare Tools
Datenbankliste
Listet alle erreichbaren Datenbanken auf dem MariaDB/MySQL-Server auf. Parameter : Keine
Beispiel :
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"sessionId": "session_id from /sse call",
"name": "list_databases"
}
}list_tables
Listet alle Tabellen in einer angegebenen Datenbank auf.
Parameter :
database(optional): Datenbankname (verwendet den Standard, wenn nicht angegeben)
Beispiel :
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"sessionId": "session_id from /sse call",
"name": "list_tables",
"database": "my_database_name"
}
}Tabelle beschreiben
Zeigt das Schema für eine bestimmte Tabelle.
Parameter :
database(optional): Datenbankname (verwendet den Standard, wenn nicht angegeben)table(erforderlich): Tabellenname
Beispiel :
{
"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"
}
}Abfrage ausführen
Führt eine SQL-Abfrage aus.
Parameter :
query(erforderlich): SQL-Abfragedatabase(optional): Datenbankname (verwendet den Standard, wenn nicht angegeben)
Beispiel :
{
"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"
}
}Testen
Der Server testet MariaDB automatisch, um die Funktionalität mit Ihrem MariaDB-Setup zu überprüfen:
Fehlerbehebung
Wenn Probleme auftreten:
Überprüfen Sie die Serverprotokolle auf Fehlermeldungen
Überprüfen Sie Ihre MariaDB-Anmeldeinformationen und Verbindungsdetails
Stellen Sie sicher, dass Ihr MariaDB-Benutzer über die entsprechenden Berechtigungen verfügt
Überprüfen Sie, ob Ihre Abfrage schreibgeschützt und richtig formatiert ist
Inspiration https://github.com/rjsalgado/mariadb-mcp-server
Lizenz
Dieses Projekt ist unter der MIT-Lizenz lizenziert – Einzelheiten finden Sie in der Datei LICENSE .
Available Tools
4 toolsdescribe_tableB
Show the schema for a specific table
Inputs: table (required), database.
execute_queryC
Execute a SQL query
Inputs: query (required), database.
list_databasesB
List all accessible databases on the MariaDB server
Inputs: no named parameters.
list_tablesC
List all tables in a specified database
Inputs: database.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: describe_table shows table schemas, execute_query runs SQL queries, list_databases enumerates databases, and list_tables lists tables within a database. The boundaries are well-defined, preventing agent misselection.
All tool names follow a consistent verb_noun pattern (describe_table, execute_query, list_databases, list_tables) with clear, descriptive verbs. There are no deviations in style or convention, making the set predictable and readable.
Four tools is reasonable for a MariaDB server, covering core operations like listing databases/tables, describing schemas, and executing queries. It feels slightly thin as it lacks CRUD operations (e.g., create_table, insert_data), but it's well-scoped for basic database inspection and query execution.
The tools provide good coverage for database inspection and query execution, but there are notable gaps in CRUD operations (e.g., no create_table, update_data, or delete_table). Agents can work around this using execute_query, but the surface is incomplete for full database management workflows.
Maintenance
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.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
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-
- AlicenseAqualityDmaintenanceEnables read-only MySQL database access, allowing listing databases, tables, describing schemas, and executing SELECT/SHOW/DESCRIBE/EXPLAIN queries.748 npm4MIT
- AlicenseAqualityDmaintenanceProvides read-only MySQL query execution, database/table browsing, and table structure inspection with SQL safety validation.59 npmMIT