image-gen-mcp
Image Gen MCP
OpenAI 画像モデルを使用して画像を生成・編集するための TypeScript MCP サーバー。
このサーバーは generate_image と edit_image ツールを登録し、返された画像バイトをディスクに書き込みます。Stdio モードでは要求された絶対ファイルパスに書き込み、SSE およびストリーミング可能な HTTP ではファイルを自動保存して画像 URL を返します。
環境
名前 | 必須 | デフォルト | 説明 |
| いいえ | AI SDK OpenAI のデフォルト | OpenAI API の URL プレフィックス。例: |
| はい | - | OpenAI API キー。 |
| いいえ |
| OpenAI 画像モデル。 |
| いいえ |
| SSE/HTTP モードで自動保存されるファイルのディレクトリ。Docker ではデフォルトで |
Related MCP server: OpenAI GPT-Image MCP Server
ツール
generate_image
引数:
名前 | 必須 | デフォルト | 説明 |
| はい | - | 画像プロンプト。 |
| Stdio | - | Stdio のみ。絶対出力パス。親ディレクトリは自動的に作成されます。 |
| いいえ |
| 画像の数。 |
| いいえ |
|
|
| いいえ |
|
|
| いいえ | - |
|
| いいえ |
|
|
| いいえ | - |
|
| いいえ | - |
|
| Stdio |
| Stdio のみ。既存の出力ファイルを置き換えることを許可します。 |
既知のモデルサイズ制限は、アップストリーム API を呼び出す前に検証されます。たとえば、gpt-image-* モデルは 1024x1024、1536x1024、1024x1536 をサポートし、dall-e-2 は 256x256、512x512、1024x1024 をサポートします。
n > 1 の場合、/tmp/image.png のようなファイルパスは /tmp/image-1.png、/tmp/image-2.png などになります。
SSE およびストリーミング可能な HTTP モードでは、filepath と overwrite は公開されません。生成されたファイルは ${FILE_DIR}/YYYY-MM-DD/<uuid>.<ext> として保存され、http://localhost:3000/file/YYYY-MM-DD/<uuid>.png のような URL で返されます。
edit_image
引数:
名前 | 必須 | デフォルト | 説明 |
| はい | - | 編集指示。 |
| はい | - | 編集する元画像への絶対パス。 |
| いいえ | - | 編集マスク画像への任意の絶対パス。 |
| Stdio | - | Stdio のみ。絶対出力パス。親ディレクトリは自動的に作成されます。 |
| いいえ |
| 編集された画像の数。 |
| いいえ |
|
|
| いいえ |
|
|
| いいえ | - | 編集された画像の背景の動作。 |
| いいえ |
|
|
| いいえ | - |
|
| いいえ | - |
|
| Stdio |
| Stdio のみ。既存の出力ファイルを置き換えることを許可します。 |
このツールは、マルチパートフォームデータを使用して OpenAI 互換の /images/edits エンドポイントを呼び出します。出力ファイルは generate_image と同じファイルパスおよび自動保存の動作に従います。
開発
pnpm install
pnpm dev有用なチェック:
pnpm check
pnpm buildStdio MCP 設定
{
"mcpServers": {
"image-gen-mcp": {
"type": "stdio",
"command": "npx",
"args": ["image-gen-mcp"],
"env": {
"BASE_URL": "https://api.openai.com/v1",
"API_KEY": "sk-...",
"MODEL": "gpt-image-2"
}
}
}
}ストリーミング可能な HTTP
{
"mcpServers": {
"image-gen-mcp": {
"type": "http",
"url": "http://localhost:3000/mcp",
"headers": {
"openai-base-url": "https://api.openai.com/v1",
"openai-api-key": "sk-...",
"openai-model": "gpt-image-2"
}
}
}
}ヘッダーはサーバー側の環境設定を上書きします。ヘッダーを省略すると、環境変数の値にフォールバックします。Docker イメージはポート 3000 でストリーミング可能な HTTP を実行します。
SSE
SSE トランスポートは src/sse.ts にあり、/mcp で PORT(デフォルト 4000)をリッスンし、メッセージは /message に投稿されます。pnpm start:sse で直接実行します。Docker イメージでは起動されません。
{
"mcpServers": {
"image-gen-mcp": {
"type": "sse",
"url": "http://localhost:4000/mcp",
"headers": {
"openai-api-key": "sk-..."
}
}
}
}Docker
docker build -t image-gen-mcp .
docker run --rm -p 3000:3000 \
# 也可忽略apiKey,让使用方 headers 中传递
-e BASE_URL=https://api.openai.com/v1 \
-e API_KEY=sk-... \
-e MODEL=gpt-image-2 \
-v image-gen-data:/data \
image-gen-mcpMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables image generation using OpenAI's DALL-E and GPT-Image models directly through the Model Context Protocol. It allows users to create and save images with fine-grained control over parameters like size, quality, and background transparency.46MIT
- AlicenseAqualityCmaintenanceEnables image generation and editing using OpenAI's GPT Image API (gpt-image-1, 1.5, 2) with support for multi-image generation, history management, and batch processing.121,7841MIT
- FlicenseNot gradedqualityDmaintenanceProvides AI agents and coding assistants with image generation and editing capabilities using OpenAI's GPT-image-1 model, with support for local or Supabase storage.3
- FlicenseNot gradedqualityDmaintenanceEnables image generation and editing via OpenAI's gpt-image-1 model, with options for saving, format control, and transparency.
Related MCP Connectors
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
LLM chat, text summarization and AI image generation
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/seepine/image-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server