Fire in da houseTop Tip:Most people pay up to $340 per month for Perplexity, MidJourney, Runway, ChatGPT, and more - but you can get them all your AI tools for $15 with Galaxy. It's free to test!Fire in da houseCheck it out

mcp-server-mariadb

MCP.Pizza Chef: abel9851

mcp-server-mariadb is an MCP server that offers read-only access to MariaDB databases. It exposes database schema information and allows executing read-only queries via a dedicated tool, enabling safe and structured data retrieval from MariaDB instances. It supports integration with MCP clients for real-time database context feeding and query execution, facilitating database-driven AI workflows.

Use This MCP server To

Expose MariaDB schema for AI model context Execute read-only SQL queries on MariaDB databases Integrate MariaDB data into AI-enhanced workflows Provide structured database data to MCP clients Enable safe, read-only database querying for agents

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

License

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

mcp-server-mariadb FAQ

How do I install dependencies for mcp-server-mariadb on macOS?
Install MariaDB Connector/C using 'brew install mariadb-connector-c' and update your PATH environment variable accordingly.
Can mcp-server-mariadb perform write operations on the database?
No, it only supports read-only operations to ensure data safety.
What kind of database access does mcp-server-mariadb provide?
It provides structured, read-only access to MariaDB databases including schema exposure and query execution.
Is mcp-server-mariadb compatible with multiple LLM providers?
Yes, it can be used with OpenAI, Anthropic Claude, and Google Gemini via MCP clients.
How does mcp-server-mariadb expose database schema?
It lists available schemas in the connected MariaDB instance as part of its resource exposure.
What should I do if I encounter 'mariadb_config not found' error?
Install MariaDB Connector/C and set the MARIADB_CONFIG environment variable or update the site.cfg file.
Can I use mcp-server-mariadb for real-time data retrieval?
Yes, it supports real-time read-only queries to provide up-to-date database context.
Does mcp-server-mariadb support other SQL databases?
No, it is specifically designed for MariaDB.