MCP Connector

Query MariaDB Databases

Connect to MariaDB databases with this MCP server. Retrieve schema lists and execute read-only queries.

Works with mariadb

Maintainer of this project? Claim this page to edit the listing.


91
Spark score
out of 100
Updated Mar 2025
Version 0.1.2
Models
universal

Add to Favorites

Why it matters

Connect to your MariaDB databases and execute read-only operations. This asset allows you to retrieve data and list schemas directly from your MariaDB instances.

Outcomes

What it gets done

01

Execute read-only queries on MariaDB

02

List available schemas in the database

03

Integrate with MariaDB for data retrieval

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-mariadb | bash

Capabilities

Tools your agent gets

query_database

Execute read-only operations on MariaDB databases

Overview

MariaDB MCP Server

This MCP server implementation retrieves data from MariaDB, exposing schema lists and allowing read-only query execution. Use this server when you need to retrieve schema information from a MariaDB database or execute read-only SQL queries against it.

What it does

This MCP server implementation retrieves data from MariaDB.

Features

Resources

  • Expose schema list in database

Tools

  • query_database: Execute read-only operations against MariaDB.

Dependency

Install MariaDB

On macOS, when installing MariaDB, you may encounter an OSError: mariadb_config not found. This error typically indicates that MariaDB Connector/C is not preinstalled. To resolve this:

  1. Execute brew install mariadb-connector-c
  2. Execute echo 'export PATH="/opt/homebrew/opt/mariadb-connector-c/bin:$PATH"' >> ~/.bashrc
  3. Set environment variable export MARIADB_CONFIG=$(brew --prefix mariadb-connector-c)/bin/mariadb_config
  4. Execute uv add mariadb again.

Usage with Claude Desktop

Configuration File

Paths to Claude Desktop config file:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

<details>
<summary>Add this configuration to enable published servers</summary>

{
    "mcpServers": {
        "mcp_server_mariadb": {
            "command": "/PATH/TO/uvx",
            "args": [
                "mcp-server-mariadb",
                "--host",
                "${DB_HOST}",
                "--port",
                "${DB_PORT}",
                "--user",
                "${DB_USER}",
                "--password",
                "${DB_PASSWORD}",
                "--database",
                "${DB_NAME}"
            ]
        }
    }
}

Note: Replace /PATH/TO/uvx with the full path to the uvx executable.

</details>

<details>
<summary>Add this configuration to enable development/unpublished servers</summary>

{
    "mcpServers": {
        "mcp_server_mariadb": {
            "command": "/PATH/TO/uv",
            "args": [
                "--directory",
                "/YOUR/SOURCE/PATH/mcp-server-mariadb/src/mcp_server_mariadb",
                "run",
                "server.py"
            ],
            "env": {
                "MARIADB_HOST": "127.0.0.1",
                "MARIADB_USER": "USER",
                "MARIADB_PASSWORD": "PASSWORD",
                "MARIADB_DATABASE": "DATABASE",
                "MARIADB_PORT": "3306"
            }
        }
    }
}

Note: Replace /PATH/TO/uv with the full path to the UV executable and /YOUR/SOURCE/PATH/mcp-server-mariadb/src/mcp_server_mariadb with the path to the server source code.

</details>

License

This mcp server is licensed under the MIT license. Please see the LICENSE file in the repository.

Source README

mcp-server-mariadb

An MCP server implementation for retrieving data from mariadb

Features

Resources

Expose schema list in database

Tools

  • query_database
    • Execute read-only operations against MariDB

dependency

install mariadb

  • mac
    • when install mariadb,
      maybe raise os error below.
      you can resolve by installing mariadb-connector-c.

OSError: mariadb_config not found.

      This error typically indicates that MariaDB Connector/C, a dependency which
      must be preinstalled, is not found.
      If MariaDB Connector/C is not installed, see installation instructions
      If MariaDB Connector/C is installed, either set the environment variable
      MARIADB_CONFIG or edit the configuration file 'site.cfg' to set the
       'mariadb_config' option to the file location of the mariadb_config utility.

  1. execute brew install mariadb-connector-c
  2. execute echo 'export PATH="/opt/homebrew/opt/mariadb-connector-c/bin:$PATH"' >> ~/.bashrc
  3. set environment variable export MARIADB_CONFIG=$(brew --prefix mariadb-connector-c)/bin/mariadb_config
  4. execute uv add mariadb again.

Usage with Claude Desktop

Configuration File

Paths to Claude Desktop config file:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
Add this configuration to enable published servers

{
    "mcpServers": {
        "mcp_server_mariadb": {
            "command": "/PATH/TO/uvx"
            "args": [
                "mcp-server-mariadb",
                "--host",
                "${DB_HOST}",
                "--port",
                "${DB_PORT}",
                "--user",
                "${DB_USER}",
                "--password",
                "${DB_PASSWORD}",
                "--database",
                "${DB_NAME}"
            ]
        }
    }
}

Note: Replace these placeholders with actual paths:

  • /PATH/TO/uvx: Full path to uvx executable
Add this configuration to enable development/unpublished servers
{
    "mcpServers": {
        "mcp_server_mariadb": {
            "command": "/PATH/TO/uv",
            "args": [
                "--directory",
                "/YOUR/SOURCE/PATH/mcp-server-mariadb/src/mcp_server_mariadb",
                "run",
                "server.py"
            ],
            "env": {
                "MARIADB_HOST": "127.0.0.1",
                "MARIADB_USER": "USER",
                "MARIADB_PASSWORD": "PASSWORD",
                "MARIADB_DATABASE": "DATABASE",
                "MARIADB_PORT": "3306"
            }
        }
    }
}

Note: Replace these placeholders with actual paths:

  • /PATH/TO/uv: Full path to UV executable
  • /YOUR/SOURCE/PATH/mcp-server-mariadb/src/mcp_server_mariadb: Path to server source code

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.