diff --git a/CLAUDE.md b/CLAUDE.md index 2399eca..f48c59c 100644 --- a/CLAUDE.md +++ b/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 서버 개발 시 참고할 수 있는 설계 원칙과 구현 가이드를 제공합니다. ## 🏗️ 핵심 설계 원칙 @@ -175,7 +175,7 @@ Claude가 업로드된 이미지를 바로 처리할 수 있도록 Base64 입력 1. **로그 파일 확인** ```bash - tail -f gptedit.log + tail -f gpt-edit.log ``` 2. **Claude Desktop 에러 메시지** @@ -259,7 +259,7 @@ MCP 서버는 다음 메서드들을 반드시 구현해야 합니다: logging.basicConfig( level=logging.INFO, handlers=[ - logging.FileHandler('gptedit.log', encoding='utf-8'), + logging.FileHandler('gpt-edit.log', encoding='utf-8'), logging.StreamHandler(sys.stderr) # stderr 사용! ] ) @@ -268,7 +268,7 @@ logging.basicConfig( ## 📁 프로젝트 구조 ``` -gptedit/ +gpt-edit/ ├── src/ │ ├── connector/ # API 연결 모듈 │ │ ├── config.py # 설정 관리 및 파일명 생성 @@ -484,9 +484,9 @@ python main.py ```json { "mcpServers": { - "gptedit": { + "gpt-edit": { "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" 에러 - `list_prompts()`, `list_resources()` 메서드 구현 확인 -- MCP 서버 이름이 단순한지 확인 (예: "gptedit") +- MCP 서버 이름이 단순한지 확인 (예: "gpt-edit") ### 2. JSON 파싱 에러 - 로그가 stdout으로 출력되지 않도록 stderr 사용 diff --git a/MCP_CONNECTOR_GUIDE.md b/MCP_CONNECTOR_GUIDE.md index 18b6d57..5139e8d 100644 --- a/MCP_CONNECTOR_GUIDE.md +++ b/MCP_CONNECTOR_GUIDE.md @@ -1,4 +1,4 @@ -# GPTEdit MCP Connector 설정 가이드 +# GPT-Edit MCP Connector 설정 가이드 ## 📍 Claude Desktop 설정 파일 위치 - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json` @@ -11,11 +11,11 @@ ```json { "mcpServers": { - "gptedit": { + "gpt-edit": { "command": "python", - "args": ["D:\\Project\\little-fairy\\gptedit\\main.py"], + "args": ["D:\\Project\\gpt-edit\\main.py"], "env": { - "PYTHONPATH": "D:\\Project\\little-fairy\\gptedit" + "PYTHONPATH": "D:\\Project\\gpt-edit" } } } @@ -26,11 +26,11 @@ ```json { "mcpServers": { - "gptedit": { - "command": "D:\\Project\\little-fairy\\gptedit\\venv\\Scripts\\python.exe", - "args": ["D:\\Project\\little-fairy\\gptedit\\main.py"], + "gpt-edit": { + "command": "D:\\Project\\gpt-edit\\venv\\Scripts\\python.exe", + "args": ["D:\\Project\\gpt-edit\\main.py"], "env": { - "PYTHONPATH": "D:\\Project\\little-fairy\\gptedit" + "PYTHONPATH": "D:\\Project\\gpt-edit" } } } @@ -41,9 +41,9 @@ ```json { "mcpServers": { - "gptedit": { + "gpt-edit": { "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 { "mcpServers": { - "gptedit": { + "gpt-edit": { "command": "python", - "args": ["D:\\Project\\little-fairy\\gptedit\\main.py"], + "args": ["D:\\Project\\gpt-edit\\main.py"], "env": { - "PYTHONPATH": "D:\\Project\\little-fairy\\gptedit", + "PYTHONPATH": "D:\\Project\\gpt-edit", "OPENAI_API_KEY": "sk-xxxxx", "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", "MAX_IMAGE_SIZE_MB": "4", "DEFAULT_TIMEOUT": "30", @@ -83,13 +83,13 @@ MCP connector에서 직접 환경 변수를 설정할 수도 있습니다: ```json { "mcpServers": { - "gptedit": { + "gpt-edit": { "command": "python", - "args": ["D:\\Project\\little-fairy\\gptedit\\main.py"] + "args": ["D:\\Project\\gpt-edit\\main.py"] }, "filesystem": { "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", "D:\\Project\\little-fairy"] + "args": ["-y", "@modelcontextprotocol/server-filesystem", "D:\\Project"] }, "imagen4": { "command": "python", @@ -120,7 +120,7 @@ Claude Desktop에서 다음 명령으로 연결 확인: ``` 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 서버를 연결하세요. diff --git a/README.md b/README.md index b6a65ca..783be88 100644 --- a/README.md +++ b/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과 연동하여 자연어로 이미지를 편집할 수 있습니다. ## 🚀 Quick Start @@ -8,8 +8,8 @@ Claude Desktop과 연동하여 자연어로 이미지를 편집할 수 있습니 ### 1. 설치 ```bash # 저장소 클론 -git clone https://github.com/yourusername/gptedit.git -cd gptedit +git clone https://github.com/yourusername/gpt-edit.git +cd gpt-edit # 의존성 설치 pip install -r requirements.txt @@ -36,9 +36,9 @@ python main.py ```json { "mcpServers": { - "gptedit": { + "gpt-edit": { "command": "python", - "args": ["D:\\Project\\little-fairy\\gptedit\\main.py"] + "args": ["D:\\Project\\gpt-edit\\main.py"] } } } diff --git a/SETUP_GUIDE.md b/SETUP_GUIDE.md index b2651fd..7b7ced4 100644 --- a/SETUP_GUIDE.md +++ b/SETUP_GUIDE.md @@ -1,12 +1,12 @@ -# GPTEdit MCP Server Setup Guide +# GPT-Edit MCP Server Setup Guide ## 🚀 Quick Setup -### 1. Install GPTEdit +### 1. Install GPT-Edit ```bash # Clone or navigate to the project -cd D:\Project\little-fairy\gptedit +cd D:\Project\gpt-edit # Install dependencies pip install -r requirements.txt @@ -27,7 +27,7 @@ GENERATED_IMAGES_PATH=./generated_images ### 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` **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json` @@ -35,9 +35,9 @@ Add GPTEdit to your Claude Desktop configuration file: ```json { "mcpServers": { - "gptedit": { + "gpt-edit": { "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 -After running, GPTEdit creates this structure: +After running, GPT-Edit creates this structure: ``` -gptedit/ +gpt-edit/ ├── input_images/ # Source images (INPUT_PATH) │ ├── photo.jpg │ ├── portrait.png @@ -101,7 +101,7 @@ gptedit/ │ ├── gptimage1_20250824_143022_001.png # Edited output │ └── gptimage1_20250824_143022_001.json # Edit parameters ├── temp/ # Temporary files (auto-cleaned) -└── gptedit.log # Debug log +└── gpt-edit.log # Debug log ``` ## 🎯 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` 2. Verify dependencies: `pip list | grep mcp` 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" 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! 🎨 diff --git a/TECHNICAL_SPECS.md b/TECHNICAL_SPECS.md index 1c1701f..9bc21ef 100644 --- a/TECHNICAL_SPECS.md +++ b/TECHNICAL_SPECS.md @@ -1,4 +1,4 @@ -# GPTEdit Technical Specifications +# GPT-Edit Technical Specifications ## OpenAI API 설정 @@ -203,5 +203,5 @@ aiofiles>=23.0.0 # 비동기 파일 I/O --- -이 문서는 GPTEdit의 기술적 세부사항을 담고 있습니다. +이 문서는 GPT-Edit의 기술적 세부사항을 담고 있습니다. 개발 시 참고하시기 바랍니다. diff --git a/WORKFLOW.md b/WORKFLOW.md index 29ed476..211625e 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -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 기반 이미지 편집 및 처리 워크플로우를 설명합니다. ## 워크플로우 diff --git a/main.py b/main.py index a88b518..7e20ee7 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -# GPTEdit - OpenAI Image Editing MCP Server +# GPT-Edit - OpenAI Image Editing MCP Server import asyncio import logging @@ -17,7 +17,7 @@ logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', 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 ] ) @@ -26,11 +26,11 @@ logger = logging.getLogger(__name__) async def main(): - """Main entry point for GPTEdit MCP Server""" + """Main entry point for GPT-Edit MCP Server""" try: # Log to stderr to avoid interfering with JSON-RPC communication logger.info("=" * 60) - logger.info("Starting GPTEdit MCP Server") + logger.info("Starting GPT-Edit MCP Server") logger.info("=" * 60) # Load configuration @@ -44,7 +44,7 @@ async def main(): server = mcp_server.get_server() # 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(f"Available tools: edit_image, edit_with_mask, batch_edit, validate_image, create_mask_from_alpha") diff --git a/src/connector/config.py b/src/connector/config.py index 2b8a749..e194c45 100644 --- a/src/connector/config.py +++ b/src/connector/config.py @@ -94,7 +94,7 @@ class Config: raise RuntimeError(f"{dir_name} path exists but is not a directory: {dir_path}") # 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: test_file.touch() test_file.unlink() # Delete test file diff --git a/src/server/mcp_server.py b/src/server/mcp_server.py index 4b1fa35..1485ef3 100644 --- a/src/server/mcp_server.py +++ b/src/server/mcp_server.py @@ -28,16 +28,16 @@ class GPTEditMCPServer: def __init__(self, config: Config): """Initialize server""" self.config = config - self.server = Server("gptedit") # Simplified server name + self.server = Server("gpt-edit") # Simplified server name self.handlers = ToolHandlers(config) # 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"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: """Register MCP handlers"""