MySQL MCP Server

Integrations

  • Uses .ENV files for configuration of MySQL connection details including host, username, password, and database name

  • Provides direct access to MySQL databases, allowing execution of SQL queries, table management, and storage of notes with title and content in a MySQL database

  • Runs on Node.js runtime (version 18 or higher) as the execution environment for the MCP server

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 쿼리 실행

필수 조건

  • 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

-
security - not tested
F
license - not found
-
quality - not tested

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

  1. Features
    1. Resources
    2. Tools
  2. Prerequisites
    1. Setup
      1. Installation
        1. For Claude Desktop
        2. For Cline
      2. Usage Examples
        1. List all tables in the database
        2. Execute a SQL query
        3. Create a note
      3. Development
        1. Debugging
      4. License
        ID: cp6c716buh