Files
gpt-edit/MCP_CONNECTOR_GUIDE.md

158 lines
3.7 KiB
Markdown
Raw Permalink Normal View History

2025-08-26 01:31:42 +09:00
# GPT-Edit MCP Connector 설정 가이드
2025-08-25 00:39:39 +09:00
## 📍 Claude Desktop 설정 파일 위치
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Linux**: `~/.config/claude/claude_desktop_config.json`
## ⚙️ MCP Connector 설정
### 기본 설정 (Python 직접 실행)
```json
{
"mcpServers": {
2025-08-26 01:31:42 +09:00
"gpt-edit": {
2025-08-25 00:39:39 +09:00
"command": "python",
2025-08-26 01:31:42 +09:00
"args": ["D:\\Project\\gpt-edit\\main.py"],
2025-08-25 00:39:39 +09:00
"env": {
2025-08-26 01:31:42 +09:00
"PYTHONPATH": "D:\\Project\\gpt-edit"
2025-08-25 00:39:39 +09:00
}
}
}
}
```
### 가상환경 사용 시
```json
{
"mcpServers": {
2025-08-26 01:31:42 +09:00
"gpt-edit": {
"command": "D:\\Project\\gpt-edit\\venv\\Scripts\\python.exe",
"args": ["D:\\Project\\gpt-edit\\main.py"],
2025-08-25 00:39:39 +09:00
"env": {
2025-08-26 01:31:42 +09:00
"PYTHONPATH": "D:\\Project\\gpt-edit"
2025-08-25 00:39:39 +09:00
}
}
}
}
```
### 배치 파일 사용 시
```json
{
"mcpServers": {
2025-08-26 01:31:42 +09:00
"gpt-edit": {
2025-08-25 00:39:39 +09:00
"command": "cmd",
2025-08-26 01:31:42 +09:00
"args": ["/c", "D:\\Project\\gpt-edit\\run.bat"]
2025-08-25 00:39:39 +09:00
}
}
}
```
## 🔧 환경 변수 설정 (선택사항)
MCP connector에서 직접 환경 변수를 설정할 수도 있습니다:
```json
{
"mcpServers": {
2025-08-26 01:31:42 +09:00
"gpt-edit": {
2025-08-25 00:39:39 +09:00
"command": "python",
2025-08-26 01:31:42 +09:00
"args": ["D:\\Project\\gpt-edit\\main.py"],
2025-08-25 00:39:39 +09:00
"env": {
2025-08-26 01:31:42 +09:00
"PYTHONPATH": "D:\\Project\\gpt-edit",
2025-08-25 00:39:39 +09:00
"OPENAI_API_KEY": "sk-xxxxx",
"OUTPUT_FILENAME_PREFIX": "gptimage1",
2025-08-26 01:31:42 +09:00
"GENERATED_IMAGES_PATH": "D:\\Project\\gpt-edit\\generated_images",
2025-08-25 00:39:39 +09:00
"LOG_LEVEL": "INFO",
"MAX_IMAGE_SIZE_MB": "4",
"DEFAULT_TIMEOUT": "30",
"ENABLE_AUTO_OPTIMIZE": "true",
"SAVE_ORIGINALS": "true",
"SAVE_PARAMETERS": "true"
}
}
}
}
```
## 📝 다중 MCP 서버 설정
여러 MCP 서버를 함께 사용하는 경우:
```json
{
"mcpServers": {
2025-08-26 01:31:42 +09:00
"gpt-edit": {
2025-08-25 00:39:39 +09:00
"command": "python",
2025-08-26 01:31:42 +09:00
"args": ["D:\\Project\\gpt-edit\\main.py"]
2025-08-25 00:39:39 +09:00
},
"filesystem": {
"command": "npx",
2025-08-26 01:31:42 +09:00
"args": ["-y", "@modelcontextprotocol/server-filesystem", "D:\\Project"]
2025-08-25 00:39:39 +09:00
},
"imagen4": {
"command": "python",
"args": ["D:\\Project\\imagen4\\main.py"]
}
}
}
```
## 🚨 주의사항
1. **경로 구분자**: Windows에서는 `\\` 또는 `/` 모두 사용 가능
2. **Python 경로**: 시스템 Python 또는 가상환경 Python 경로 확인
3. **권한**: 스크립트 실행 권한 확인
4. **로그 확인**: 문제 발생 시 `gptedit.log` 파일 확인
## 🔍 연결 테스트
Claude Desktop에서 다음 명령으로 연결 확인:
1. **도구 목록 확인**:
- Claude에게 "What tools are available?" 물어보기
- `edit_image`, `edit_with_mask`, `batch_edit` 등이 나타나야 함
2. **간단한 테스트**:
```
"Validate the image at D:/test.png"
```
3. **로그 확인**:
2025-08-26 01:31:42 +09:00
- `D:\Project\gpt-edit\gpt-edit.log` 파일에서 연결 로그 확인
2025-08-25 00:39:39 +09:00
## 🔄 서버 재시작
설정 변경 후:
1. Claude Desktop 완전 종료 (시스템 트레이 확인)
2. Claude Desktop 재시작
3. 새 대화 시작
## 📋 체크리스트
- [ ] `.env` 파일에 OPENAI_API_KEY 설정됨
- [ ] `generated_images/` 디렉토리 존재
- [ ] Python 및 필요 패키지 설치됨
- [ ] `claude_desktop_config.json` 파일 설정됨
- [ ] Claude Desktop 재시작됨
## 🐛 문제 해결
### "Server disconnected" 에러
1. Python 경로 확인
2. 의존성 설치 확인: `pip install -r requirements.txt`
3. `.env` 파일 확인
### "Method not found" 에러
1. 최신 코드인지 확인
2. `list_prompts`, `list_resources` 메서드 구현 확인
### 파일을 찾을 수 없음
1. `generated_images/` 디렉토리 생성 확인
2. 파일 권한 확인
---
2025-08-26 01:31:42 +09:00
이 가이드를 따라 Claude Desktop과 GPT-Edit MCP 서버를 연결하세요.