Skip to main content
Glama
bretoreta

MariaDB MCP Server

by bretoreta

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 build

2. 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-Abfrage

  • 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": "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:

  1. Überprüfen Sie die Serverprotokolle auf Fehlermeldungen

  2. Überprüfen Sie Ihre MariaDB-Anmeldeinformationen und Verbindungsdetails

  3. Stellen Sie sicher, dass Ihr MariaDB-Benutzer über die entsprechenden Berechtigungen verfügt

  4. Ü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 tools
describe_tableB

Show the schema for a specific table

ParametersJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional, uses default if not specified)
tableYesTable name

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states 'show the schema' without disclosing behavioral traits like read-only nature, required permissions, idempotency, or error handling. This is insufficient for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no waste. However, it could include a brief note on sibling differentiation or usage context, but overall it is appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple introspection tool with two parameters and no output schema, the description is adequate but lacks details on return format, error cases, or prerequisites (e.g., table must exist). It does not reference siblings, leaving the agent to infer context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds no additional meaning beyond the schema (e.g., clarifying what 'table' or 'database' refer to). It does not enhance parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Show the schema for a specific table" uses a specific verb and resource, and clearly distinguishes from siblings like list_tables and execute_query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for schema retrieval, but provides no explicit guidance on when to use this tool vs alternatives like list_tables (which only lists names) or execute_query (for custom queries). No when-not-to-use or alternative mentions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_queryC

Execute a SQL query

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query (only SELECT, SHOW, DESCRIBE, and EXPLAIN statements are allowed)
databaseNoDatabase name (optional, uses default if not specified)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('execute a SQL query') but doesn't mention critical behavioral traits such as permissions required, whether it's read-only or mutating, potential side effects, rate limits, or response format. This is a significant gap for a tool that executes queries.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence ('Execute a SQL query'), which is front-loaded and wastes no words. It efficiently communicates the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of executing SQL queries, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like safety, permissions, or result format, which are crucial for an agent to use this tool correctly and safely in context with sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter semantics beyond what the input schema provides. Since schema description coverage is 100%, the baseline is 3. The schema already documents the query parameter with allowed SQL statements and the optional database parameter, so the description doesn't compensate or add value here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('execute') and resource ('SQL query'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like describe_table or list_tables, which also involve database operations but with different verbs and scopes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like describe_table or list_databases. The description lacks context about appropriate use cases, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_databasesB

List all accessible databases on the MariaDB server

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't mention important traits like whether this is a read-only operation, if it requires specific permissions, potential rate limits, or what the output format looks like. This leaves significant gaps for a tool that interacts with a database server.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any unnecessary words. It's perfectly front-loaded and wastes no space, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a database interaction tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'accessible' means in terms of permissions, doesn't describe the return format (e.g., list of strings, structured objects), and provides no behavioral context beyond the basic action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema description coverage is 100%, so there's no need for parameter documentation in the description. The description appropriately focuses on the tool's purpose without redundant parameter information, earning a high baseline score for this dimension.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all accessible databases on the MariaDB server'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_tables' or 'describe_table', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_tables' or 'describe_table'. It lacks any context about prerequisites, timing, or exclusions, leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesC

List all tables in a specified database

ParametersJSON Schema
NameRequiredDescriptionDefault
databaseNoDatabase name (optional, uses default if not specified)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing behavior. It only states the basic function but does not elaborate on side effects, read-only nature, error handling (e.g., what if the database doesn't exist), or the meaning of 'default' database. This lack of detail limits transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no redundant information. It is concise and to the point, using no filler words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one optional parameter, no output schema), the description is minimally adequate. However, it misses details like what 'default' database refers to or whether the tool requires any privileges. It does not fully prepare the agent for all usage scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter 'database', which already explains its optionality and default behavior. The description adds no additional semantic value beyond restating 'in a specified database', which is already implicit from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List all tables in a specified database' clearly identifies the action (list) and resource (tables), distinguishing it from sibling tools like list_databases (lists databases) and describe_table (describes a single table). However, the word 'specified' implies the database parameter is required, while the schema marks it as optional, causing minor ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as describe_table or execute_query. There is no mention of prerequisites, limitations, or explicit when-to-use/when-not-to-use instructions, leaving the agent to infer appropriate usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updates
    • First observeddescribe_table
    • First observedexecute_query
    • First observedlist_databases
    • First observedlist_tables

TDQS

B3.4/5.0

Scored across 4 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count4/5

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.

Completeness3/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables interaction with MariaDB databases through secure read-only operations. Supports database exploration, schema inspection, and SQL query execution with comprehensive logging and connection pooling.
    5
    2
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables read-only MySQL database access, allowing listing databases, tables, describing schemas, and executing SELECT/SHOW/DESCRIBE/EXPLAIN queries.
    7
    37 npm
    4
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides read-only MySQL query execution, database/table browsing, and table structure inspection with SQL safety validation.
    5
    9 npm
    MIT