Mariadb MCP Server

An MCP server that provides access to MariaDB ou MySQL databases.

Local serverstdio

What is the Mariadb MCP server?

Mariadb mcp server connects Mariadb to AI assistants that speak the Model Context Protocol. An MCP server that provides access to MariaDB ou MySQL databases.

What Mariadb does

This MCP server provides access to MariaDB / MySQL databases.

Tools it exposes

Once connected, the assistant can call these 4 tools directly:

  • list_databases — Lists all accessible databases on the MariaDB / MySQL server. Parameters: None
  • list_tables — The list_tables tool exposed by this server
  • describe_table — The describe_table tool exposed by this server
  • execute_query — The execute_query tool exposed by this server

Installing the mariadb mcp server

The server is distributed via npm as pnpm, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.

Configuration

The server reads 8 environment variables: MARIADB_HOST, MARIADB_PORT, MARIADB_USER, MARIADB_PASSWORD, MARIADB_DATABASE, MARIADB_ALLOW_INSERT, MARIADB_ALLOW_UPDATE, MARIADB_ALLOW_DELETE. Keep credentials in your client's env block or a secrets manager rather than committing them.

Where it fits

Database servers turn schema archaeology and ad-hoc reporting into conversation, which is why they tend to be the second or third server people install. Mariadb sits in that group, and the shape of its toolset — list_databases, list_tables, describe_table among others — tells you what it is really for. Worth comparing against the other databases servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • Maintained by bretoreta.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the mariadb mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
list_databasesLists all accessible databases on the MariaDB / MySQL server. **Parameters**: None
list_tablesThe list_tables tool exposed by this server.
describe_tableThe describe_table tool exposed by this server.
execute_queryThe execute_query tool exposed by this server.

How to install the Mariadb MCP server

{
  "mcpServers": {
    "mariadb": {
      "command": "npx",
      "args": ["-y", "pnpm"],
      "env": {
        "MARIADB_HOST": "your-value",
        "MARIADB_PORT": "your-value",
        "MARIADB_USER": "your-value",
        "MARIADB_PASSWORD": "your-value",
        "MARIADB_DATABASE": "your-value",
        "MARIADB_ALLOW_INSERT": "your-value",
        "MARIADB_ALLOW_UPDATE": "your-value",
        "MARIADB_ALLOW_DELETE": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
MARIADB_HOSTEndpoint or connection string the server talks to.Optional
MARIADB_PORTConfiguration value read at startup.Optional
MARIADB_USERConfiguration value read at startup.Optional
MARIADB_PASSWORDConfiguration value read at startup.Optional
MARIADB_DATABASEConfiguration value read at startup.Optional
MARIADB_ALLOW_INSERTConfiguration value read at startup.Optional
MARIADB_ALLOW_UPDATEConfiguration value read at startup.Optional
MARIADB_ALLOW_DELETEConfiguration value read at startup.Optional

Example prompts to try

  • Use Mariadb to list databases.
  • Use Mariadb to list tables.
  • Use Mariadb to describe table.

Frequently asked questions

It connects Mariadb to MCP-compatible AI assistants such as Claude and Cursor, exposing 4 tools (list_databases, list_tables, describe_table, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Mariadb directly.