Skip to main content
Glama
MariaDB MCP Server

MariaDB MCP Server

by bretoreta

MariaDB / MySQL 데이터베이스 액세스 MCP 서버

이 MCP 서버는 MariaDB/MySQL 데이터베이스에 대한 액세스를 제공합니다.

이를 통해 다음이 가능합니다.

  • 사용 가능한 데이터베이스 나열

  • 데이터베이스의 테이블 나열

  • 테이블 스키마 설명

  • SQL 쿼리 실행

보안 기능

  • 읽기 전용 액세스 기본값 : SELECT, SHOW, DESCRIBE 및 EXPLAIN

  • 쿼리 검증 : SQL 주입을 방지하고 모든 데이터 수정 시도를 차단합니다.

  • 쿼리 시간 초과 : 장기 실행 쿼리가 리소스를 소모하는 것을 방지합니다.

  • 행 제한 : 과도한 데이터 반환을 방지합니다.

Related MCP server: MySQL MCP Server

설치

옵션 1: 소스에서 빌드

지엑스피1

2. 환경 변수 구성

서버에는 다음과 같은 환경 변수가 필요합니다.

  • MARIADB_HOST: 데이터베이스 서버 호스트 이름

  • MARIADB_PORT: 데이터베이스 서버 포트(기본값: 3306)

  • MARIADB_USER: 데이터베이스 사용자 이름

  • MARIADB_PASSWORD: 데이터베이스 비밀번호

  • MARIADB_DATABASE: 기본 데이터베이스 이름(선택 사항)

  • MARIADB_ALLOW_INSERT: 거짓

  • MARIADB_ALLOW_UPDATE: 거짓

  • MARIADB_ALLOW_DELETE: 거짓

  • MARIADB_TIMEOUT_MS: 10000

  • MARIADB_ROW_LIMIT: 1000

3. MCP 설정에 추가

MCP 설정 파일에 다음 구성을 추가하세요.

소스에서 빌드한 경우:

{
  "mcpServers": {
    "mariadb": {
      "command": "node",
      "args": ["/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-default-database",
        "MARIADB_ALLOW_INSERT": "false",
        "MARIADB_ALLOW_UPDATE": "false",
        "MARIADB_ALLOW_DELETE": "false",
        "MARIADB_TIMEOUT_MS": "10000",
        "MARIADB_ROW_LIMIT": "1000",
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

사용 가능한 도구

목록_데이터베이스

MariaDB/MySQL 서버에서 접근 가능한 모든 데이터베이스를 나열합니다. 매개변수 : 없음

예 :

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "sessionId": "session_id from /sse call",
    "name": "list_databases"
  }
}

리스트_테이블

지정된 데이터베이스의 모든 테이블을 나열합니다.

매개변수 :

  • database (선택 사항): 데이터베이스 이름(지정하지 않으면 기본값 사용)

예 :

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "sessionId": "session_id from /sse call",
    "name": "list_tables",
    "database": "my_database_name"
  }
}

설명_테이블

특정 테이블에 대한 스키마를 보여줍니다.

매개변수 :

  • database (선택 사항): 데이터베이스 이름(지정하지 않으면 기본값 사용)

  • table (필수): 테이블 이름

예 :

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "sessionId": "session_id from /sse call",
    "name": "describe_table",
    "database": "my_database_name",
    "table": "my_table_name"
  }
}

실행_쿼리

SQL 쿼리를 실행합니다.

매개변수 :

  • query (필수): SQL 쿼리

  • database (선택 사항): 데이터베이스 이름(지정하지 않으면 기본값 사용)

예 :

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "sessionId": "session_id from /sse call",
    "name": "execute_query",
    "query": "SELECT * FROM my_table LIMIT 10"
  }
}

테스트

서버는 사용자의 MariaDB 설정으로 기능을 검증하기 위해 자동으로 MariaDB를 테스트합니다.

문제 해결

문제가 발생하는 경우:

  1. 오류 메시지는 서버 로그에서 확인하세요.

  2. MariaDB 자격 증명 및 연결 세부 정보를 확인하세요.

  3. MariaDB 사용자에게 적절한 권한이 있는지 확인하세요.

  4. 귀하의 쿼리가 읽기 전용이고 올바르게 형식화되었는지 확인하십시오.

영감 https://github.com/rjsalgado/mariadb-mcp-server

특허

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.

Available Tools

4 tools
describe_tableB

Show the schema for a specific table

Inputs: table (required), database.

execute_queryC

Execute a SQL query

Inputs: query (required), database.

list_databasesB

List all accessible databases on the MariaDB server

Inputs: no named parameters.

list_tablesC

List all tables in a specified database

Inputs: database.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: describe_table shows table schemas, execute_query runs SQL queries, list_databases enumerates databases, and list_tables lists tables within a database. The boundaries are well-defined, preventing agent misselection.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (describe_table, execute_query, list_databases, list_tables) with clear, descriptive verbs. There are no deviations in style or convention, making the set predictable and readable.

    Tool Count4/5

    Four tools is reasonable for a MariaDB server, covering core operations like listing databases/tables, describing schemas, and executing queries. It feels slightly thin as it lacks CRUD operations (e.g., create_table, insert_data), but it's well-scoped for basic database inspection and query execution.

    Completeness3/5

    The tools provide good coverage for database inspection and query execution, but there are notable gaps in CRUD operations (e.g., no create_table, update_data, or delete_table). Agents can work around this using execute_query, but the surface is incomplete for full database management workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables interaction with MariaDB databases through secure read-only operations. Supports database exploration, schema inspection, and SQL query execution with comprehensive logging and connection pooling.
      5
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables safe interaction with MySQL databases through SELECT queries, table structure inspection, and database schema exploration. Provides read-only access to query data and examine database metadata.
      1
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables read-only MySQL database access, allowing listing databases, tables, describing schemas, and executing SELECT/SHOW/DESCRIBE/EXPLAIN queries.
      7
      48 npm
      4
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Provides read-only MySQL query execution, database/table browsing, and table structure inspection with SQL safety validation.
      5
      9 npm
      MIT