GPT Image 1 MCP

MIT License
323
1
  • Linux
  • Apple

Integrations

  • Uses curl commands for proper MIME handling when working with image files, especially for the image editing functionality.

  • Runs as a Node.js application, with the MCP server requiring Node.js v14+ to function properly.

  • Available as an npm package that can be installed globally or run directly with npx, making it easy to integrate with various MCP clients.

🚀 クイックスタート

npx -y @cloudwerxlab/gpt-image-1-mcp

📋 前提条件

🔑 環境変数

💻 NPX の使用例

# Set your OpenAI API key export OPENAI_API_KEY=sk-your-openai-api-key # Optional: Set custom output directory export GPT_IMAGE_OUTPUT_DIR=/home/username/Pictures/ai-generated-images # Run the server with NPX npx -y @cloudwerxlab/gpt-image-1-mcp
# Set your OpenAI API key $env:OPENAI_API_KEY = "sk-your-openai-api-key" # Optional: Set custom output directory $env:GPT_IMAGE_OUTPUT_DIR = "C:\Users\username\Pictures\ai-generated-images" # Run the server with NPX npx -y @cloudwerxlab/gpt-image-1-mcp
:: Set your OpenAI API key set OPENAI_API_KEY=sk-your-openai-api-key :: Optional: Set custom output directory set GPT_IMAGE_OUTPUT_DIR=C:\Users\username\Pictures\ai-generated-images :: Run the server with NPX npx -y @cloudwerxlab/gpt-image-1-mcp

🔌 MCPクライアントとの統合

🛠️ MCP クライアントでの設定

{ "mcpServers": { "gpt-image-1": { "command": "npx", "args": [ "-y", "@cloudwerxlab/gpt-image-1-mcp" ], "env": { "OPENAI_API_KEY": "PASTE YOUR OPEN-AI KEY HERE", "GPT_IMAGE_OUTPUT_DIR": "OPTIONAL: PATH TO SAVE GENERATED IMAGES" } } } }
さまざまなオペレーティングシステムの構成例
{ "mcpServers": { "gpt-image-1": { "command": "npx", "args": ["-y", "@cloudwerxlab/gpt-image-1-mcp"], "env": { "OPENAI_API_KEY": "sk-your-openai-api-key", "GPT_IMAGE_OUTPUT_DIR": "C:\\Users\\username\\Pictures\\ai-generated-images" } } } }
{ "mcpServers": { "gpt-image-1": { "command": "npx", "args": ["-y", "@cloudwerxlab/gpt-image-1-mcp"], "env": { "OPENAI_API_KEY": "sk-your-openai-api-key", "GPT_IMAGE_OUTPUT_DIR": "/home/username/Pictures/ai-generated-images" } } } }

:Windowsのパスの場合、JSON内のバックスラッシュ文字をエスケープするには、二重のバックスラッシュ( \\ )を使用してください。Linux/macOSの場合は、スラッシュ( / )を使用してください。

✨ 特徴

💡 強化された機能

🔄仕組み

📁 出力ディレクトリの動作

インストールと使用方法

NPMパッケージ

このパッケージはnpmで入手可能です: @cloudwerxlab/gpt-image-1-mcp

グローバルにインストールできます:

npm install -g @cloudwerxlab/gpt-image-1-mcp

または、クイック スタート セクションに示されているように、npx を使用して直接実行します。

ツール: create_image

テキストプロンプトに基づいて新しい画像を生成します。

パラメータ
パラメータタイプ必須説明
promptはい生成する画像のテキスト説明(最大 32,000 文字)
sizeいいえ画像サイズ: 「1024x1024」(デフォルト)、「1536x1024」、または「1024x1536」
qualityいいえ画像品質: 「高」(デフォルト)、「中」、または「低」
n整数いいえ生成する画像の数(1~10、デフォルト:1)
backgroundいいえ背景スタイル: 「透明」、「不透明」、または「自動」(デフォルト)
output_formatいいえ出力形式: 「png」(デフォルト)、「jpeg」、または「webp」
output_compression整数いいえ圧縮レベル(0~100、デフォルト:0)
userいいえOpenAI 使用状況追跡用のユーザー識別子
moderationいいえモデレーションレベル:「低」または「自動」(デフォルト)
<use_mcp_tool> <server_name>gpt-image-1</server_name> <tool_name>create_image</tool_name> <arguments> { "prompt": "A futuristic city skyline at sunset, digital art", "size": "1024x1024", "quality": "high", "n": 1, "background": "auto" } </arguments> </use_mcp_tool>
応答

ツールは次を返します:

  • 生成された画像の詳細を記載したフォーマットされたテキストメッセージ
  • base64でエンコードされたデータとしての画像
  • トークンの使用状況やファイルパスなどのメタデータ

ツール: create_image_edit

テキスト プロンプトとオプションのマスクに基づいて既存の画像を編集します。

パラメータ
パラメータタイプ必須説明
image文字列、オブジェクト、または配列はい編集する画像(base64文字列またはファイルパスオブジェクト)
promptはい希望する編集のテキスト説明(最大 32,000 文字)
mask文字列またはオブジェクトいいえ編集する領域を定義するマスク(base64文字列またはファイルパスオブジェクト)
sizeいいえ画像サイズ: 「1024x1024」(デフォルト)、「1536x1024」、または「1024x1536」
qualityいいえ画像品質: 「高」(デフォルト)、「中」、または「低」
n整数いいえ生成する画像の数(1~10、デフォルト:1)
backgroundいいえ背景スタイル: 「透明」、「不透明」、または「自動」(デフォルト)
userいいえOpenAI 使用状況追跡用のユーザー識別子
Base64エンコードされた画像の例
<use_mcp_tool> <server_name>gpt-image-1</server_name> <tool_name>create_image_edit</tool_name> <arguments> { "image": "BASE64_ENCODED_IMAGE_STRING", "prompt": "Add a small robot in the corner", "mask": "BASE64_ENCODED_MASK_STRING", "quality": "high" } </arguments> </use_mcp_tool>
ファイルパスの例
<use_mcp_tool> <server_name>gpt-image-1</server_name> <tool_name>create_image_edit</tool_name> <arguments> { "image": { "filePath": "C:/path/to/your/image.png" }, "prompt": "Add a small robot in the corner", "mask": { "filePath": "C:/path/to/your/mask.png" }, "quality": "high" } </arguments> </use_mcp_tool>
応答

ツールは次を返します:

  • 編集された画像の詳細を記載したフォーマットされたテキストメッセージ
  • 編集された画像はbase64でエンコードされたデータとして
  • トークンの使用状況やファイルパスなどのメタデータ

🔧 トラブルシューティング

🚨 よくある問題

🔍 エラー処理とレポート

MCPサーバーには、問題発生時に詳細な情報を提供する包括的なエラー処理機能が搭載されています。エラーが発生すると、以下の処理が行われます。

  1. エラー形式: すべてのエラーは次の形式で返されます:
    • 何が問題だったのかを説明する明確なエラーメッセージ
    • 特定のエラーコードまたはタイプ
    • エラーに関する追加のコンテキスト(利用可能な場合)
  2. AI アシスタントの動作: この MCP サーバーを AI アシスタントと共に使用する場合:
    • AIは常に完全なエラーメッセージを報告し、トラブルシューティングを支援します。
    • AIはエラーの原因を分かりやすい言葉で説明する
    • AIは問題を解決するための具体的な手順を提案します

📄 ライセンス

🙏 謝辞

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

OpenAI の gpt-image-1 モデルを使用して画像を生成および編集できるモデル コンテキスト プロトコル サーバー。これにより、AI アシスタントがテキスト プロンプトから画像を作成および変更できるようになります。

  1. 📋 前提条件
    1. 🔑 環境変数
      1. 💻 NPX の使用例
        1. 🔌 MCPクライアントとの統合
          1. 🛠️ MCP クライアントでの設定
        2. ✨ 特徴
          1. 💡 強化された機能
        3. 🔄仕組み
          1. 📁 出力ディレクトリの動作
        4. インストールと使用方法
          1. NPMパッケージ
          2. ツール: create_image
          3. ツール: create_image_edit
        5. 🔧 トラブルシューティング
          1. 🚨 よくある問題
          2. 🔍 エラー処理とレポート
        6. 📄 ライセンス
          1. 🙏 謝辞

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol server that provides image generation capabilities using the Ideogram API, allowing users to create images from text prompts with customizable parameters.
              Last updated -
              1
              1
              3
              JavaScript
            • -
              security
              -
              license
              -
              quality
              A Model Context Protocol server enabling AI assistants to generate images through OpenAI's DALL-E API with full support for all available options and fine-grained control.
              Last updated -
              JavaScript
              MIT License
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that enables AI assistants to generate images, text, and audio through the Pollinations APIs without requiring authentication.
              Last updated -
              7
              325
              4
              JavaScript
              MIT License
              • Linux
              • 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 -
              11
              TypeScript
              MIT License

            View all related MCP servers

            ID: msnns8io3m