OpenAI 이미지 생성 MCP 서버
이 프로젝트는 공식 Python SDK를 통해 OpenAI의 gpt-image-1
모델을 사용하여 이미지를 생성하고 편집하기 위한 도구를 제공하는 MCP(Model Context Protocol) 서버를 구현합니다.
특징
이 MCP 서버는 다음과 같은 도구를 제공합니다.
generate_image
: 텍스트 프롬프트를 기반으로 OpenAI의gpt-image-1
모델을 사용하여 이미지를 생성하고 저장합니다.입력 스키마:
지엑스피1
출력:
{"status": "success", "saved_path": "path/to/image.png"}
또는 오류 사전.
edit_image
: OpenAI의gpt-image-1
모델을 사용하여 이미지를 편집하거나 변형 이미지를 생성하고 저장합니다. 여러 개의 입력 이미지를 참조로 사용하거나 마스크를 사용하여 인페인팅을 수행할 수 있습니다.입력 스키마:
{ "type": "object", "properties": { "prompt": { "type": "string", "description": "The text description of the desired final image or edit." }, "image_paths": { "type": "array", "items": { "type": "string" }, "description": "A list of file paths to the input image(s). Must be PNG. < 25MB." }, "mask_path": { "type": ["string", "null"], "default": null, "description": "Optional file path to the mask image (PNG with alpha channel) for inpainting. Must be same size as input image(s). < 25MB." }, "model": { "type": "string", "default": "gpt-image-1", "description": "The model to use (currently 'gpt-image-1')." }, "n": { "type": ["integer", "null"], "default": 1, "description": "The number of images to generate (Default: 1)." }, "size": { "type": ["string", "null"], "enum": ["1024x1024", "1536x1024", "1024x1536", "auto"], "default": "auto", "description": "Image dimensions ('1024x1024', '1536x1024', '1024x1536', 'auto'). Default: 'auto'." }, "quality": { "type": ["string", "null"], "enum": ["low", "medium", "high", "auto"], "default": "auto", "description": "Rendering quality ('low', 'medium', 'high', 'auto'). Default: 'auto'." }, "user": { "type": ["string", "null"], "default": null, "description": "An optional unique identifier representing your end-user." }, "save_filename": { "type": ["string", "null"], "default": null, "description": "Optional filename (without extension). If None, a default name based on the prompt and timestamp is used." } }, "required": ["prompt", "image_paths"] }출력:
{"status": "success", "saved_path": "path/to/image.png"}
또는 오류 사전.
필수 조건
Python(3.8 이상 권장)
pip(Python 패키지 설치 프로그램)
OpenAI API 키(스크립트에서 직접 설정하거나
OPENAI_API_KEY
환경 변수를 통해 설정 - 보안을 위해 환경 변수를 사용하는 것이 강력히 권장됨 ).MCP 서버를 관리하고 실행할 수 있는 MCP 클라이언트 환경(클라인이 사용하는 환경과 유사)
설치
저장소를 복제합니다.
git clone https://github.com/IncomeStreamSurfer/chatgpt-native-image-gen-mcp.git cd chatgpt-native-image-gen-mcp가상 환경 설정(권장):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`종속성 설치:
pip install -r requirements.txt(선택 사항이지만 권장) 환경 변수 설정: 스크립트에 직접 입력하는 대신
OPENAI_API_KEY
환경 변수에 OpenAI 키를 설정하세요. 설정 방법은 운영 체제에 따라 다릅니다.
구성(Cline MCP 클라이언트용)
이 서버를 AI 비서(예: Cline)가 사용할 수 있도록 하려면 해당 구성을 MCP 설정 파일(예: cline_mcp_settings.json
)에 추가하세요.
설정 파일에서 mcpServers
객체를 찾아 다음 항목을 추가하세요.
중요: C:/path/to/your/cloned/repo/
컴퓨터에서 이 저장소를 복제한 경로의 올바른 절대 경로로 바꾸세요. 경로 구분 기호가 운영 체제에 맞는지 확인하세요(예: Windows에서는 백슬래시 \
사용). 환경 변수를 통해 API 키를 설정한 경우, 스크립트에서 해당 키를 제거하고 MCP 클라이언트에서 지원하는 경우 env
섹션에 추가할 수 있습니다.
서버 실행
일반적으로 서버를 수동으로 실행할 필요는 없습니다. MCP 클라이언트(Cline 등)는 해당 도구 중 하나를 처음 호출할 때 구성 파일에 지정된 command
과 args
사용하여 서버를 자동으로 시작합니다.
수동으로 테스트하려면(종속성이 설치되어 있고 API 키를 사용할 수 있는지 확인하세요):
용법
AI 어시스턴트는 generate_image
및 edit_image
도구를 사용하여 서버와 상호 작용합니다. 이미지는 openai_image_mcp.py
스크립트가 있는 ai-images
하위 디렉터리에 저장됩니다. 성공 시 도구는 저장된 이미지의 절대 경로를 반환합니다.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
MCP 인터페이스를 통해 OpenAI의 gpt-image-1 모델을 사용하여 이미지를 생성하고 편집하기 위한 도구를 제공하여 AI 보조자가 텍스트 프롬프트를 기반으로 이미지를 만들고 수정할 수 있도록 합니다.
Related MCP Servers
- AsecurityAlicenseAqualityAllows AI assistants to generate and transform high-quality images from text prompts using Google's Gemini model via the MCP protocol.Last updated -323MIT License
- -securityAlicense-qualityAn MCP tool server that enables generating and editing images through OpenAI's image models, supporting text-to-image generation and advanced image editing (inpainting, outpainting) across various MCP-compatible clients.Last updated -73MIT License
- AsecurityAlicenseAqualityAn MCP server that allows Claude to use OpenAI's image generation capabilities (gpt-image-1) to create image assets for users, which is particularly useful for game and web development projects.Last updated -113MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables generating and editing images using OpenAI's gpt-image-1 model, allowing AI assistants to create and modify images from text prompts.Last updated -24516MIT License