Skip to main content
Glama

MySQL MCP Server

by bibaram
MIT License
779
  • Apple

MySQL MCP Server

MySQL 데이터베이스에 연결할 수 있는 Model Context Protocol (MCP) 서버입니다.

기능

  • MySQL 데이터베이스 연결
  • SQL 쿼리 실행
  • 테이블 목록 조회
  • 테이블 구조 확인

설치

git clone https://github.com/bibaram/mysql-mcp-server.git cd mysql-mcp-server npm install

의존성에 문제가 있는 경우

npm install @modelcontextprotocol/sdk mysql2

위 내용을 선행 후 git에서 받은 것을 다운로드 덮어 씌운 뒤

npm install

사용법

1. 직접 실행 경우

# 환경 변수 설정 export DB_HOST=localhost export DB_PORT=3306 export DB_USER=root export DB_PASSWORD=your_password export DB_NAME=your_database # 서버 시작 npm start

2. Claude Desktop 설정 해서 사용 할 경우

Claude Desktop의 설정 파일에 다음과 같이 추가하세요:

Windows: %APPDATA%/Claude/claude_desktop_config.json

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{ "mcpServers": { "mysql": { "command": "node", "args": ["path/to/mysql-mcp-server/server.js"], "env": { "DB_HOST": "localhost", "DB_USER": "root", "DB_PASSWORD": "your_password", "DB_NAME": "your_database" } } } }

3. 여러 데이터베이스 연결

{ "mcpServers": { "mysql-prod": { "command": "node", "args": ["path/to/mysql-mcp-server/server.js"], "env": { "DB_HOST": "prod-server.com", "DB_USER": "prod_user", "DB_PASSWORD": "prod_password", "DB_NAME": "production_db" } }, "mysql-dev": { "command": "node", "args": ["path/to/mysql-mcp-server/server.js"], "env": { "DB_HOST": "localhost", "DB_USER": "dev_user", "DB_PASSWORD": "dev_password", "DB_NAME": "development_db" } } } }

환경 변수

  • DB_HOST: MySQL 서버 호스트 (기본값: localhost)
  • DB_PORT: MySQL 서버 포트 (기본값: 3306)
  • DB_USER: MySQL 사용자명 (기본값: root)
  • DB_PASSWORD: MySQL 비밀번호 (기본값: 빈 문자열)
  • DB_NAME: 데이터베이스 이름 (기본값: test)

사용 가능한 도구

execute_query

SQL 쿼리를 실행합니다.

{ "name": "execute_query", "arguments": { "query": "SELECT * FROM users LIMIT 10" } }

show_tables

데이터베이스의 모든 테이블을 조회합니다.

{ "name": "show_tables", "arguments": {} }

describe_table

특정 테이블의 구조를 확인합니다.

{ "name": "describe_table", "arguments": { "table_name": "users" } }

요구사항

  • Node.js 18.0.0 이상
  • MySQL 서버

의존성

  • @modelcontextprotocol/sdk: MCP SDK
  • mysql2: MySQL 클라이언트

라이선스

MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

A Model Context Protocol server that connects to MySQL databases, allowing execution of SQL queries, table listing, and schema inspection through Claude Desktop.

  1. 기능
    1. 설치
      1. 의존성에 문제가 있는 경우
        1. 사용법
          1. 1. 직접 실행 경우
          2. 2. Claude Desktop 설정 해서 사용 할 경우
          3. 3. 여러 데이터베이스 연결
        2. 환경 변수
          1. 사용 가능한 도구
            1. execute_query
            2. show_tables
            3. describe_table
          2. 요구사항
            1. 의존성
              1. 라이선스

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that enables SQL query execution, database management, and business intelligence capabilities through MySQL connections.
                  Last updated -
                  JavaScript
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that provides Claude access to Turso-hosted LibSQL databases, enabling database table listing, schema retrieval, and SELECT query execution.
                  Last updated -
                  12
                  5
                  TypeScript
                  MIT License
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A connector that gives Claude direct access to MySQL databases through the Model Context Protocol, enabling natural language querying, schema exploration, and database management.
                  Last updated -
                  Python
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.
                  Last updated -
                  TypeScript

                View all related MCP servers

                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/bibaram/mysql-mcp-server'

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