Skip to main content
Glama
LeonMelamud

MySQL MCP Server

by LeonMelamud

MySQL MCP 서버

MySQL 데이터베이스에 직접 액세스할 수 있는 강력한 MCP 서버입니다. 이 서버를 통해 AI 에이전트는 간단한 인터페이스를 통해 MySQL 데이터베이스와 상호 작용하고, SQL 쿼리를 실행하고, 데이터베이스 콘텐츠를 관리할 수 있습니다.

특징

자원

  • note:///{id} URI를 통해 데이터베이스에 저장된 메모에 액세스합니다.

  • 각 노트에는 제목과 내용이 있습니다

  • 간단한 콘텐츠 액세스를 위한 일반 텍스트 MIME 유형

도구

  • create_note - 데이터베이스에 새로운 텍스트 노트를 생성합니다.

    • 제목과 내용을 필수 매개변수로 사용합니다.

    • MySQL 데이터베이스에 저장됨

  • list_tables - 연결된 데이터베이스의 모든 테이블 나열

  • count_tables - 데이터베이스에 있는 총 테이블 수를 가져옵니다.

  • search_tables - LIKE 패턴을 사용하여 테이블 검색

  • describe_table - 특정 테이블의 구조를 가져옵니다

  • execute_sql - 사용자 정의 SQL 쿼리 실행

Related MCP server: MySQL MCP Server

필수 조건

  • Node.js 18 이상

  • MySQL 서버가 설치되고 실행 중입니다.

  • 적절한 권한이 있는 데이터베이스

설정

  1. 이 저장소를 복제하세요:

    지엑스피1

  2. 종속성 설치:

    npm install
  3. MySQL 연결 세부 정보가 포함된 .env 파일을 루트 디렉토리에 만듭니다.

    MYSQL_HOST=localhost
    MYSQL_USER=your_username
    MYSQL_PASSWORD=your_password
    MYSQL_DATABASE=your_database
  4. 서버를 빌드하세요:

    npm run build

설치

클로드 데스크탑용

Claude Desktop 구성 파일에 서버 구성을 추가합니다.

MacOS의 경우: ~/Library/Application Support/Claude/claude_desktop_config.json Windows의 경우: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql-server/build/index.js"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      }
    }
  }
}

클라인을 위해

Cline MCP 설정 파일에 서버 구성을 추가합니다.

MacOS의 경우: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json Windows의 경우: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

{
  "mcpServers": {
    "mysql": {
      "command": "node",
      "args": ["/path/to/mysql-server/build/index.js"],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_USER": "your_username",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DATABASE": "your_database"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

사용 예

설치가 완료되면 Claude와의 대화에서 MySQL MCP 서버를 사용할 수 있습니다.

데이터베이스의 모든 테이블 나열

Please list all the tables in my MySQL database.

SQL 쿼리 실행

Run this SQL query: SELECT * FROM users LIMIT 5

메모를 만드세요

Create a note titled "Meeting Notes" with the content "Discussed project timeline and assigned tasks."

개발

자동 재빌드를 사용한 개발의 경우:

npm run watch

디버깅

MCP Inspector를 사용하여 서버를 디버깅하세요.

npm run inspector

검사기는 브라우저에서 디버깅 도구에 액세스할 수 있는 URL을 제공합니다.

특허

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A server that enables AI models to interact with MySQL databases through a Model Control Protocol, providing tools for table creation, schema inspection, query execution, and data retrieval.
    28
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server that allows AI agents to execute SQL queries against a MySQL database, supporting operations like reading data, creating tables, inserting, updating, and deleting records.
    6
    684 npm
    7
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server that connects AI agents to MySQL databases for schema exploration, data querying, and SQL execution via natural language.
    2
    MIT