RelayOne Image MCP
RelayOne Image MCP
これは RelayOne Image の MCP 接続パッケージで、Image2 と Gemini Banana の2つの画像生成ルートを同時にサポートします。各利用者は RelayOne API Key を1つ設定するだけで済みます。
2つの画像生成プロバイダー
Provider | プロトコル | デフォルトモデル | 適した用途 |
| OpenAI Images |
| 正確なピクセルサイズ、Image2 画像生成 |
| Gemini |
| Banana テキストから画像生成、最大14枚の参照画像による画像編集 |
Banana は gemini-3-pro-image にも対応しています。その imageSize は 512、1K、2K、4K の解像度レベルで、aspectRatio が比率を制御します。Image2 の固定 幅x高さ サイズプロトコルではありません。
Related MCP server: image-relay-mcp
対応モデル
Image2
モデル | テキストから画像 | 画像から画像 | 説明 |
| 対応 | 対応 | 基本モデル、固定ピクセルサイズに対応 |
| 対応 | 対応 | low 品質レベル、対応グループの有効化が必要 |
| 対応 | 対応 | medium 品質レベル、対応グループの有効化が必要 |
| 対応 | 対応 | high 品質レベル、対応グループの有効化が必要 |
Gemini Banana
モデル | テキストから画像 | 画像から画像/画像編集 | 説明 |
| 対応 | 対応 | デフォルト、速度優先・低コスト、最大14枚の参照画像 |
| 対応 | 対応 | 品質優先、最大14枚の参照画像 |
gemini-3-pro-image-preview は gemini-3-pro-image に正規化されます。これはエイリアスであり、独立した3つ目のモデルではありません。Banana の2つのモデルは、テキストから画像と画像から画像の両方で同じ generateContent インターフェースを呼び出します。reference_images を含めるかどうかで、テキストから画像か画像から画像かが決まります。
Provider を選択すると、MCP が自動的にプロトコルを選択します:
image2はreference_imagesがない場合、/v1/images/generationsJSON を呼び出します。参照画像がある場合は/v1/images/editsmultipart を呼び出し、image[]で参照画像をアップロードします。bananaは常に/v1beta/models/{model}:generateContentを呼び出します。参照画像はcontents[].parts[].inlineDataに変換されます。multipart でも OpenAI Images JSON でもありません。
サイトで記入する内容
config/providers.jsonには RelayOne のアドレス、モデル、Images パスが設定済みです。サイトを切り替える場合はこれを変更します。各エージェントは
.env.exampleを.envにコピーし、SITE_IMAGE_API_KEYのみを記入します。Key をツールパラメータに書き込まないでください。プロキシが必要な場合は、MCP を実行するマシンに
SITE_IMAGE_PROXY_URLを追加設定します。これはオプションです。サイトが Bearer 認証でない場合や OpenAI-compatible のリクエスト形式でない場合は、
src/index.tsのcallProviderとリクエストスキーマで適応ロジックを変更します。npm install、npm run buildを実行し、dist/index.jsを MCP クライアントに登録します。
.env は MCP 起動時に自動的に読み込まれるため、エージェントは起動コマンドを変更する必要はありません。
MCP 登録例
mcp-server.example.json の PACKAGE_DIRECTORY を現在のパッケージディレクトリに置き換え、使用する MCP クライアントの設定形式に従って登録します。.env と dist/index.js はそのディレクトリと同じ階層にある必要があります。
ツール
list_image_providers:ローカル設定のチャネルを表示します。キーは表示しません。list_remote_image_models:リアルタイムのモデル一覧を読み取ります。画像は生成しません。get_image_capabilities:サイト管理者が記入したパラメータの機能を確認します。get_image_usage:オプションの使用量インターフェースを読み取ります。画像は生成しません。prepare_image_request:実際の JSON をプレビューします。ネットワーク接続は行いません。generate_image:呼び出し前にローカルの絶対パスsave_directoryを指定する必要があります。ツールは完全な元のレスポンス JSON(urlとb64_jsonを含む)を保持し、画像をそのディレクトリに保存するとともに、MCP のimageコンテンツを返します。
呼び出しごとのカスタムパラメータ
標準フィールドは直接渡し、サイト固有のフィールドは custom_parameters に入れます。例:
{
"prompt": "一座雨夜城市",
"size": "1024x1024",
"custom_parameters": {
"steps": 30,
"guidance_scale": 7,
"seed": 12345,
"negative_prompt": "模糊、低清晰度"
}
}custom_parameters は今回のリクエスト JSON にマージされます。provider、model、prompt、custom_parameters および既に渡された標準フィールドは上書きできません。
セキュリティ制約
実際のキーは起動環境にのみ入れ、
providers.json、コード、ログ、MCP ツールパラメータには書き込みません。save_directoryはユーザーが毎回の画像生成前に明示的に選択する必要があります。MCP が保存場所を独自に決定することはありません。保存ディレクトリには
.response.jsonの元のレスポンスファイルと、連番で命名された画像ファイルが生成されます。URL 画像のダウンロードは HTTP(S) のみ許可され、25 MB に制限されます。ダウンロード失敗時も元の URL は
.response.jsonに保持されます。リクエストとレスポンスで Authorization ヘッダーは出力されません。
advancedの任意透過はテンプレートに追加されていません。サイト管理者は自身のインターフェースに応じてホワイトリストフィールドを1つずつ追加する必要があります。
Codex 登録
Codex の MCP 設定で node dist/index.js を登録し、設定済みの環境変数を通じて RelayOne Key を渡します。実際の値をサンプルファイルに入れたり、第三者に送信したりしないでください。
プロジェクトアドレス:https://github.com/linshiqiyyds/relayone-image-mcp
画像生成呼び出し例
generate_image を呼び出す際は、最初に保存ディレクトリを選択する必要があります。例:
{
"prompt": "一只橘猫坐在窗边,电影感,自然光",
"size": "1024x1024",
"response_format": "b64_json",
"save_directory": "D:\\RelayOne-MCP\\generated"
}response_format: "url" を選択した場合、MCP は URL に対応する画像をダウンロードします。b64_json を選択した場合、MCP は Base64 をデコードします。両方の元のフィールドは .response.json ファイルにそのまま保存されます。
Image2 の例
{
"provider": "image2",
"model": "gpt-image-2",
"prompt": "一张产品摄影图",
"size": "2048x1152",
"response_format": "url",
"save_directory": "D:\\RelayOne-MCP\\generated"
}Image2 の画像から画像は、ローカルの参照画像パスを追加するだけで、MCP が自動的に /v1/images/edits に切り替えます:
{
"provider": "image2",
"model": "gpt-image-2",
"prompt": "保留主体,把背景改成夜晚城市",
"reference_images": ["D:\\References\\product.png"],
"size": "2048x1152",
"save_directory": "D:\\RelayOne-MCP\\generated"
}Banana の例
{
"provider": "banana",
"model": "gemini-3.1-flash-image",
"prompt": "把产品放在夜晚城市街道中",
"aspectRatio": "16:9",
"imageSize": "2K",
"reference_images": [
"D:\\References\\product.png"
],
"save_directory": "D:\\RelayOne-MCP\\generated"
}Banana の参照画像は純粋な Base64 として読み取られ、Gemini のネイティブプロトコルに従って contents[].parts[].inlineData に配置されます。最大14枚、各画像最大20 MB、PNG・JPEG・WebP に対応しています。Banana のモデルは gpt-image-2 を使用せず、Image2 の固定ピクセル size フィールドも使用しません。
Available Tools
6 toolsgenerate_imageA
Generate an image, preserve the original URL or b64_json response, save files to the user-selected directory, and return MCP image content.
Inputs: prompt (required), save_directory (required), n, size, +14 more.
get_image_capabilitiesA
Show supported models, modes, limits and parameters for the selected provider.
Inputs: provider.
get_image_usageA
Read the optional usage endpoint without generating images.
Inputs: provider.
list_image_providersA
List configured providers without exposing credentials.
Inputs: no named parameters.
list_remote_image_modelsA
Read the live model list. This is not a generation request.
Inputs: provider.
prepare_image_requestC
Preview the outgoing JSON without contacting the provider.
Inputs: prompt (required), n, size, model, +13 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools are clearly distinct, but `list_remote_image_models` and `get_image_capabilities` both relate to model information, with the latter including supported models. Descriptions help differentiate them, so ambiguity is minimal.
All tool names follow a consistent verb_noun pattern (list, get, prepare, generate) using snake_case. The naming is uniform and predictable, making it easy to infer each tool's purpose.
Six tools is well-scoped for an image generation server, covering discovery, capability inspection, usage monitoring, request preview, and actual generation. Each tool earns its place without redundancy.
The tool surface provides a complete workflow for image generation: listing providers and models, checking capabilities and usage, previewing requests, and generating images. No obvious gaps exist for the stated purpose.
Maintenance
Related MCP Connectors
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Generate and edit images: article covers, pet portraits, product shots. Each call spends credits.
Generate AI images and videos from your agent: list models, start jobs, and fetch the results.
Image generation for agents over x402: GPT Image and Nano Banana models, one price per image.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to generate, edit, and analyze images using Google's Gemini image generation models including Nano Banana Pro (gemini-3-pro-image-preview).234 npm18MIT
- FlicenseNot gradedqualityDmaintenanceEnables image generation and editing via third-party relay services. Returns local file paths and Markdown display hints.-
- AlicenseBqualityDmaintenanceEnables generating images from text or transforming existing images using GPT-Image-compatible APIs, with support for OpenAI and Agnes AI backends.2MIT
- AlicenseAqualityDmaintenanceEnables image analysis, OCR, and text-to-image generation through OpenAI-compatible APIs. Supports local paths, URLs, or base64 images with configurable models and backup endpoints.3MIT