MariaDB

v1.0.0Databasesstable

Enables AI assistants to securely interact with MariaDB and MySQL databases using granular per-connection read/write permissions and transaction support. It allows users to manage multiple database connections, explore schemas, and execute controlled

mariadbmcpmcp-servermodel-context-protocol
Share:
20
Stars
0
Downloads
0
Weekly
0/5

What is MariaDB?

MariaDB is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai assistants to securely interact with mariadb and mysql databases using granular per-connection read/write permissions and transaction support. it allows users to manage multiple database co...

Enables AI assistants to securely interact with MariaDB and MySQL databases using granular per-connection read/write permissions and transaction support. It allows users to manage multiple database connections, explore schemas, and execute controlled

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables AI assistants to securely interact with MariaDB and

Use Cases

Query and manage MariaDB and MySQL databases with granular permissions. Execute controlled SQL operations with transaction support. Explore database schemas and manage multiple connections securely.
abel9851

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedApr 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mariadb-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MariaDB

The MariaDB MCP Server enables AI assistants to securely query and manage MariaDB and MySQL databases, with granular per-connection read/write permission controls and full transaction support. It exposes a query_database tool for executing SQL and provides schema exploration resources, allowing AI clients to inspect tables and relationships before running operations. Database administrators and developers use it to give Claude or other MCP clients controlled access to relational databases without exposing raw credentials through uncontrolled channels.

Prerequisites

  • Python 3.10 or later with uv package manager installed
  • A running MariaDB or MySQL server (local or remote)
  • The mariadb-connector-c library installed on your system
  • Database credentials: host, port, username, password, and database name
  • An MCP client such as Claude Desktop or Claude Code
1

Install the MariaDB connector library

The Python mariadb package requires the native mariadb-connector-c library. Install it using your system package manager before installing the Python dependencies.

# macOS
brew install mariadb-connector-c
export MARIADB_CONFIG=$(brew --prefix mariadb-connector-c)/bin/mariadb_config

# Ubuntu/Debian
sudo apt-get install libmariadb-dev
2

Clone the repository

Clone the mcp-server-mariadb source code and navigate into the project directory.

git clone https://github.com/abel9851/mcp-server-mariadb.git
cd mcp-server-mariadb
3

Install Python dependencies with uv

Use uv to install the project dependencies, including the mariadb Python connector.

uv add mariadb
# or install all dependencies:
uv sync
4

Configure environment variables

Set the required database connection environment variables. These can be placed in your MCP client config or exported in your shell.

export MARIADB_HOST=127.0.0.1
export MARIADB_USER=your_db_user
export MARIADB_PASSWORD=your_db_password
export MARIADB_DATABASE=your_database_name
export MARIADB_PORT=3306
5

Add the server to your MCP client configuration

Open your claude_desktop_config.json and add the mariadb server entry, pointing to the uv binary and the server.py script with all connection details in the env block.

MariaDB Examples

Client configuration

Complete claude_desktop_config.json entry for the MariaDB MCP server. Replace the command path with the output of 'which uv' and the source path with where you cloned the repository.

{
  "mcpServers": {
    "mcp_server_mariadb": {
      "command": "/usr/local/bin/uv",
      "args": [
        "--directory",
        "/path/to/mcp-server-mariadb/src/mcp_server_mariadb",
        "run",
        "server.py"
      ],
      "env": {
        "MARIADB_HOST": "127.0.0.1",
        "MARIADB_USER": "your_db_user",
        "MARIADB_PASSWORD": "your_db_password",
        "MARIADB_DATABASE": "your_database_name",
        "MARIADB_PORT": "3306"
      }
    }
  }
}

Prompts to try

Use these prompts in Claude Desktop once connected to your MariaDB database.

- "Show me all tables in the database and their row counts."
- "Run a query to find all users who registered in the last 7 days."
- "Describe the schema of the orders table — what columns does it have?"
- "How many records are in each table? Give me a summary."
- "Find any orders with a status of 'pending' that are older than 48 hours."

Troubleshooting MariaDB

Import error for the mariadb Python module at startup

The mariadb Python package requires the native mariadb-connector-c library. On macOS, set the MARIADB_CONFIG environment variable to the path of the mariadb_config binary before running uv add mariadb. On Linux, install libmariadb-dev via apt-get.

Connection refused or authentication failed errors

Verify that MARIADB_HOST, MARIADB_USER, MARIADB_PASSWORD, and MARIADB_PORT are all set correctly in the env block of your MCP config. Confirm the database user has CONNECT privileges on the specified database from the connecting host.

The uv command is not found when Claude Desktop tries to start the server

Use the full absolute path to the uv binary in the command field of your MCP config. Find it by running 'which uv' in your terminal and replacing the placeholder /PATH/TO/uv with the actual path.

Frequently Asked Questions about MariaDB

What is MariaDB?

MariaDB is a Model Context Protocol (MCP) server that enables ai assistants to securely interact with mariadb and mysql databases using granular per-connection read/write permissions and transaction support. it allows users to manage multiple database connections, explore schemas, and execute controlled It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MariaDB?

Follow the installation instructions on the MariaDB GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MariaDB?

MariaDB works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MariaDB free to use?

Yes, MariaDB is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mariadb-mcp-server": { "command": "npx", "args": ["-y", "mariadb-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MariaDB?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides