Enables interaction with MySQL databases, providing tools to connect to a database, list and describe tables, and execute SQL queries including SELECT, INSERT, UPDATE, and DELETE statements.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MySQL MCP ServerShow me the schema of the users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MySQL MCP 서버
이 프로젝트는 Smithery의 Model Context Protocol (MCP)을 사용하여 MySQL 데이터베이스와 상호작용하는 서버입니다.
Installation
Installing via Smithery
To install MySQL Server for Claude Desktop automatically via Smithery:
Manual Installation
Configuration
The server requires the following environment variables to be set in your MCP settings configuration file:
Available Tools
1. connect_db
Establish connection to MySQL database using provided credentials.
2. query
Execute SELECT queries with optional prepared statement parameters.
3. execute
Execute INSERT, UPDATE, or DELETE queries with optional prepared statement parameters.
4. list_tables
List all tables in the connected database.
5. describe_table
Get the structure of a specific table.
주요 기능
MySQL 데이터베이스 연결 및 쿼리 실행
MCP 프로토콜을 통한 표준화된 API 제공
FastAPI 기반의 RESTful API 엔드포인트
환경 변수를 통한 설정 관리
시작하기
필수 요구사항
Python 3.11 이상
MySQL 서버
Docker (선택사항)
환경 설정
.env파일 생성:
설치 방법
로컬 설치 (권장)
Python 가상환경 생성 및 활성화:
의존성 설치:
서버 실행:
Docker 설치
Docker 이미지 빌드:
컨테이너 실행:
로컬 개발 설정
개발 환경 설정:
코드 실행:
테스트 실행:
API 엔드포인트
서버 정보 조회
서버의 상태와 사용 가능한 도구 목록을 반환합니다.
쿼리 실행
MySQL 쿼리를 실행하고 결과를 반환합니다.
개발 가이드
프로젝트 구조
새로운 기능 추가
mcp_server.py에 새로운 도구 추가필요한 의존성
requirements.txt에 추가테스트 코드 작성
Docker 이미지 재빌드 (Docker 사용 시)
문제 해결
일반적인 문제
연결 오류:
MySQL 서버가 실행 중인지 확인
환경 변수가 올바르게 설정되었는지 확인
로컬 설치 시 MySQL 클라이언트 라이브러리가 설치되어 있는지 확인
쿼리 실행 오류:
SQL 구문 검사
데이터베이스 권한 확인
로컬 설치 시 MySQL 커넥터 버전 확인
로깅
서버는 기본적으로 로그를 표준 출력에 기록합니다. 로컬 설치 시 로그 레벨을 조정하려면:
Docker를 사용하는 경우 로그를 확인하려면:
기여하기
이슈 생성
브랜치 생성 (
git checkout -b feature/AmazingFeature)변경사항 커밋 (
git commit -m 'Add some AmazingFeature')브랜치 푸시 (
git push origin feature/AmazingFeature)Pull Request 생성
라이선스
이 프로젝트는 MIT 라이선스 하에 배포됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.
연락처
문의사항이 있으시면 이슈를 생성해주세요.