Skip to main content
Glama
aqara-docs

MySQL MCP Server

by aqara-docs

Smithery AI에 등록하는 방법을 알기 위해서 다음 사이트의 코드를 한글로만 바꿔서 올렸습니다.

#https://github.com/designcomputer/mysql_mcp_server

MySQL MCP 서버

MySQL 데이터베이스와의 안전한 상호작용을 가능하게 하는 Model Context Protocol (MCP) 구현체입니다. 이 서버 컴포넌트는 AI 애플리케이션(호스트/클라이언트)과 MySQL 데이터베이스 간의 통신을 용이하게 하여, 제어된 인터페이스를 통해 데이터베이스 탐색 및 분석을 더 안전하고 구조화된 방식으로 수행할 수 있게 합니다.

참고: MySQL MCP 서버는 독립 실행형 서버로 사용하도록 설계되지 않았으며, AI 애플리케이션과 MySQL 데이터베이스 간의 통신 프로토콜 구현체로 사용됩니다.

주요 기능

  • 사용 가능한 MySQL 테이블을 리소스로 나열

  • 테이블 내용 읽기

  • 적절한 오류 처리가 포함된 SQL 쿼리 실행

  • 환경 변수를 통한 안전한 데이터베이스 접근

  • 포괄적인 로깅

Related MCP server: MySQL MCP Server

설치

수동 설치

pip install mysql-mcp-server

Smithery를 통한 설치

Smithery를 통해 Claude Desktop용 MySQL MCP 서버를 자동으로 설치하려면:

npx -y @smithery/cli install mysql-mcp-server --client claude

설정

다음 환경 변수를 설정하세요:

MYSQL_HOST=localhost     # 데이터베이스 호스트
MYSQL_PORT=3306         # 선택사항: 데이터베이스 포트 (지정하지 않으면 기본값 3306)
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database

사용법

Claude Desktop과 함께 사용

claude_desktop_config.json에 다음을 추가하세요:

{
  "mcpServers": {
    "mysql": {
      "command": "uv",
      "args": [
        "--directory", 
        "path/to/mysql_mcp_server",
        "run",
        "mysql_mcp_server"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

Visual Studio Code와 함께 사용

mcp.json에 다음을 추가하세요:

{
  "servers": {
      "mysql": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "--from",
                "mysql-mcp-server",
                "mysql_mcp_server"
            ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
  }
}

참고: 이 기능을 사용하려면 uv를 설치해야 합니다.

MCP Inspector로 디버깅

MySQL MCP 서버는 독립 실행형으로 또는 Python을 통해 직접 명령줄에서 실행하도록 설계되지 않았지만, MCP Inspector를 사용하여 디버깅할 수 있습니다.

MCP Inspector는 MCP 구현을 테스트하고 디버깅하는 편리한 방법을 제공합니다:

# 의존성 설치
pip install -r requirements.txt
# 디버깅을 위해 MCP Inspector 사용 (Python으로 직접 실행하지 마세요)

MySQL MCP 서버는 Claude Desktop과 같은 AI 애플리케이션과 통합되도록 설계되었으며, 독립 실행형 Python 프로그램으로 직접 실행해서는 안 됩니다.

개발

# 저장소 클론
git clone https://github.com/yourusername/mysql_mcp_server.git
cd mysql_mcp_server
# 가상 환경 생성
python -m venv venv
source venv/bin/activate  # Windows에서는 `venv\Scripts\activate`
# 개발 의존성 설치
pip install -r requirements-dev.txt
# 테스트 실행
pytest

보안 고려사항

  • 환경 변수나 자격 증명을 절대 커밋하지 마세요

  • 최소한의 필요한 권한만 가진 데이터베이스 사용자를 사용하세요

  • 프로덕션 사용을 위해 쿼리 화이트리스팅 구현을 고려하세요

  • 모든 데이터베이스 작업을 모니터링하고 로깅하세요

보안 모범 사례

이 MCP 구현은 기능을 위해 데이터베이스 접근이 필요합니다. 보안을 위해:

  1. 최소 권한을 가진 전용 MySQL 사용자 생성

  2. 루트 자격 증명이나 관리자 계정을 절대 사용하지 않기

  3. 필요한 작업에만 데이터베이스 접근 제한

  4. 감사 목적으로 로깅 활성화

  5. 데이터베이스 접근에 대한 정기적인 보안 검토

자세한 지침은 MySQL 보안 설정 가이드를 참조하세요:

  • 제한된 MySQL 사용자 생성

  • 적절한 권한 설정

  • 데이터베이스 접근 모니터링

  • 보안 모범 사례

⚠️ 중요: 데이터베이스 접근을 구성할 때 항상 최소 권한 원칙을 따르세요.

라이선스

MIT 라이선스 - 자세한 내용은 LICENSE 파일을 참조하세요.

기여하기

  1. 저장소를 포크하세요

  2. 기능 브랜치를 생성하세요 (git checkout -b feature/amazing-feature)

  3. 변경사항을 커밋하세요 (git commit -m 'Add some amazing feature')

  4. 브랜치에 푸시하세요 (git push origin feature/amazing-feature)

  5. Pull Request를 열어주세요

Available Tools

1 tool
execute_sqlC

MySQL 서버에서 SQL 쿼리를 실행합니다

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes실행할 SQL 쿼리

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, and the description does not disclose behavioral traits such as whether the tool modifies data, requires permissions, has rate limits, or handles errors. For a potentially destructive tool like SQL execution, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no superfluous words, making it concise. However, it lacks structured sections that would improve readability and scannability for an agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of SQL execution (potential for destructive actions) and absence of output schema, the description is incomplete. It does not mention return values, error handling, or security implications, leaving critical gaps for an agent to use the tool safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the single parameter 'query' has a description). The tool description adds no additional meaning beyond the schema, such as SQL syntax expectations or multi-statement handling. Baseline score 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes SQL queries on a MySQL server, providing specific verb and resource. However, it does not differentiate between query types (e.g., SELECT vs DML) but absence of sibling tools reduces need for differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. There is no indication of when to use this tool versus alternatives, nor any prerequisites or cautionary notes about query types or connection setup.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev0.2.2
    • First observedexecute_sql

TDQS

B3/5.0
Disambiguation5/5

Only one tool exists, so there is no ambiguity. An agent can easily identify the sole purpose of executing SQL queries.

Naming Consistency5/5

With a single tool, naming consistency is not a concern. The snake_case name 'execute_sql' is clear and follows a common convention.

Tool Count2/5

A MySQL server typically requires multiple tools for schema management, transaction control, and querying; a single tool feels insufficient for the scope.

Completeness1/5

The server is severely incomplete, lacking essential operations like listing tables, describing schemas, managing transactions, or handling multiple queries.

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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
    121
    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.
    454
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI models to interact with MySQL databases through a standardized interface, supporting queries, data manipulation, table inspection, and query performance analysis with secure prepared statements.
    36
    22
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aqara-docs/mysql-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server