gpt-image-mcp
Provides tools for generating and editing images using OpenAI's image API, including listing available models, generating images from prompts, editing images with masks, composing edited regions onto a base image, and creating elliptical masks.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gpt-image-mcpGenerate a base image, then create mouth and eye variations for lip-sync and compose them."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gpt-image-mcp
OpenAI の画像生成/編集を MCP ツールとして出すサーバ。 同じキャラクターの差分絵(口の形・目の開閉)を作る用途を主目的にしている。
なぜ単なるAPIラッパーではないか
/v1/images/edits は、マスクを渡しても画像全体を再生成する。
実測(2026-08-12・gpt-image-2・1024x1024):
マスク内で変化 | マスク外で変化 | マスク外の最大差分 | |
口を「あ」に編集 | 7,184px (35.8%) | 9,425px (0.92%) | 220 |
口を「い」に編集 | 1,498px (7.5%) | 7,431px (0.72%) | 216 |
最大差分220は「ほぼ別の色」。編集結果をそのまま動画のコマに使うと、口が変わるたびに髪や輪郭も動く—— 30fps で切り替えると顔が揺れる。
このサーバは対処を同梱している。編集結果は「口の形の参考」として扱い、土台は1枚に固定して、
マスク領域だけをローカルで貼り直す(compose_region)。土台はビット単位で保たれる。
マスク外の最大差分 | |
編集結果をそのまま使う | 220 |
単純にぼかして合成 | 55(ぼけがマスク外へ滲む) |
| 10(知覚不能) |
Related MCP server: Nano-Banana MCP Server
ツール
ツール | 課金 | 何をするか |
| なし | このキーで使える画像モデルを列挙。キーが生きているかの確認にも使う |
| あり | プロンプトから生成し、ファイルに保存してパスを返す |
| あり | マスク指定で編集。そのままコマに使わないこと(上記) |
| なし | 編集結果のマスク領域だけを土台へ貼る。土台の汚れを自動検証する |
| なし | 楕円マスクを作る(比率指定) |
画像は base64 で返さずファイルに書いてパスを返す。会話の文脈を食い潰さないため。
APIキーの扱い
このサーバはキーを保持しない。 呼ぶたびに、次の順で解決する。
環境変数
OPENAI_API_KEYmacOS Keychain(
OPENAI_KEYCHAIN_SERVICEにサービス名を設定した場合)
エラー本文にキーが混ざった場合は [REDACTED] に置換してから返す。
Keychain へ入れる場合(コマンド履歴にキーを残さない形):
printf 'key: '; stty -echo; read -r K; stty echo; echo
security add-generic-password -a "$USER" -s openai-image -U -w "$K"; unset K⚠
securityの対話入力(-wを引数なしで最後に置く形)は128文字で切り捨てる。sk-proj-形式のキーは164文字あるため、上の「値として渡す」形を使うこと。
設定
.mcp.json / Claude Code の MCP 設定に追加する。
{
"mcpServers": {
"gpt-image": {
"command": "node",
"args": ["/path/to/gpt-image-mcp/src/index.mjs"],
"env": { "OPENAI_KEYCHAIN_SERVICE": "openai-image" }
}
}
}必要なもの
Node.js 18+(
fetch/FormDataを使う)Python 3 + Pillow(
compose_region/make_mask)。numpyがあれば土台の汚れを自動検証する
npm install
pip install Pillow numpyアバターの作り方(この構成での標準手順)
generate_imageで土台を1枚作る。背景は単色、影とグラデーションを禁止、正面向き、口は閉じ目は開くmake_maskで口の領域(目安0.40 / 0.455 / 0.60 / 0.575)と目の領域(0.34 / 0.32 / 0.66 / 0.42)のマスクを作るedit_imageで口の形(あいうえお)と閉じた目を作るcompose_regionで全部を土台へ貼り直す ← ここを飛ばすと顔が揺れる口の形は母音ごとに1枚。日本語の口パクは
a i u e o+ 閉じ口の6枚で足りる
⚠ 「い」のように変化が小さい口の形は生成が弱い(実測でマスク内の変化が7.5%しか出ず、 マスク外のほうが動いた)。プロンプトを形で具体的に指示するか、その口だけ手で描くほうが早い。
生成物の権利
生成画像を販売物に使う場合、「動画に使ってよい」と「販売する教材に使ってよい」が 別条項のことがある。使う前に、使うキーのアカウントの利用規約を確認すること。 借りたキーで作った素材を自社商品に使わない。
ライセンス
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceAn 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.110MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. It allows users to create new images from text, modify existing files, and perform iterative edits through natural language prompts.6924MIT
- Alicense-qualityDmaintenanceMCP server that wraps OpenAI's image generation and editing APIs, enabling text-to-image and image-to-image operations via tools.20138ISC
- AlicenseAqualityDmaintenanceAn MCP server that generates and edits images using OpenAI's GPT Image model, allowing users to create images from text descriptions and edit existing images through natural language.111MIT
Related MCP Connectors
MCP server for NanoBanana AI image generation and editing
MCP server for OpenAI Sora AI video generation
MCP server for Flux AI image generation
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/cometa-kaito/gpt-image-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server