MCP ExplorerExplorer

Mcp Server Mariadb

@abel9851on a year ago
16 MIT
FreeCommunity
AI Systems
#mariadb#model-context-protocol#mcp#mcp-server
A MCP Server that provides read-only access to MariaDB.

Overview

What is Mcp Server Mariadb

mcp-server-mariadb is an MCP server implementation designed to provide read-only access to data stored in a MariaDB database.

Use cases

Use cases for mcp-server-mariadb include providing data access for analytics tools, enabling reporting systems that require read-only data, and supporting application backends that need to retrieve data without modifying it.

How to use

To use mcp-server-mariadb, configure the server settings in the Claude Desktop configuration file, specifying the database connection parameters such as host, port, user, password, and database name. Then, run the server using the appropriate command.

Key features

Key features include the ability to expose schema lists from the database and execute read-only operations against MariaDB using the query_database tool.

Where to use

mcp-server-mariadb can be used in environments where read-only access to a MariaDB database is required, such as data analysis, reporting, and application development.

Content

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

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.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers