Skip to main content
Glama

OpenAI Image Generation MCP Server

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 클라이언트 환경(클라인이 사용하는 환경과 유사)

설치

  1. 저장소를 복제합니다.
    git clone https://github.com/IncomeStreamSurfer/chatgpt-native-image-gen-mcp.git cd chatgpt-native-image-gen-mcp
  2. 가상 환경 설정(권장):
    python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
  3. 종속성 설치:
    pip install -r requirements.txt
  4. (선택 사항이지만 권장) 환경 변수 설정: 스크립트에 직접 입력하는 대신 OPENAI_API_KEY 환경 변수에 OpenAI 키를 설정하세요. 설정 방법은 운영 체제에 따라 다릅니다.

구성(Cline MCP 클라이언트용)

이 서버를 AI 비서(예: Cline)가 사용할 수 있도록 하려면 해당 구성을 MCP 설정 파일(예: cline_mcp_settings.json )에 추가하세요.

설정 파일에서 mcpServers 객체를 찾아 다음 항목을 추가하세요.

{ "mcpServers": { // ... other server configurations ... "openai-image-gen-mcp": { "autoApprove": [ "generate_image", "edit_image" ], "disabled": false, "timeout": 180, // Increased timeout for potentially long image generation "command": "python", // Or path to python executable if not in PATH "args": [ // IMPORTANT: Replace this path with the actual absolute path // to the openai_image_mcp.py file on your system "C:/path/to/your/cloned/repo/chatgpt-native-image-gen-mcp/openai_image_mcp.py" ], "env": { // If using environment variables for the API key: // "OPENAI_API_KEY": "YOUR_API_KEY_HERE" }, "transportType": "stdio" } // ... other server configurations ... } }

중요: C:/path/to/your/cloned/repo/ 컴퓨터에서 이 저장소를 복제한 경로의 올바른 절대 경로로 바꾸세요. 경로 구분 기호가 운영 체제에 맞는지 확인하세요(예: Windows에서는 백슬래시 \ 사용). 환경 변수를 통해 API 키를 설정한 경우, 스크립트에서 해당 키를 제거하고 MCP 클라이언트에서 지원하는 경우 env 섹션에 추가할 수 있습니다.

서버 실행

일반적으로 서버를 수동으로 실행할 필요는 없습니다. MCP 클라이언트(Cline 등)는 해당 도구 중 하나를 처음 호출할 때 구성 파일에 지정된 commandargs 사용하여 서버를 자동으로 시작합니다.

수동으로 테스트하려면(종속성이 설치되어 있고 API 키를 사용할 수 있는지 확인하세요):

python openai_image_mcp.py

용법

AI 어시스턴트는 generate_imageedit_image 도구를 사용하여 서버와 상호 작용합니다. 이미지는 openai_image_mcp.py 스크립트가 있는 ai-images 하위 디렉터리에 저장됩니다. 성공 시 도구는 저장된 이미지의 절대 경로를 반환합니다.

-
security - not tested
A
license - permissive license
-
quality - not tested

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 보조자가 텍스트 프롬프트를 기반으로 이미지를 만들고 수정할 수 있도록 합니다.

  1. 특징
    1. 필수 조건
      1. 설치
        1. 구성(Cline MCP 클라이언트용)
          1. 서버 실행
            1. 용법

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                Allows AI assistants to generate and transform high-quality images from text prompts using Google's Gemini model via the MCP protocol.
                Last updated -
                3
                16
                Python
                MIT License
                • Apple
              • -
                security
                A
                license
                -
                quality
                An 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 -
                60
                TypeScript
                MIT License
                • Linux
                • Apple
              • A
                security
                F
                license
                A
                quality
                An MCP (Model Context Protocol) server that allows generating, editing, and creating variations of images using OpenAI's DALL-E APIs.
                Last updated -
                1
                TypeScript
              • A
                security
                A
                license
                A
                quality
                An 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 -
                1
                1
                2
                JavaScript
                MIT License

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/IncomeStreamSurfer/chatgpt-native-image-gen-mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server