OpenAI GPT Image MCP

Integrations

  • Provides tools for generating and editing images using OpenAI's GPT-4o/gpt-image-1 APIs, supporting text-to-image generation, image editing operations (inpainting, outpainting, compositing), and advanced prompt control.

openai-gpt-image-mcp


OpenAI の GPT-4o/gpt-image-1 画像生成および編集 API 用のモデル コンテキスト プロトコル (MCP) ツール サーバー。

  • OpenAI の最新モデルを使用して、テキスト プロンプトから画像を生成します
  • 高度なプロンプト コントロールを使用して画像を編集します(インペインティング、アウトペインティング、合成)。
  • サポート対象: Claude Desktop、Cursor、VSCode、Windsurf、および MCP 互換クライアント。

✨ 特徴

  • create-image : プロンプトから、詳細オプション (サイズ、品質、背景など) を使用して画像を生成します。
  • edit-image : プロンプトとオプションのマスクを使用して画像を編集または拡張します。ファイル パスと base64 入力の両方をサポートします。
  • ファイル出力: 生成された画像を直接ディスクに保存するか、base64 として受け取ります。

🚀 インストール

git clone https://github.com/SureScaleAI/openai-gpt-image-mcp.git cd openai-gpt-image-mcp yarn install yarn build

🔑 構成

Claude Desktop または VSCode (Cursor/Windsurf を含む) の設定に追加します。

{ "mcpServers": { "openai-gpt-image-mcp": { "command": "node", "args": ["/absolute/path/to/dist/index.js"], "env": { "OPENAI_API_KEY": "sk-..." } } } }

⚡ 上級

  • create-imageの場合、 nを設定すると、一度に最大 10 枚の画像が生成されます。
  • edit-imageには、編集を適用する場所を制御するためのマスク イメージ (ファイル パスまたは base64) を指定します。
  • すべてのオプションについては、 src/index.ts参照してください。

🧑‍💻 開発

  • TypeScript ソース: src/index.ts
  • ビルド: yarn build
  • 実行: node dist/index.js

📝 ライセンス

マサチューセッツ工科大学


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

  • OPENAI_API_KEYが有効であり、イメージ API にアクセスできることを確認してください。
  • 認証済みのOpenAI組織が必要です。認証後、画像APIアクセスが有効になるまで15~20分かかる場合があります。
  • ファイル パスは絶対パスである必要があります。
  • ファイル出力の場合、ディレクトリが書き込み可能であることを確認してください。
  • ファイルの種類に関するエラーが表示される場合は、画像ファイルの拡張子と形式を確認してください。

⚠️ 制限事項と大きなファイルの処理

  • 1MBのペイロード制限: MCPクライアント(Claude Desktopを含む)では、ツールレスポンスに1MBの厳格な制限があります。大きな画像(特に高解像度画像や複数の画像)をbase64で返すと、この制限を簡単に超えてしまう可能性があります。
  • **ファイル出力への自動切り替え:**画像サイズの合計が1MBを超える場合、ツールは自動的に画像をディスクに保存し、base64ではなくファイルパスを返します。これにより互換性が確保され、 result exceeds maximum length of 1048576といったエラーを回避できます。
  • デフォルトのファイルの場所: file_outputパスを指定しない場合、画像は一意のファイル名で/tmp (またはMCP_HF_WORK_DIR環境変数で設定されたディレクトリ) に保存されます。
  • 環境変数:
    • MCP_HF_WORK_DIR : 大きな画像やファイル出力の保存場所を制御するには、これを設定します。例: export MCP_HF_WORK_DIR=/your/desired/dir
  • **ベスト プラクティス:**大きな画像や実稼働画像の場合は、常にファイル出力を使用し、クライアントがファイル パスを処理できるように構成されていることを確認します。

📚 参考文献


🙏 クレジット

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

local-only server

The server can only run on the client's local machine because it depends on local resources.

OpenAI の画像モデルを通じて画像の生成と編集を可能にし、さまざまな MCP 互換クライアント間でのテキストから画像への生成と高度な画像編集 (インペインティング、アウトペインティング) をサポートする MCP ツール サーバー。

  1. ✨ Features
    1. 🚀 Installation
      1. 🔑 Configuration
        1. ⚡ Advanced
          1. 🧑‍💻 Development
            1. 📝 License
              1. 🩺 Troubleshooting
                1. ⚠️ Limitations & Large File Handling
                  1. 📚 References
                    1. 🙏 Credits

                      Related MCP Servers

                      • -
                        security
                        A
                        license
                        -
                        quality
                        An MCP server for analyzing images using OpenRouter vision models, offering capabilities like automatic image resizing, model configuration, and handling custom queries about images.
                        Last updated -
                        5
                        JavaScript
                        MIT License
                      • A
                        security
                        A
                        license
                        A
                        quality
                        An MCP Server that integrates with Stability AI's API to provide high-quality image generation, editing, and manipulation capabilities including background removal, outpainting, search-and-replace, and upscaling.
                        Last updated -
                        13
                        35
                        55
                        TypeScript
                        MIT License
                        • Apple
                      • -
                        security
                        F
                        license
                        -
                        quality
                        An MCP server that allows users to generate, edit, and create variations of images through OpenAI's DALL-E API, supporting both DALL-E 2 and DALL-E 3 models.
                        Last updated -
                        2
                        TypeScript
                      • -
                        security
                        -
                        license
                        -
                        quality
                        A TypeScript-based MCP server that lets users generate images using OpenAI's dall-e-3 model by providing a prompt and image name.
                        Last updated -
                        1

                      View all related MCP servers

                      ID: 436idj4xa1