Database · MODEL CONTEXT PROTOCOL
mcp-server-mariadb
An mcp server that provides read-only access to MariaDB.
连接能力
mcp-server-mariadb 为 AI Agent 提供什么
- query_database
- Execute read-only operations against MariDB
- mac
- when install mariadb,
- execute `brew install mariadb-connector-c`
- execute `echo 'export PATH="/opt/homebrew/opt/mariadb-connector-c/bin:$PATH"' >> ~/.bashrc`
- set environment variable `export MARIADB_CONFIG=$(brew --prefix mariadb-connector-c)/bin/mariadb_config`
- execute `uv add mariadb` again.
- **MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
- `/PATH/TO/uvx`: Full path to uvx executable
- `/PATH/TO/uv`: Full path to UV executable
- `/YOUR/SOURCE/PATH/mcp-server-mariadb/src/mcp_server_mariadb`: Path to server source code
安全
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。
README
仓库文档
An MCP server implementation for retrieving data from mariadb
Expose schema list in database
- query_database
- Execute read-only operations against MariDB
- 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.
- execute
brew install mariadb-connector-c - execute
echo 'export PATH="/opt/homebrew/opt/mariadb-connector-c/bin:$PATH"' >> ~/.bashrc - set environment variable
export MARIADB_CONFIG=$(brew --prefix mariadb-connector-c)/bin/mariadb_config - execute
uv add mariadbagain.
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
This mcp server is licensed under the MIT license. please see the LICENSE file in the repository.
社区
收藏、评分与讨论
正在载入社区数据…