Skip to main content
Glama
MySql MCP Server

MySql MCP Server

대장간 배지

MySQL MCP 서버

라이센스: MIT

AI 모델이 구조화된 인터페이스를 통해 MySQL 데이터베이스와 상호 작용할 수 있도록 하는 MySQL 데이터베이스용 MCP(모델 컨텍스트 프로토콜) 서버입니다.

개요

MySQL MCP 서버는 AI 모델과 MySQL 데이터베이스를 연결하는 다리 역할을 하여 AI 에이전트가 MySQL 데이터를 쿼리하고 분석할 수 있도록 합니다. 이 구현은 모델 컨텍스트 프로토콜(Model Context Protocol) 사양을 따르며 웹 서버 및 CLI 운영 모드를 모두 제공합니다.

Related MCP server: MySQL MCP Server

특징

  • MySQL 데이터베이스 연결 관리

  • SQL 쿼리 실행

  • 테이블 목록 및 구조 검사

  • 데이터베이스 목록 및 선택

  • SSE(Server-Sent Events)를 통한 실시간 상태 모니터링

  • MCP 도구 테스트를 위한 웹 인터페이스

  • stdio 및 SSE 전송 방법 모두 지원

  • Docker 배포 준비 완료

설치

지엑스피1

AI 어시스턴트와 함께 사용

Smithery.ai에서 게시된 서버 사용

MySQL MCP 서버는 Smithery.ai에 게시되어 있으며 다양한 AI 어시스턴트와 함께 쉽게 사용할 수 있습니다.

  1. 서버에 접속하세요 : https://smithery.ai/server/@sussa3007/mysql-mcp 를 방문하세요

  2. 서버 구성 :

    • MySQL 데이터베이스 연결 세부 정보를 설정하세요.

      • MySQL 호스트

      • MySQL_포트

      • MySQL 사용자

      • MySQL 비밀번호

      • MySQL 데이터베이스

      • MYSQL_READONLY(선택 사항, 읽기 전용 액세스의 경우 True로 설정)

  3. 지원되는 AI 플랫폼에 연결 :

    • 인간주의적 클로드

    • 커서 AI

    • 윈드서핑

    • 클라인

    • 위트시

    • 엔콘보

    • 거위

  4. 인증 : Smithery.ai에 로그인하여 구성을 저장하고 인증 토큰을 생성합니다.

  5. AI 프롬프트에서 사용 : 연결되면 AI 대화에서 MySQL 도구를 활용하여 도우미에게 데이터베이스 작업을 수행하도록 요청할 수 있습니다.

로컬 설치 후 사용

로컬로 개발된 버전을 사용하려면:

  1. 프로젝트 디렉토리에서 npm link 실행하세요.

  2. 다음과 같이 설정 파일을 구성하세요.

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["mysql-mcp"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database",
        "MYSQL_READONLY": "true"
      }
    }
  }
}

도구

상태

현재 데이터베이스 연결 상태를 확인하세요.

  • 입력 : 매개변수가 필요하지 않습니다

  • 반환 : 호스트, 포트, 데이터베이스, 연결된 경우 사용자 이름을 포함한 연결 상태 정보입니다.

연결하다

MySQL 데이터베이스에 연결합니다.

  • 입력 :

    • 호스트(선택적 문자열): 데이터베이스 서버 호스트 이름 또는 IP 주소

    • port(선택 문자열): 데이터베이스 서버 포트

    • user(선택 문자열): 데이터베이스 사용자 이름

    • password (선택 문자열): 데이터베이스 비밀번호

    • database(선택적 문자열): 연결할 데이터베이스 이름

  • 반환값 : 연결 성공 메시지 또는 오류 세부 정보.

연결 해제

현재 MySQL 데이터베이스 연결을 닫습니다.

  • 입력 : 매개변수가 필요하지 않습니다

  • 반환값 : 연결 해제 성공 메시지 또는 오류 세부 정보.

질문

연결된 데이터베이스에서 SQL 쿼리를 실행합니다.

  • 입력 :

    • sql(문자열): 실행할 SQL 쿼리

    • params(선택적 배열): 준비된 명령문에 대한 매개변수

  • 반환 : JSON 또는 오류 메시지 형태의 쿼리 결과입니다.

리스트_테이블

현재 데이터베이스의 테이블 목록을 가져옵니다.

  • 입력 : 매개변수가 필요하지 않습니다

  • 반환값 : 현재 데이터베이스의 테이블 이름 목록입니다.

설명_테이블

특정 테이블의 구조를 가져옵니다.

  • 입력 :

    • table(문자열): 설명할 테이블의 이름

  • 반환 : 열, 유형, 키 및 기타 속성을 포함한 테이블 구조 세부 정보입니다.

목록_데이터베이스

서버에서 접근 가능한 모든 데이터베이스 목록을 가져옵니다.

  • 입력 : 매개변수가 필요하지 않습니다

  • 반환값 : 서버에서 사용 가능한 데이터베이스 이름 목록입니다.

데이터베이스 사용

다른 데이터베이스로 전환합니다.

  • 입력 :

    • database(문자열): 전환할 데이터베이스의 이름

  • 반환 : 확인 메시지 또는 오류 세부 정보.

키워드

MySQL, MCP, 데이터베이스, AI, 모델 컨텍스트 프로토콜

특허

MIT

Available Tools

9 tools
connectC

Connect to a MySQL database.

Inputs: database, host, password, port, +1 more.

describe_tableA

Get the structure of a specific table.

Inputs: table (required).

disconnectB

Close the current MySQL database connection.

Inputs: random_string (required).

list_databasesB

Get a list of all accessible databases on the server.

Inputs: random_string (required).

list_tablesB

Get a list of tables in the current database.

Inputs: random_string (required).

queryC

Execute an SQL query on the connected database.

Inputs: sql (required), params.

set_readonlyB

Enable or disable read-only mode

Inputs: readonly (required).

statusC

Check the current database connection status.

Inputs: random_string (required).

use_databaseB

Switch to a different database.

Inputs: database (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity: connection management (connect, disconnect, status), database navigation (list_databases, use_database), table operations (list_tables, describe_table), query execution (query), and mode control (set_readonly). The descriptions reinforce non-overlapping functionality.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with clear verb_noun combinations (e.g., list_databases, describe_table, use_database). The naming is predictable and readable throughout the set.

    Tool Count5/5

    With 9 tools, the count is well-scoped for a MySQL database server, covering essential operations like connection management, database/table listing, query execution, and configuration. Each tool earns its place without redundancy.

    Completeness4/5

    The tool set provides strong coverage for core MySQL operations, including CRUD-like functionality via the query tool and lifecycle management. A minor gap is the lack of explicit tools for schema modification (e.g., create/alter/drop tables), but agents can work around this using SQL queries.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI models to perform MySQL database operations through a standardized interface, supporting secure connections, query execution, and comprehensive schema management.
      7
      79 npm
      33
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides secure access to MySQL databases for AI assistants, enabling safe SQL queries, table information retrieval, and data insertion with built-in security protections.
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A tool service that enables AI agents to interact with MySQL databases through natural language, supporting SQL queries, table structure retrieval, and connection testing.
      7
      32
      Apache 2.0