by abel9851
An MCP server that provides read-only access to MariaDB, enabling secure and controlled database interactions within the Model Context Protocol (MCP) framework.
mcp-server-mariadb is an MCP (Model Context Protocol) server implementation designed to provide read-only access to MariaDB databases. It allows other applications and services, particularly those integrated with Claude Desktop, to securely query and retrieve data from a MariaDB instance.
To use mcp-server-mariadb, you need to install MariaDB Connector/C and configure it within your Claude Desktop environment. The README provides detailed instructions for installation, including troubleshooting common OSError: mariadb_config not found
by installing mariadb-connector-c
via brew
and setting environment variables. For Claude Desktop integration, you need to add specific JSON configurations to your claude_desktop_config.json
file, either for published or development servers, specifying the command, arguments, and environment variables for connecting to your MariaDB instance.
query_database
Tool: Provides a dedicated tool for executing database queries.Q: What should I do if I encounter OSError: mariadb_config not found
during installation?
A: This error indicates that MariaDB Connector/C is not found. You can resolve this by installing mariadb-connector-c
(e.g., brew install mariadb-connector-c
on macOS) and then setting the MARIADB_CONFIG
environment variable to the location of the mariadb_config
utility. The README provides specific commands for this.
Q: How do I configure mcp-server-mariadb with Claude Desktop?
A: You need to modify your claude_desktop_config.json
file. The README provides two examples: one for published servers and another for development/unpublished servers. You will need to specify the command to run the server, arguments for database connection details (host, port, user, password, database), and potentially environment variables.
Q: Is mcp-server-mariadb read-only? A: Yes, mcp-server-mariadb is specifically designed to provide read-only access to MariaDB, ensuring data integrity and security.
An MCP server implementation for retrieving data from mariadb
Expose schema list in database
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.
brew install mariadb-connector-c
echo 'export PATH="/opt/homebrew/opt/mariadb-connector-c/bin:$PATH"' >> ~/.bashrc
export MARIADB_CONFIG=$(brew --prefix mariadb-connector-c)/bin/mariadb_config
uv add mariadb
again.Paths to Claude Desktop config file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
{
"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{
"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 codeThis mcp server is licensed under the MIT license. please see the LICENSE file in the repository.
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by googleapis
Provides a configurable MCP server that abstracts connection pooling, authentication, observability, and tool management to accelerate development of database‑backed AI tools.
by bytebase
DBHub is a universal database gateway that implements the Model Context Protocol (MCP) server interface, enabling MCP-compatible clients to interact with various databases.
by neo4j-contrib
Provides Model Context Protocol servers for interacting with Neo4j databases, managing Aura instances, and handling personal knowledge graph memory through natural‑language interfaces.
by mongodb-js
Provides a Model Context Protocol server that connects to MongoDB databases and Atlas clusters, exposing a rich set of tools for querying, managing, and administering data and infrastructure.
by benborla
A Model Context Protocol (MCP) server that provides read-only access to MySQL databases, enabling Large Language Models (LLMs) to inspect database schemas and execute read-only queries.
by ClickHouse
Provides tools that let AI assistants run read‑only SQL queries against ClickHouse clusters or the embedded chDB engine, plus a health‑check endpoint for service monitoring.
by elastic
Provides direct, natural‑language access to Elasticsearch indices via the Model Context Protocol, allowing AI agents to query and explore data without writing DSL.
by motherduckdb
Provides an MCP server that enables SQL analytics on DuckDB and MotherDuck databases, allowing AI assistants and IDEs to execute queries via a unified interface.
by redis
Provides a natural language interface for agentic applications to manage and search data in Redis efficiently.