RelayOne Image MCP
RelayOne Image MCP
这是 RelayOne Image 的 MCP 接入包,同时支持 Image2 和 Gemini Banana 两条生图路线。每个使用者只需要配置一个 RelayOne API Key。
两种生图 Provider
Provider | 协议 | 默认模型 | 适合场景 |
| OpenAI Images |
| 精确像素尺寸、Image2 生图 |
| Gemini |
| Banana 文生图、最多 14 张参考图改图 |
Banana 还支持 gemini-3-pro-image。它的 imageSize 是 512、1K、2K、4K 清晰度档位,aspectRatio 控制比例;它不是 Image2 的固定 宽x高 尺寸协议。
Related MCP server: Gemini Image Generation MCP Server
支持的模型
Image2
模型 | 文生图 | 图生图 | 说明 |
| 支持 | 支持 | 基础模型,支持固定像素尺寸 |
| 支持 | 支持 | low 质量档,需对应分组已启用 |
| 支持 | 支持 | medium 质量档,需对应分组已启用 |
| 支持 | 支持 | high 质量档,需对应分组已启用 |
Gemini Banana
模型 | 文生图 | 图生图/改图 | 说明 |
| 支持 | 支持 | 默认,速度优先、成本较低,最多 14 张参考图 |
| 支持 | 支持 | 质量优先,最多 14 张参考图 |
gemini-3-pro-image-preview 会归一化为 gemini-3-pro-image,是别名而不是第三个独立模型。Banana 两个模型的文生图和图生图都调用同一个 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 路径;如需切换站点再修改它。每个 agent 将
.env.example复制为.env,并只填写SITE_IMAGE_API_KEY;不要把 Key 写入工具参数。如需代理,在运行 MCP 的机器上额外设置
SITE_IMAGE_PROXY_URL,这是可选项。如果站点不是 Bearer 鉴权或不是 OpenAI-compatible 请求格式,在
src/index.ts的callProvider和请求 schema 中改适配逻辑。执行
npm install、npm run build,再将dist/index.js注册到 MCP 客户端。
.env 会在 MCP 启动时自动读取,因此 agent 不需要改启动命令。
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),并将图片保存到该目录,同时返回 MCPimage内容。
每次调用自定义参数
标准字段直接传入,站点专属字段放入 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任意透传没有加入模板;站长应根据自己的接口逐项加入白名单字段。
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.
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| size | No | ||
| model | No | ||
| prompt | Yes | ||
| stream | No | ||
| quality | No | ||
| provider | No | Provider id from list_image_providers. | image2 |
| imageSize | No | ||
| background | No | ||
| moderation | No | ||
| aspectRatio | No | ||
| output_format | No | ||
| partial_images | No | ||
| save_directory | Yes | Required absolute local directory selected by the user before generation. The response JSON and generated images are saved here. | |
| response_format | No | ||
| reference_images | No | Absolute local image paths. Banana supports up to 14; Image2 uses edit_image for references. | |
| custom_parameters | No | Additional JSON fields for this request. Reserved fields cannot be overridden. | |
| output_compression | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of disclosing safety and side effects. It does disclose side effects (preserving response, saving files to disk, returning MCP content). However, it does not reveal potential write/modification behavior, provider-specific limitations, or error-prone conditions like overwriting files or moderation implications.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is reasonably concise and front-loaded with the main action. It covers multiple behaviors compactly. It could be slightly more structured (e.g., split into purpose and usage), but it earns its place without padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 18 parameters, no output schema, and no annotations, the description is underspecified for full autonomous use. It clarifies the file-saving and response-preservation behaviors but does not explain the full output contract, provider coordination, or parameter interactions, making it adequate but with clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is low (22%), so the description partially compensates by clarifying key behavior around save_directory and response preservation. It adds meaning beyond the schema for the main flow, especially the user-selected directory semantics, but leaves many parameters unexplained (e.g., background, moderation, stream, custom_parameters).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses specific verbs ('Generate', 'preserve', 'save', 'return') and identifies the core resource (image) and key behaviors (file saving, MCP content return). It is clear enough to distinguish from siblings like list_image_providers or get_image_capabilities, though it doesn't explicitly name those alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is the main generation action, and mentions preserving URL/b64_json response and saving to a user-selected directory, which signals when file persistence is involved. However, it does not provide explicit when-to-use vs. alternatives, prerequisites (e.g., provider selection via prepare_image_request), or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_image_capabilitiesA
Show supported models, modes, limits and parameters for the selected provider.
| Name | Required | Description | Default |
|---|---|---|---|
| provider | No | Provider id from list_image_providers. | image2 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It only says 'Show' which implies a read operation, but it does not explicitly state that it is safe, side-effect-free, or has no permission requirements. It also does not mention any potential rate limits or error conditions. This is a significant gap for an unannotated tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the key information. Every word contributes to the purpose without fluff, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only tool with one parameter and no output schema, the description sufficiently conveys what is displayed (models, modes, limits, parameters). It does not over-explain and is complete given the tool's simplicity, though it could mention the default provider or output format for extra clarity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides full coverage for the single parameter (provider) with a description referencing list_image_providers. The tool description adds no additional meaning beyond the schema, so it meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool shows supported models, modes, limits, and parameters for a selected provider. This is a specific verb+resource combination that distinguishes it from siblings like list_image_providers (lists providers) and generate_image (creates images).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage (when you need provider capabilities) but does not explicitly contrast it with alternatives or state when not to use it. It lacks explicit exclusions or named alternatives, so it is adequate but not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_image_usageA
Read the optional usage endpoint without generating images.
| Name | Required | Description | Default |
|---|---|---|---|
| provider | No | Provider id from list_image_providers. | image2 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral disclosure burden. It clearly states the operation is a read ('Read') and has no image-generation side effect ('without generating images'), which is the key safety-related behavior. However, it omits details about response format or potential errors, though the tool is simple.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It conveys the action, the resource, and the critical non-generation behavior efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and no output schema, the description plus schema covers the essential information: what it reads and what it avoids doing. It lacks an explicit description of the returned usage data, but 'usage' and the endpoint reference provide reasonable context for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides 100% coverage for the single parameter 'provider,' including its default and a description pointing to list_image_providers. The tool description adds no additional parameter meaning, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Read' and identifies the resource as 'the optional usage endpoint,' clearly stating what the tool does. The phrase 'without generating images' explicitly distinguishes it from the sibling tool generate_image.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for checking usage information rather than performing generation, which provides clear context. It does not explicitly name alternative sibling tools or provide exclusion criteria, but the non-generating framing and provider reference from list_image_providers offer sufficient guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_image_providersA
List configured providers without exposing credentials.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the behavioral burden. "Without exposing credentials" is a meaningful safety trait and adds value beyond the tool name, but it does not disclose return format, potential errors, or whether any privileged access is needed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one short, front-loaded sentence with no filler. Every word earns its place, and the key security caveat is included without bloating the text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter list operation, the description is mostly complete: it states what is listed and a critical constraint. However, there is no output schema and the description does not specify what fields or identifiers are returned, which is a minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so the baseline is 4 per the rubric. The description needs to add no parameter-level detail because there are no parameters to document.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: "List configured providers" clearly names the action and object. It also adds the credential-safe qualifier, which differentiates it from sibling tools like list_remote_image_models.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no guidance on when to choose this tool over siblings such as list_remote_image_models or get_image_capabilities. No alternatives or exclusions are mentioned, so the agent must infer usage purely from the name and short description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_remote_image_modelsA
Read the live model list. This is not a generation request.
| Name | Required | Description | Default |
|---|---|---|---|
| provider | No | Provider id from list_image_providers. | image2 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must convey behavior. It states it is a read operation ('Read') and clarifies it is not a generation request, but provides no further details on output format, side effects, or requirements, leaving the agent with minimal behavioral insight.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, with two short sentences that front-load the purpose and add a distinguishing note. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple list tool with one optional parameter and no output schema, the description is adequate but does not mention the provider filter or the nature of the returned list. Since the schema covers the parameter, this is a minor gap, so a middle score is warranted.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the provider parameter includes a helpful reference ('Provider id from list_image_providers'). The tool description itself does not add parameter information, but the schema fully documents it, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Read the live model list') with a specific resource, and explicitly distinguishes it from a generation request with 'This is not a generation request.' This separates it from sibling tools like generate_image.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage (to read available models) and gives a negative guideline by stating it is not a generation request, but does not explicitly mention when to use it relative to alternatives like list_image_providers or get_image_capabilities.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
prepare_image_requestC
Preview the outgoing JSON without contacting the provider.
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| size | No | ||
| model | No | ||
| prompt | Yes | ||
| stream | No | ||
| quality | No | ||
| provider | No | Provider id from list_image_providers. | image2 |
| imageSize | No | ||
| background | No | ||
| moderation | No | ||
| aspectRatio | No | ||
| output_format | No | ||
| partial_images | No | ||
| response_format | No | ||
| reference_images | No | Absolute local image paths. Banana supports up to 14; Image2 uses edit_image for references. | |
| custom_parameters | No | Additional JSON fields for this request. Reserved fields cannot be overridden. | |
| output_compression | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states that the tool does not contact the provider, which is a key behavioral trait (non-mutating). However, it does not describe the output format (e.g., whether it returns the JSON payload, any validation results, or errors). For a preview tool, this basic information is valuable but incomplete, as it leaves uncertainty about what exactly will be returned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence and is front-loaded, but it is severely under-specified for a tool with 17 parameters and no annotations. It lacks any structural breakdown or elaboration on usage, output, or behavior. The brevity is not conciseness but rather an omission of critical information. A tool of this complexity requires a fuller description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (17 parameters), lack of annotations, no output schema, and low schema coverage, the description is woefully incomplete. It provides only a high-level purpose without any context about how to use the parameters, what the preview looks like, or how it relates to generate_image. This is insufficient for an agent to correctly invoke the tool with meaningful parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 18%, meaning the schema leaves 82% of parameters undocumented. The description provides zero parameter details, failing to compensate for the low coverage. With 17 parameters, the lack of any explanation about parameters such as 'n', 'size', 'model', 'stream', etc., leaves the agent unable to construct a valid request without external knowledge. The description adds no semantic value beyond the schema's minimal annotations.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Preview the outgoing JSON without contacting the provider.' It uses a specific verb ('preview') and resource ('outgoing JSON'), and distinguishes itself from sibling tools like generate_image by indicating it does not contact the provider. This is a clear and unambiguous purpose statement.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description offers no explicit guidance on when to use this tool versus alternatives. It does not mention that this should be used before generate_image to validate requests, nor does it provide any exclusions or conditions. The context of 'without contacting the provider' implies a dry-run use case, but that is not stated explicitly. No alternatives are referenced, so the agent must infer the usage pattern.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.3.0- First observed
generate_image - First observed
get_image_capabilities - First observed
get_image_usage - First observed
list_image_providers - First observed
list_remote_image_models - First observed
prepare_image_request
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
AI image + video generation for agents: --flag prompt DSL, async generate/poll, x402 pay-per-use.
Generate and edit images, create videos, quote credit costs, and retrieve private results.
Generate images with your own ChatGPT subscription (Plus, Pro or Team), without spending API credits
Create images and videos from prompts, with options for image mixing, reference images, and start/…
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to generate, edit, and analyze images using Google's Gemini image generation models including Nano Banana Pro (gemini-3-pro-image-preview).159 npm17MIT
- FlicenseNot gradedqualityDmaintenanceEnables image generation, editing, and refinement using Google's Gemini 2.5 Flash Image model with support for multi-image composition and style transfer.-
- FlicenseNot gradedqualityDmaintenanceEnables image generation and editing via third-party relay services. Returns local file paths and Markdown display hints.-
- AlicenseBqualityBmaintenanceEnables generating images from text or transforming existing images using GPT-Image-compatible APIs, with support for OpenAI and Agnes AI backends.2MIT