RM

rjsalgado/mariadb-mcp-server

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

14 stars 8 forks 품질 78 트렌드 24MIT

An MCP server that provides access to MariaDB ou MySQL databases.

개요

This MCP server exposes MariaDB and MySQL databases to MCP clients such as Claude Desktop, VS Code, and other compatible tools. It provides tools to: - list available databases - list tables in a database - describe table schemas - execute SQL queries - Safe-by-default behavior: read-only access is enabled by default - Query validation to block disallowed statements and reduce injection risk - Configurable write permissions through environment variables - Timeout and row-limit protection - Numeric safety for insert IDs and BIGINT values returned by the MariaDB driver Set the following environment variables before starting the server: - MARIADB_HOST: Database host - MARIADB_PORT: Database port (default: 3306) - MARIADB_USER: Database username - MARIADB_PASSWORD: Database password - MARIADB_DATABASE: Default database name (optional) - MARIADB_ALLOW_INSERT: Enable INSERT statements (true/false) - MARIADB_ALLOW_UPDATE: Enable UPDATE statements (true/false) - MARIADB_ALLOW_DELETE:...

README

원문 README의 일부입니다. 원문 보기.

MariaDB / MySQL MCP Server

This MCP server exposes MariaDB and MySQL databases to MCP clients such as Claude Desktop, VS Code, and other compatible tools.

It provides tools to:

  • list available databases
  • list tables in a database
  • describe table schemas
  • execute SQL queries

Features

  • Safe-by-default behavior: read-only access is enabled by default
  • Query validation to block disallowed statements and reduce injection risk
  • Configurable write permissions through environment variables
  • Timeout and row-limit protection
  • Numeric safety for insert IDs and BIGINT values returned by the MariaDB driver

Installation

Option 1: Install from npm

npm install -g mariadb-mcp-server

Option 2: Install locally

npm install mariadb-mcp-server

Option 3: Build from source

git clone https://github.com/rjsalgado/mariadb-mcp-server.git
cd mariadb-mcp-server
npm install
npm run build

Configuration

Set the following environment variables before starting the server:

  • MARIADB_HOST: Database host
  • MARIADB_PORT: Database port (default: 3306)
  • MARIADB_USER: Database username
  • MARIADB_PASSWORD: Database password
  • MARIADB_DATABASE: Default database name (optional)
  • MARIADB_ALLOW_INSERT: Enable INSERT statements (true/false)
  • MARIADB_ALLOW_UPDATE: Enable UPDATE statements (true/false)
  • MARIADB_ALLOW_DELETE: Enable DELETE statements (true/false)
  • MARIADB_TIMEOUT_MS: Query timeout in milliseconds (default: 10000)
  • MARIADB_ROW_LIMIT: Maximum number of rows returned (default: 1000)

Example:

export MARIADB_HOST=localhost
export MARIADB_PORT=3306
export MARIADB_USER=myuser
export MARIADB_PASSWORD=mypassword
export MARIADB_DATABASE=mydb
export MARIADB_ALLOW_INSERT=false
export MARIADB_ALLOW_UPDATE=false
export MARIADB_ALLOW_DELETE=false
export MARIADB_TIMEOUT_MS=10000
export MARIADB_ROW_LIMIT=1000

MCP configuration

Using npm package

{
  "mcpServers": {
    "mariadb": {
      "command": "npx",
      "args": ["mariadb-mcp-server"],
      "env": {
        "MARIADB_HOST": "your-host",
        "MARIADB_PORT": "3306",
        "MARIADB_USER": "your-user",
        "MARIADB_PASSWORD": "your-password",
        "MARIADB_DATABASE": "your-database",
        "MARIADB_ALLOW_INSERT": "false",
        "MARIADB_ALLOW_UPDATE": "false",
        "MARIADB_ALLOW_DELETE": "false",
        "MARIADB_TIMEOUT_MS": "10000",
        "MARIADB_ROW_LIMIT": "1000"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Using a built local server

{
  "mcpServers": {
    "mariadb": {
      "command": "node",
      "args": ["/absolute/path/to/mariadb-mcp-server/dist/index.js"],
      "env": {
        "MARIADB_HOST": "your-host",
        "MARIADB_PORT": "3306",
        "MARIADB_USER": "your-user",
        "MARIADB_PASSWORD": "your-password",
        "MARIADB_DATABASE": "your-database",
        "MARIADB_ALLOW_INSERT": "false",
GitHub에서 전체 README 보기

설치

npx mariadb-mcp-server
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "mariadb": { "command": "npx", "args": ["mariadb-mcp-server"], "env": { "MARIADB_HOST": "your-host", "MARIADB_PORT": "3306", "MARIADB_USER": "your-user", "MARIADB_PASSWORD": "your-password", "MARIADB_DATABASE": "your-database", "MARIADB_ALLOW_INSERT": "false", "MARIADB_ALLOW_UPDATE": "false", "MARIADB_ALLOW_DELETE": "false", "MARIADB_TIMEOUT_MS": "10000", "MARIADB_ROW_LIMIT": "1000" }, "disabled": false, "autoApprove": [] } } }