Skip to main content
Glama

RelayOne Image MCP

This is the MCP integration package for RelayOne Image, supporting both the Image2 and Gemini Banana image generation routes. Each user only needs to configure a single RelayOne API Key.

Two Image Generation Providers

Provider

Protocol

Default Model

Suitable Scenarios

image2

OpenAI Images /v1/images/generations

gpt-image-2

Precise pixel dimensions, Image2 image generation

banana

Gemini v1beta generateContent

gemini-3.1-flash-image

Banana text-to-image, up to 14 reference images for image editing

Banana also supports gemini-3-pro-image. Its imageSize uses 512, 1K, 2K, 4K resolution tiers, and aspectRatio controls the aspect ratio; it does not use Image2's fixed widthxheight dimension protocol.

Related MCP server: Gemini Image Generation MCP Server

Supported Models

Image2

Model

Text-to-Image

Image-to-Image

Description

gpt-image-2

Supported

Supported

Base model, supports fixed pixel dimensions

gpt-image-2-low

Supported

Supported

Low quality tier, requires the corresponding group to be enabled

gpt-image-2-medium

Supported

Supported

Medium quality tier, requires the corresponding group to be enabled

gpt-image-2-high

Supported

Supported

High quality tier, requires the corresponding group to be enabled

Gemini Banana

Name

Text-to-Image

Image-to-Image/Editing

Description

gemini-3.1-flash-image

Supported

Supported

Default, speed-first, lower cost, supports up to 14 reference images

gemini-3-pro-image

Supported

Supported

Quality-first, supports up to 14 reference images

gemini-3-pro-image-preview is normalized to gemini-3-pro-image; it is an alias rather than a third independent model. Both Banana models use the same generateContent endpoint for text-to-image and image-to-image generation; whether reference_images is included determines whether it is text-to-image or image-to-image.

After selecting a Provider, MCP automatically selects the protocol:

  • When image2 has no reference_images, it calls the /v1/images/generations JSON; when reference images are present, it calls /v1/images/edits as multipart and uploads the reference images using image[].

  • banana always calls /v1beta/models/{model}:generateContent; reference images are converted to contents[].parts[].inlineData, not multipart, and not OpenAI Images JSON.

What the Site Needs to Fill In

  1. config/providers.json already configures the RelayOne address, models, requires the corresponding group to be enabled. Request path, and Images path; modify it if you need to switch sites.

  2. Each agent copies .env.example to .env and only fills in SITE_IMAGE_API_KEY; do not write the key into tool parameters.

  3. If a proxy is needed, additionally set SITE_IMAGE_PROXY_URL on the machine running MCP. This is optional.

  4. If the site does not use Bearer authentication or is not compatible with the OpenAI-compatible request format, modify the adaptation logic in callProvider and the request schema in src/index.ts.

  5. Run npm install and npm run build, then register dist/index.js with the MCP client.

.env is automatically read when MCP starts, so the agent does not need to modify the startup command.

MCP Registration Example

Replace PACKAGE_DIRECTORY in mcp-server.example.json with the current package directory, then register it according to the configuration format of the MCP client you are using. .env and dist/index.js must be at the same directory level as this folder.

Description of Error Return Value

  • list_image_providers: Displays locally configured channels, without displaying keys.

  • list_remote_image_models: Reads the real-time list of available models, without generating images.

  • get_image_capabilities: Views the parameter capabilities filled in by the site administrator.

  • get_image_usage: Reads the optional usage API, without generating images.

  • Web Images API (Jina AI Reader).

  • generate_image: Must provide a local absolute path save_directory before calling. The tool preserves the complete raw response JSON (via the Image API) and saves the image files to the specified directory, while also returning MCP image content.

Custom Parameters for Each Call

Pass standard fields directly, and put site-specific fields in custom_parameters. For example:

{
  "prompt": "一座雨夜城市",
  "size": "1024x1024",
  "custom_parameters": {
    "steps": 30,
    "guidance_scale": 7,
    "seed": 12345,
    "negative_prompt": "模糊、低清晰度"
  }
}

custom_parameters will be merged into the current request JSON; provider, model, prompt, custom_parameters, and any already-passed standard fields cannot be overridden.

Custom Parameters

  • The actual key should only go into the startup environment, not into providers.json, code, logs, or MCP tool parameters.

  • save_directory must be explicitly selected by the user each time before generating an image; MCP does not decide the save location on its own.

  • A .response.json file containing the raw response, and image files named by sequence number, will be generated in the save directory.

  • URL image downloads only allow HTTP(S) and are limited to 25 MB; if the download fails, the original URL remains in .response.json.

  • Authorization headers will not be printed in any request or response.

  • Arbitrary pass-through of parameters is not predefined; site administrators should add allowlisted fields individually according to their own API.

Codex Registration

In Codex, register node dist/index.js in the MCP configuration, and pass the RelayOne key via the configured environment variables. Do not put real values into the example files or send them to third parties.

Project address: https://github.com/linshiqiyyds/relayone-image-mcp

Image Generation Call Examples

When calling generate_image, a save directory must be selected first. For example:

{
  "prompt": "一只橘猫坐在窗边,电影感,自然光",
  "size": "1024x1024",
  "response_format": "b64_json",
  "save_directory": "D:\\RelayOne-MCP\\generated"
}

If you choose response_format: "url", MCP will download the image from the URL; if you choose b64_json, MCP will decode the Base64. Both raw fields are preserved as-is in the .response.json file.

Image2 Examples

{
  "provider": "image2",
  "model": "gpt-image-2",
  "prompt": "一张产品摄影图",
  "size": "2048x1152",
  "response_format": "url",
  "save_directory": "D:\\RelayOne-MCP\\generated"
}

For Image2 image-to-image in the image conversion, you only need to add the local reference image path, and MCP will automatically switch to /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 Examples

{
  "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"
}

For Banana, reference images are read as plain Base64, placed into contents[].parts[].inlineData according to the native Gemini protocol. Up to 14 images, each up to 20 MB, supporting PNG, JPEG, and WebP. Banana models do not use gpt-image-2, nor do they support Image2 fixed pixel resolution.

Available Tools

6 tools
generate_imageA

Generate an image, preserve the original URL or b64_json response, save files to the user-selected directory, and return MCP image content.

ParametersJSON Schema
NameRequiredDescriptionDefault
nNo
sizeNo
modelNo
promptYes
streamNo
qualityNo
providerNoProvider id from list_image_providers.image2
imageSizeNo
backgroundNo
moderationNo
aspectRatioNo
output_formatNo
partial_imagesNo
save_directoryYesRequired absolute local directory selected by the user before generation. The response JSON and generated images are saved here.
response_formatNo
reference_imagesNoAbsolute local image paths. Banana supports up to 14; Image2 uses edit_image for references.
custom_parametersNoAdditional JSON fields for this request. Reserved fields cannot be overridden.
output_compressionNo

TDQS

A3.5/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
providerNoProvider id from list_image_providers.image2

TDQS

A3.6/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
providerNoProvider id from list_image_providers.image2

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
providerNoProvider id from list_image_providers.image2

TDQS

A3.5/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
nNo
sizeNo
modelNo
promptYes
streamNo
qualityNo
providerNoProvider id from list_image_providers.image2
imageSizeNo
backgroundNo
moderationNo
aspectRatioNo
output_formatNo
partial_imagesNo
response_formatNo
reference_imagesNoAbsolute local image paths. Banana supports up to 14; Image2 uses edit_image for references.
custom_parametersNoAdditional JSON fields for this request. Reserved fields cannot be overridden.
output_compressionNo

TDQS

C2.7/5.0
Behavior3/5

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.

Conciseness2/5

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.

Completeness1/5

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.

Parameters1/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

  1. 6 tool updatesv0.3.0
    • First observedgenerate_image
    • First observedget_image_capabilities
    • First observedget_image_usage
    • First observedlist_image_providers
    • First observedlist_remote_image_models
    • First observedprepare_image_request

TDQS

A3.7/5.0

Scored across 6 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers