rename gptedit to gpt-edit
This commit is contained in:
16
CLAUDE.md
16
CLAUDE.md
@@ -1,7 +1,7 @@
|
|||||||
# GPTEdit MCP Server - 설계 및 개발 가이드
|
# GPT-Edit MCP Server - 설계 및 개발 가이드
|
||||||
|
|
||||||
## 📋 프로젝트 개요
|
## 📋 프로젝트 개요
|
||||||
GPTEdit는 OpenAI의 이미지 편집 API를 MCP(Model Context Protocol) 서버로 구현한 프로젝트입니다.
|
GPT-Edit는 OpenAI의 이미지 편집 API를 MCP(Model Context Protocol) 서버로 구현한 프로젝트입니다.
|
||||||
이 문서는 향후 유사한 MCP 서버 개발 시 참고할 수 있는 설계 원칙과 구현 가이드를 제공합니다.
|
이 문서는 향후 유사한 MCP 서버 개발 시 참고할 수 있는 설계 원칙과 구현 가이드를 제공합니다.
|
||||||
|
|
||||||
## 🏗️ 핵심 설계 원칙
|
## 🏗️ 핵심 설계 원칙
|
||||||
@@ -175,7 +175,7 @@ Claude가 업로드된 이미지를 바로 처리할 수 있도록 Base64 입력
|
|||||||
|
|
||||||
1. **로그 파일 확인**
|
1. **로그 파일 확인**
|
||||||
```bash
|
```bash
|
||||||
tail -f gptedit.log
|
tail -f gpt-edit.log
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Claude Desktop 에러 메시지**
|
2. **Claude Desktop 에러 메시지**
|
||||||
@@ -259,7 +259,7 @@ MCP 서버는 다음 메서드들을 반드시 구현해야 합니다:
|
|||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
handlers=[
|
handlers=[
|
||||||
logging.FileHandler('gptedit.log', encoding='utf-8'),
|
logging.FileHandler('gpt-edit.log', encoding='utf-8'),
|
||||||
logging.StreamHandler(sys.stderr) # stderr 사용!
|
logging.StreamHandler(sys.stderr) # stderr 사용!
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -268,7 +268,7 @@ logging.basicConfig(
|
|||||||
## 📁 프로젝트 구조
|
## 📁 프로젝트 구조
|
||||||
|
|
||||||
```
|
```
|
||||||
gptedit/
|
gpt-edit/
|
||||||
├── src/
|
├── src/
|
||||||
│ ├── connector/ # API 연결 모듈
|
│ ├── connector/ # API 연결 모듈
|
||||||
│ │ ├── config.py # 설정 관리 및 파일명 생성
|
│ │ ├── config.py # 설정 관리 및 파일명 생성
|
||||||
@@ -484,9 +484,9 @@ python main.py
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "python",
|
"command": "python",
|
||||||
"args": ["D:/Project/little-fairy/gptedit/main.py"]
|
"args": ["D:/Project/gpt-edit/main.py"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -496,7 +496,7 @@ python main.py
|
|||||||
|
|
||||||
### 1. "Method not found" 에러
|
### 1. "Method not found" 에러
|
||||||
- `list_prompts()`, `list_resources()` 메서드 구현 확인
|
- `list_prompts()`, `list_resources()` 메서드 구현 확인
|
||||||
- MCP 서버 이름이 단순한지 확인 (예: "gptedit")
|
- MCP 서버 이름이 단순한지 확인 (예: "gpt-edit")
|
||||||
|
|
||||||
### 2. JSON 파싱 에러
|
### 2. JSON 파싱 에러
|
||||||
- 로그가 stdout으로 출력되지 않도록 stderr 사용
|
- 로그가 stdout으로 출력되지 않도록 stderr 사용
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# GPTEdit MCP Connector 설정 가이드
|
# GPT-Edit MCP Connector 설정 가이드
|
||||||
|
|
||||||
## 📍 Claude Desktop 설정 파일 위치
|
## 📍 Claude Desktop 설정 파일 위치
|
||||||
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
||||||
@@ -11,11 +11,11 @@
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "python",
|
"command": "python",
|
||||||
"args": ["D:\\Project\\little-fairy\\gptedit\\main.py"],
|
"args": ["D:\\Project\\gpt-edit\\main.py"],
|
||||||
"env": {
|
"env": {
|
||||||
"PYTHONPATH": "D:\\Project\\little-fairy\\gptedit"
|
"PYTHONPATH": "D:\\Project\\gpt-edit"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "D:\\Project\\little-fairy\\gptedit\\venv\\Scripts\\python.exe",
|
"command": "D:\\Project\\gpt-edit\\venv\\Scripts\\python.exe",
|
||||||
"args": ["D:\\Project\\little-fairy\\gptedit\\main.py"],
|
"args": ["D:\\Project\\gpt-edit\\main.py"],
|
||||||
"env": {
|
"env": {
|
||||||
"PYTHONPATH": "D:\\Project\\little-fairy\\gptedit"
|
"PYTHONPATH": "D:\\Project\\gpt-edit"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "cmd",
|
"command": "cmd",
|
||||||
"args": ["/c", "D:\\Project\\little-fairy\\gptedit\\run.bat"]
|
"args": ["/c", "D:\\Project\\gpt-edit\\run.bat"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,14 +56,14 @@ MCP connector에서 직접 환경 변수를 설정할 수도 있습니다:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "python",
|
"command": "python",
|
||||||
"args": ["D:\\Project\\little-fairy\\gptedit\\main.py"],
|
"args": ["D:\\Project\\gpt-edit\\main.py"],
|
||||||
"env": {
|
"env": {
|
||||||
"PYTHONPATH": "D:\\Project\\little-fairy\\gptedit",
|
"PYTHONPATH": "D:\\Project\\gpt-edit",
|
||||||
"OPENAI_API_KEY": "sk-xxxxx",
|
"OPENAI_API_KEY": "sk-xxxxx",
|
||||||
"OUTPUT_FILENAME_PREFIX": "gptimage1",
|
"OUTPUT_FILENAME_PREFIX": "gptimage1",
|
||||||
"GENERATED_IMAGES_PATH": "D:\\Project\\little-fairy\\gptedit\\generated_images",
|
"GENERATED_IMAGES_PATH": "D:\\Project\\gpt-edit\\generated_images",
|
||||||
"LOG_LEVEL": "INFO",
|
"LOG_LEVEL": "INFO",
|
||||||
"MAX_IMAGE_SIZE_MB": "4",
|
"MAX_IMAGE_SIZE_MB": "4",
|
||||||
"DEFAULT_TIMEOUT": "30",
|
"DEFAULT_TIMEOUT": "30",
|
||||||
@@ -83,13 +83,13 @@ MCP connector에서 직접 환경 변수를 설정할 수도 있습니다:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "python",
|
"command": "python",
|
||||||
"args": ["D:\\Project\\little-fairy\\gptedit\\main.py"]
|
"args": ["D:\\Project\\gpt-edit\\main.py"]
|
||||||
},
|
},
|
||||||
"filesystem": {
|
"filesystem": {
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["-y", "@modelcontextprotocol/server-filesystem", "D:\\Project\\little-fairy"]
|
"args": ["-y", "@modelcontextprotocol/server-filesystem", "D:\\Project"]
|
||||||
},
|
},
|
||||||
"imagen4": {
|
"imagen4": {
|
||||||
"command": "python",
|
"command": "python",
|
||||||
@@ -120,7 +120,7 @@ Claude Desktop에서 다음 명령으로 연결 확인:
|
|||||||
```
|
```
|
||||||
|
|
||||||
3. **로그 확인**:
|
3. **로그 확인**:
|
||||||
- `D:\Project\little-fairy\gptedit\gptedit.log` 파일에서 연결 로그 확인
|
- `D:\Project\gpt-edit\gpt-edit.log` 파일에서 연결 로그 확인
|
||||||
|
|
||||||
## 🔄 서버 재시작
|
## 🔄 서버 재시작
|
||||||
|
|
||||||
@@ -154,4 +154,4 @@ Claude Desktop에서 다음 명령으로 연결 확인:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
이 가이드를 따라 Claude Desktop과 GPTEdit MCP 서버를 연결하세요.
|
이 가이드를 따라 Claude Desktop과 GPT-Edit MCP 서버를 연결하세요.
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -1,6 +1,6 @@
|
|||||||
# GPTEdit - OpenAI Image Editing MCP Server
|
# GPT-Edit - OpenAI Image Editing MCP Server
|
||||||
|
|
||||||
GPTEdit는 OpenAI의 이미지 편집 API를 MCP(Model Context Protocol) 서버로 구현한 프로젝트입니다.
|
GPT-Edit는 OpenAI의 이미지 편집 API를 MCP(Model Context Protocol) 서버로 구현한 프로젝트입니다.
|
||||||
Claude Desktop과 연동하여 자연어로 이미지를 편집할 수 있습니다.
|
Claude Desktop과 연동하여 자연어로 이미지를 편집할 수 있습니다.
|
||||||
|
|
||||||
## 🚀 Quick Start
|
## 🚀 Quick Start
|
||||||
@@ -8,8 +8,8 @@ Claude Desktop과 연동하여 자연어로 이미지를 편집할 수 있습니
|
|||||||
### 1. 설치
|
### 1. 설치
|
||||||
```bash
|
```bash
|
||||||
# 저장소 클론
|
# 저장소 클론
|
||||||
git clone https://github.com/yourusername/gptedit.git
|
git clone https://github.com/yourusername/gpt-edit.git
|
||||||
cd gptedit
|
cd gpt-edit
|
||||||
|
|
||||||
# 의존성 설치
|
# 의존성 설치
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
@@ -36,9 +36,9 @@ python main.py
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "python",
|
"command": "python",
|
||||||
"args": ["D:\\Project\\little-fairy\\gptedit\\main.py"]
|
"args": ["D:\\Project\\gpt-edit\\main.py"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# GPTEdit MCP Server Setup Guide
|
# GPT-Edit MCP Server Setup Guide
|
||||||
|
|
||||||
## 🚀 Quick Setup
|
## 🚀 Quick Setup
|
||||||
|
|
||||||
### 1. Install GPTEdit
|
### 1. Install GPT-Edit
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone or navigate to the project
|
# Clone or navigate to the project
|
||||||
cd D:\Project\little-fairy\gptedit
|
cd D:\Project\gpt-edit
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
@@ -27,7 +27,7 @@ GENERATED_IMAGES_PATH=./generated_images
|
|||||||
|
|
||||||
### 3. Configure Claude Desktop
|
### 3. Configure Claude Desktop
|
||||||
|
|
||||||
Add GPTEdit to your Claude Desktop configuration file:
|
Add GPT-Edit to your Claude Desktop configuration file:
|
||||||
|
|
||||||
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
||||||
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
||||||
@@ -35,9 +35,9 @@ Add GPTEdit to your Claude Desktop configuration file:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"gptedit": {
|
"gpt-edit": {
|
||||||
"command": "python",
|
"command": "python",
|
||||||
"args": ["D:\\Project\\little-fairy\\gptedit\\main.py"]
|
"args": ["D:\\Project\\gpt-edit\\main.py"]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,10 +88,10 @@ LOG_LEVEL=INFO
|
|||||||
|
|
||||||
## 📁 File Structure
|
## 📁 File Structure
|
||||||
|
|
||||||
After running, GPTEdit creates this structure:
|
After running, GPT-Edit creates this structure:
|
||||||
|
|
||||||
```
|
```
|
||||||
gptedit/
|
gpt-edit/
|
||||||
├── input_images/ # Source images (INPUT_PATH)
|
├── input_images/ # Source images (INPUT_PATH)
|
||||||
│ ├── photo.jpg
|
│ ├── photo.jpg
|
||||||
│ ├── portrait.png
|
│ ├── portrait.png
|
||||||
@@ -101,7 +101,7 @@ gptedit/
|
|||||||
│ ├── gptimage1_20250824_143022_001.png # Edited output
|
│ ├── gptimage1_20250824_143022_001.png # Edited output
|
||||||
│ └── gptimage1_20250824_143022_001.json # Edit parameters
|
│ └── gptimage1_20250824_143022_001.json # Edit parameters
|
||||||
├── temp/ # Temporary files (auto-cleaned)
|
├── temp/ # Temporary files (auto-cleaned)
|
||||||
└── gptedit.log # Debug log
|
└── gpt-edit.log # Debug log
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🎯 Usage Examples in Claude
|
## 🎯 Usage Examples in Claude
|
||||||
@@ -132,7 +132,7 @@ Can you use edit_with_mask_from_file to replace only the background?
|
|||||||
1. Check Python is installed: `python --version`
|
1. Check Python is installed: `python --version`
|
||||||
2. Verify dependencies: `pip list | grep mcp`
|
2. Verify dependencies: `pip list | grep mcp`
|
||||||
3. Check `.env` file exists with API key
|
3. Check `.env` file exists with API key
|
||||||
4. Look at `gptedit.log` for errors
|
4. Look at `gpt-edit.log` for errors
|
||||||
|
|
||||||
#### "API key not found"
|
#### "API key not found"
|
||||||
1. Ensure `.env` file is in project root (same folder as `main.py`)
|
1. Ensure `.env` file is in project root (same folder as `main.py`)
|
||||||
@@ -219,4 +219,4 @@ For issues:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Happy editing with GPTEdit! 🎨
|
Happy editing with GPT-Edit! 🎨
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# GPTEdit Technical Specifications
|
# GPT-Edit Technical Specifications
|
||||||
|
|
||||||
## OpenAI API 설정
|
## OpenAI API 설정
|
||||||
|
|
||||||
@@ -203,5 +203,5 @@ aiofiles>=23.0.0 # 비동기 파일 I/O
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
이 문서는 GPTEdit의 기술적 세부사항을 담고 있습니다.
|
이 문서는 GPT-Edit의 기술적 세부사항을 담고 있습니다.
|
||||||
개발 시 참고하시기 바랍니다.
|
개발 시 참고하시기 바랍니다.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# GPTEdit MCP Server - Directory-based Processing Workflow
|
# GPT-Edit MCP Server - Directory-based Processing Workflow
|
||||||
|
|
||||||
## 개요
|
## 개요
|
||||||
이 문서는 GPTEdit MCP 서버의 INPUT_PATH 기반 이미지 편집 및 처리 워크플로우를 설명합니다.
|
이 문서는 GPT-Edit MCP 서버의 INPUT_PATH 기반 이미지 편집 및 처리 워크플로우를 설명합니다.
|
||||||
|
|
||||||
## 워크플로우
|
## 워크플로우
|
||||||
|
|
||||||
|
|||||||
10
main.py
10
main.py
@@ -1,4 +1,4 @@
|
|||||||
# GPTEdit - OpenAI Image Editing MCP Server
|
# GPT-Edit - OpenAI Image Editing MCP Server
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
@@ -17,7 +17,7 @@ logging.basicConfig(
|
|||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||||
handlers=[
|
handlers=[
|
||||||
logging.FileHandler('gptedit.log', encoding='utf-8'),
|
logging.FileHandler('gpt-edit.log', encoding='utf-8'),
|
||||||
logging.StreamHandler(sys.stderr) # Changed to stderr to avoid interfering with stdout
|
logging.StreamHandler(sys.stderr) # Changed to stderr to avoid interfering with stdout
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -26,11 +26,11 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
"""Main entry point for GPTEdit MCP Server"""
|
"""Main entry point for GPT-Edit MCP Server"""
|
||||||
try:
|
try:
|
||||||
# Log to stderr to avoid interfering with JSON-RPC communication
|
# Log to stderr to avoid interfering with JSON-RPC communication
|
||||||
logger.info("=" * 60)
|
logger.info("=" * 60)
|
||||||
logger.info("Starting GPTEdit MCP Server")
|
logger.info("Starting GPT-Edit MCP Server")
|
||||||
logger.info("=" * 60)
|
logger.info("=" * 60)
|
||||||
|
|
||||||
# Load configuration
|
# Load configuration
|
||||||
@@ -44,7 +44,7 @@ async def main():
|
|||||||
server = mcp_server.get_server()
|
server = mcp_server.get_server()
|
||||||
|
|
||||||
# Log server info
|
# Log server info
|
||||||
logger.info("GPTEdit MCP Server is running...")
|
logger.info("GPT-Edit MCP Server is running...")
|
||||||
logger.info("Ready to process image editing requests")
|
logger.info("Ready to process image editing requests")
|
||||||
logger.info(f"Available tools: edit_image, edit_with_mask, batch_edit, validate_image, create_mask_from_alpha")
|
logger.info(f"Available tools: edit_image, edit_with_mask, batch_edit, validate_image, create_mask_from_alpha")
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class Config:
|
|||||||
raise RuntimeError(f"{dir_name} path exists but is not a directory: {dir_path}")
|
raise RuntimeError(f"{dir_name} path exists but is not a directory: {dir_path}")
|
||||||
|
|
||||||
# Test write permissions by creating a temporary test file
|
# Test write permissions by creating a temporary test file
|
||||||
test_file = dir_path / ".gptedit_test_write"
|
test_file = dir_path / ".gpt-edit_test_write"
|
||||||
try:
|
try:
|
||||||
test_file.touch()
|
test_file.touch()
|
||||||
test_file.unlink() # Delete test file
|
test_file.unlink() # Delete test file
|
||||||
|
|||||||
@@ -28,16 +28,16 @@ class GPTEditMCPServer:
|
|||||||
def __init__(self, config: Config):
|
def __init__(self, config: Config):
|
||||||
"""Initialize server"""
|
"""Initialize server"""
|
||||||
self.config = config
|
self.config = config
|
||||||
self.server = Server("gptedit") # Simplified server name
|
self.server = Server("gpt-edit") # Simplified server name
|
||||||
self.handlers = ToolHandlers(config)
|
self.handlers = ToolHandlers(config)
|
||||||
|
|
||||||
# Register handlers
|
# Register handlers
|
||||||
self._register_handlers()
|
self._register_handlers()
|
||||||
|
|
||||||
logger.info("GPTEdit MCP Server initialized")
|
logger.info("GPT-Edit MCP Server initialized")
|
||||||
logger.info(f"Model: {Config.MODEL}")
|
logger.info(f"Model: {Config.MODEL}")
|
||||||
logger.info(f"Max image size: {config.max_image_size_mb}MB")
|
logger.info(f"Max image size: {config.max_image_size_mb}MB")
|
||||||
logger.info(f"Server name: gptedit")
|
logger.info(f"Server name: gpt-edit")
|
||||||
|
|
||||||
def _register_handlers(self) -> None:
|
def _register_handlers(self) -> None:
|
||||||
"""Register MCP handlers"""
|
"""Register MCP handlers"""
|
||||||
|
|||||||
Reference in New Issue
Block a user