# mcp-server-mariadb

> MCP Server

This repository provides an MCP server implementation designed to retrieve data from MariaDB databases, exposing schema lists and offering tools like query_database for read-only operations. It also includes instructions for

## Overview

- **Category:** Database
- **Language:** Python
- **Stars:** 20
- **Forks:** 0
- **Owner:** abel9851
- **GitHub:** https://github.com/abel9851/mcp-server-mariadb
- **Created:** 2025-02-18T15:25:15+00:00
- **Updated:** 2025-03-28T01:42:13+00:00
- **Source:** https://model-context-protocol.com/servers/mcp-server-read-only-mariadb-access

## Setup

## Setup

### install mariadb

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

```bash

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.

## Tools

## Available Tools

1. Resources (Expose schema list in database)
2. query_database (Execute read-only operations against MariDB)
