Skip to main content
Glama

ImageForge MCP

English | 中文

A lightweight TypeScript MCP server for generating and editing images with OpenAI gpt-image-2, and for text-to-image generation with Zhipu BigModel image models.

  • OpenAI text-to-image requests use POST /v1/images/generations; Zhipu uses POST /api/paas/v4/images/generations.

  • OpenAI image editing and reference-image generation use multipart POST /v1/images/edits.

  • Generated images are returned as native MCP image content blocks and can optionally be saved locally.

Features

  • OpenAI model: gpt-image-2

  • Zhipu models: glm-image, cogview-4-250304, cogview-4, cogview-3-flash

  • MCP tools: generate_image and edit_image

  • Text-to-image generation

  • Image generation guided by one or more reference images

  • Zhipu text-to-image generation with optional server-side watermark control

  • Editing one or more existing images

  • Local absolute paths and HTTP(S) URLs as image inputs

  • PNG, JPEG, and WebP input and output

  • Up to 16 input images, with a 50 MB limit per image and a 200 MB combined limit

  • Optional local output path with automatic parent-directory creation

  • URL validation against non-public network targets, with DNS addresses pinned to the actual connection

  • Bounded input loading concurrency

  • stdio transport

Related MCP server: openai-gpt-image-1-mcp

Provider capability matrix

Capability

OpenAI

Zhipu

Text-to-image

Yes

Yes

Reference-image generation

Yes, through reference_images

No; the tool returns an error before reading files or sending a request

Image editing

Yes, through edit_image

No

Models

gpt-image-2

glm-image, cogview-4-250304, cogview-4, cogview-3-flash

Quality values

auto, low, medium, high

glm-image: auto, hd; other models: auto, standard, hd

watermark_enabled

Ignored without error

Forwarded only when explicitly supplied

output_format

Sent to the provider

Ignored; MIME type is detected from the downloaded image

Provider response

Base64 image data

Temporary image URL, downloaded immediately by ImageForge

Zhipu BigModel support

ImageForge calls the official Zhipu image generation endpoint with Bearer authentication. The supported models and ImageForge behavior are:

Model

ImageForge quality values

Notes

glm-image

auto, hd

Prompt is limited to 1,000 characters before the request is sent

cogview-4-250304

auto, standard, hd

Text-to-image only

cogview-4

auto, standard, hd

Text-to-image only

cogview-3-flash

auto, standard, hd

Text-to-image only

quality: "auto" is an ImageForge compatibility value: it omits the quality field and lets Zhipu apply the model default. ImageForge validates only the WIDTHxHEIGHT shape of size; Zhipu remains authoritative for each model's supported dimensions and pixel limits. The MCP-level default remains 1024x1024 for compatibility across providers.

Zhipu returns one temporary image URL. ImageForge downloads it immediately and returns native MCP image content after validating the actual PNG, JPEG, or WebP signature. The download always enforces public-address checks, DNS pinning, redirect revalidation, a 30-second timeout, and a 50 MB limit, even when IMAGEFORGE_SKIP_DNS_SAFETY_CHECKS is enabled for user-supplied OpenAI input images. Provider credentials are never forwarded to the image URL.

watermark_enabled follows these rules:

  • Omitted: ImageForge does not send the field, so the Zhipu account/model default applies.

  • true: requests Zhipu's explicit and implicit watermarks.

  • false: requests Zhipu to disable watermarks; the account must have the required watermark-removal authorization. ImageForge never removes or edits a watermark locally.

  • OpenAI: the same unified parameter is silently ignored.

See the official Zhipu image generation API for current provider-side size, quality, watermark, and account-policy rules.

OpenAI-compatible CPA and gateway support

ImageForge MCP works with OpenAI and with CPA, relay, or proxy services that implement a compatible OpenAI Images API. This includes deployments based on projects such as New API, CLI Proxy API, and similar OpenAI-compatible gateways.

Compatibility depends on the gateway implementation rather than its product name:

  • Text-to-image requires POST /v1/images/generations.

  • Reference-image generation and editing require multipart POST /v1/images/edits with image[] file forwarding.

  • Responses must include Base64 image data in data[0].b64_json.

  • The configured model name must accept gpt-image-2.

A gateway that only implements /v1/images/generations can be used for text-to-image generation, but not for reference-image generation or editing.

Requirements

  • Node.js 22 or later

  • An OpenAI API key or a compatible gateway token; a Zhipu API key is needed only when using the zhipu provider

Install and build

npm install
npm run build

MCP client configuration

For production use, start the published npm package with npx. No repository clone or local build is required. Inject credentials through the MCP client environment:

{
  "mcpServers": {
    "imageforge": {
      "command": "npx",
      "args": ["-y", "imageforge-mcp"],
      "env": {
        "OPENAI_API_KEY": "your-token",
        "OPENAI_IMAGE_MODEL": "gpt-image-2",
        "IMAGEFORGE_PROVIDER": "openai",
        "IMAGEFORGE_INPUT_CONCURRENCY": "4"
      }
    }
  }
}

-y allows npx to download or update the package without an interactive install prompt. Pin a specific version when reproducible deployments are required, for example "imageforge-mcp@0.4.0".

For a Zhipu-default MCP server, use an independent credential and provider configuration:

{
  "mcpServers": {
    "imageforge-zhipu": {
      "command": "npx",
      "args": ["-y", "imageforge-mcp@0.4.0"],
      "env": {
        "IMAGEFORGE_PROVIDER": "zhipu",
        "ZHIPU_API_KEY": "your-zhipu-token",
        "ZHIPU_IMAGE_MODEL": "glm-image"
      }
    }
  }
}

ZHIPU_BASE_URL is optional and defaults to https://open.bigmodel.cn/api/paas/v4. ZHIPU_IMAGE_MODEL is optional and defaults to glm-image. Zhipu credentials never fall back to OpenAI variables, and OpenAI credentials never fall back to Zhipu variables. A per-call provider, api_key, base_url, or model overrides the corresponding environment configuration.

OPENAI_BASE_URL is optional. When it is unset, ImageForge MCP uses the official OpenAI endpoint https://api.openai.com/v1. Set it only when using New API, CLI Proxy API, or another OpenAI-compatible gateway:

"OPENAI_BASE_URL": "https://your-openai-compatible-gateway.example/v1"

The value must point to the gateway's /v1 root. ImageForge MCP appends /images/generations or /images/edits as required.

IMAGEFORGE_INPUT_CONCURRENCY optionally controls how many local or remote input images are loaded at once. It defaults to 4, must be a positive integer, and is capped at the per-call limit of 16 input images. The combined input size remains capped at 200 MB.

DNS safety checks are enabled by default. Set IMAGEFORGE_SKIP_DNS_SAFETY_CHECKS=true only when private-network or DNS-proxy image URLs must be supported. This disables non-public address rejection and DNS pinning for every redirect hop, which can expose the MCP process to SSRF. HTTP(S)-only URLs, the credential restriction, redirect limit, size limits, and image signature validation remain enforced. Accepted true values are true, 1, yes, and on; false values are false, 0, no, and off.

Do not commit real API keys to Git or write them into shared configuration files.

Codex local development configuration

Create a project-scoped .codex/config.toml using paths that match your machine:

[mcp_servers.imageforge_dev]
command = "/absolute/path/to/node"
args = ["/absolute/path/to/ImageForgeMCP/dist/index.js"]
cwd = "/absolute/path/to/ImageForgeMCP"
env_vars = ["OPENAI_API_KEY", "OPENAI_BASE_URL", "OPENAI_IMAGE_MODEL", "ZHIPU_API_KEY", "ZHIPU_BASE_URL", "ZHIPU_IMAGE_MODEL", "IMAGEFORGE_PROVIDER", "IMAGEFORGE_INPUT_CONCURRENCY", "IMAGEFORGE_SKIP_DNS_SAFETY_CHECKS"]
startup_timeout_sec = 10
tool_timeout_sec = 300
enabled = true
required = false

Export the environment variables before starting Codex:

export OPENAI_API_KEY="your-gateway-token"
export OPENAI_BASE_URL="https://your-openai-compatible-gateway.example/v1"
export OPENAI_IMAGE_MODEL="gpt-image-2"
export IMAGEFORGE_INPUT_CONCURRENCY="4"

cd /absolute/path/to/ImageForgeMCP
codex app

For a Zhipu-default development process, export the Zhipu variables instead of the OpenAI credential/model variables:

export IMAGEFORGE_PROVIDER="zhipu"
export ZHIPU_API_KEY="your-zhipu-token"
export ZHIPU_IMAGE_MODEL="glm-image"
# Optional: export ZHIPU_BASE_URL="https://open.bigmodel.cn/api/paas/v4"

Codex loads project-scoped .codex/config.toml only for trusted projects. After adding or changing the MCP configuration, restart Codex or open a new task, then use /mcp verbose to confirm that imageforge_dev exposes:

  • generate_image

  • edit_image

After changing the TypeScript source, rebuild dist/index.js and restart the task using the MCP server:

npm run build

See the official Codex MCP documentation for all configuration options.

generate_image

Parameter

Required

Default

Description

prompt

Yes

-

Image description

model

No

Environment or provider default

OpenAI: gpt-image-2; Zhipu: glm-image, cogview-4-250304, cogview-4, cogview-3-flash

base_url

No

OPENAI_BASE_URL or ZHIPU_BASE_URL

Per-call provider API base URL override

api_key

No

OPENAI_API_KEY or ZHIPU_API_KEY

Per-call provider credential override; environment variables are preferred

provider

No

IMAGEFORGE_PROVIDER, then openai

openai or zhipu

size

No

1024x1024

Output size requested from the provider

quality

No

auto

OpenAI: auto/low/medium/high; glm-image: auto/hd; other Zhipu models: auto/standard/hd

output_format

No

png

png, jpeg, or webp

output_path

No

-

Local save path; relative paths resolve from the MCP working directory

watermark_enabled

No

-

Sent only to Zhipu when set; false may require watermark-removal account permission. Unsupported providers ignore it

reference_images

No

-

OpenAI reference images as local absolute paths or HTTP(S) URLs; Zhipu rejects this parameter

Without reference_images, the tool uses /images/generations. With OpenAI reference images, it uploads them as multipart image[] files to /images/edits.

Zhipu supports synchronous text-to-image only. It rejects reference_images before reading the referenced files or making a request, does not support edit_image, and ignores output_format. No Authorization header is sent to the image CDN, and the returned MCP MIME type is based on the downloaded image bytes.

Zhipu glm-image without an explicit quality or watermark override:

{
  "provider": "zhipu",
  "model": "glm-image",
  "prompt": "A hand-painted lakeside village at sunrise, warm light, no text",
  "size": "1280x1280",
  "quality": "auto"
}

Zhipu glm-image requesting no provider watermark:

{
  "provider": "zhipu",
  "model": "glm-image",
  "prompt": "A clean studio product render on a neutral background, no text",
  "size": "1280x1280",
  "quality": "hd",
  "watermark_enabled": false,
  "output_path": "outputs/zhipu-product.png"
}

Faster CogView request using provider-standard quality:

{
  "provider": "zhipu",
  "model": "cogview-4",
  "prompt": "A colorful editorial illustration of a modern city park, no text",
  "size": "1024x1024",
  "quality": "standard"
}

Common Zhipu failures are returned as tool errors with the HTTP status and a provider response excerpt of at most 500 characters. Authentication failures must be fixed rather than retried; HTTP 429 with business code 1113 means the account balance is insufficient, while other 429 codes can indicate rate, model-load, or account-plan limits. ImageForge does not automatically retry paid generation requests. See the official Zhipu error-code reference for current business-code meanings.

edit_image

edit_image uses the same model, API, output, and local-save parameters as generate_image, but requires input_images:

Parameter

Required

Description

prompt

Yes

Editing instructions

input_images

Yes

1–16 local absolute paths or HTTP(S) URLs

Local images are read directly. URL images are downloaded and validated before upload. Every redirect target is revalidated, non-public addresses are rejected, and the validated DNS results are pinned to the actual connection to prevent DNS rebinding between validation and download.

Configuration precedence is: tool arguments, environment variables, then built-in defaults.

When output_path is supplied, ImageForge MCP returns the native MCP image content block, saves the decoded image, and includes the final absolute path in a text content block. Missing parent directories are created automatically. Existing files are not overwritten.

Some OpenAI-compatible gateways may return dimensions different from the requested size; the actual returned file dimensions are authoritative.

Verification

npm test
npm run check

Tests use a local HTTP mock. They do not call a real image API or incur generation charges.

License

MIT


中文说明

ImageForge MCP 是一个轻量的 TypeScript MCP 图片生成与编辑服务,支持通过 OpenAI Images API 调用 gpt-image-2,并支持通过智谱 BigModel API 进行文生图。

  • OpenAI 纯文本生图调用 POST /v1/images/generations;智谱调用 POST /api/paas/v4/images/generations

  • OpenAI 图片编辑和参考图生图调用 multipart POST /v1/images/edits

  • 生成结果以原生 MCP image 内容块返回,也可以同时保存到本地。

功能

  • OpenAI 模型:gpt-image-2

  • 智谱模型:glm-imagecogview-4-250304cogview-4cogview-3-flash

  • MCP 工具:generate_imageedit_image

  • 支持纯文本生图

  • 支持一张或多张参考图引导生图

  • 支持一张或多张图片编辑

  • 输入图片支持本地绝对路径和 HTTP(S) URL

  • 输入与输出支持 PNG、JPEG、WebP

  • 最多 16 张输入图片,每张不超过 50 MB,单次调用合计不超过 200 MB

  • 支持通过 output_path 保存到本地,并自动创建父目录

  • URL 安全校验,拒绝非公网地址,并将校验后的 DNS 地址固定到实际连接

  • 输入图片加载并发受控

  • stdio Transport

供应商能力矩阵

能力

OpenAI

智谱

文生图

支持

支持

参考图生图

支持,通过 reference_images

不支持;会在读取文件和发送请求前明确报错

图片编辑

支持,通过 edit_image

不支持

模型

gpt-image-2

glm-imagecogview-4-250304cogview-4cogview-3-flash

quality

autolowmediumhigh

glm-imageautohd;其他模型:autostandardhd

watermark_enabled

静默忽略

仅显式传入时转发

output_format

发送给供应商

忽略,以下载图片的真实 MIME 为准

供应商响应

Base64 图片数据

临时图片 URL,由 ImageForge 立即下载

智谱 BigModel 支持

ImageForge 使用 Bearer 认证调用智谱官方图片生成接口,各模型在当前实现中的规则如下:

模型

ImageForge 接受的 quality

说明

glm-image

autohd

请求前限制提示词最多 1000 个字符

cogview-4-250304

autostandardhd

仅支持文生图

cogview-4

autostandardhd

仅支持文生图

cogview-3-flash

autostandardhd

仅支持文生图

quality: "auto" 是 ImageForge 的兼容值,表示不向智谱发送 quality,由智谱使用对应模型的默认质量。ImageForge 对 size 只校验 宽x高 格式,具体尺寸、整除要求和像素上限以智谱接口为准;为了保持供应商间兼容,MCP 层默认尺寸仍为 1024x1024

智谱返回一张图片的临时 URL,ImageForge 会立即下载,并在验证实际内容为 PNG、JPEG 或 WebP 后返回原生 MCP 图片内容。即使用户为了 OpenAI 输入图设置了 IMAGEFORGE_SKIP_DNS_SAFETY_CHECKS,智谱结果图下载仍强制执行公网地址检查、DNS 固定、重定向复核、30 秒超时和 50 MB 限制,且不会把供应商认证信息转发给图片地址。

watermark_enabled 规则:

  • 不传:ImageForge 不发送该字段,使用智谱账号或模型默认行为。

  • true:请求智谱添加显式水印和隐式数字水印。

  • false:请求智谱关闭水印,账号必须具备相应去水印权限;ImageForge 不会在本地擦除或修改水印。

  • OpenAI:统一参数会被静默忽略。

智谱服务端当前尺寸、质量、水印和账号政策应以官方图片生成 API 文档为准。

OpenAI 兼容 CPA 与网关

ImageForge MCP 不仅支持 OpenAI 官方接口,也支持实现了 OpenAI Images API 兼容协议的 CPA、中转或代理服务,包括基于 New APICLI Proxy API 等项目部署的 OpenAI 兼容网关。

是否兼容取决于网关实现的接口能力,而不是产品名称:

  • 纯文本生图需要实现 POST /v1/images/generations

  • 参考图生图和图片编辑需要实现 multipart POST /v1/images/edits,并正确转发 image[] 文件。

  • 响应需要在 data[0].b64_json 中返回 Base64 图片数据。

  • 网关需要接受 gpt-image-2 模型名。

如果网关只实现了 /v1/images/generations,仍可用于纯文本生图,但不能使用参考图生图和图片编辑。

环境要求

  • Node.js 22 或更高版本

  • OpenAI API Key,或 OpenAI 兼容 CPA/网关签发的令牌

安装与构建

npm install
npm run build

MCP 客户端配置

生产环境推荐直接通过 npx 启动 npm 官方包,无需克隆仓库或在本地构建。通过 MCP 客户端环境变量注入密钥:

{
  "mcpServers": {
    "imageforge": {
      "command": "npx",
      "args": ["-y", "imageforge-mcp"],
      "env": {
        "OPENAI_API_KEY": "你的令牌",
        "OPENAI_IMAGE_MODEL": "gpt-image-2",
        "IMAGEFORGE_PROVIDER": "openai",
        "IMAGEFORGE_INPUT_CONCURRENCY": "4"
      }
    }
  }
}

-y 允许 npx 在没有交互式安装提示的情况下下载或更新包。如果部署需要固定版本,可将包名写成 "imageforge-mcp@0.4.0"

如果希望 MCP 默认使用智谱,应使用独立的智谱凭据与供应商配置:

{
  "mcpServers": {
    "imageforge-zhipu": {
      "command": "npx",
      "args": ["-y", "imageforge-mcp@0.4.0"],
      "env": {
        "IMAGEFORGE_PROVIDER": "zhipu",
        "ZHIPU_API_KEY": "你的智谱令牌",
        "ZHIPU_IMAGE_MODEL": "glm-image"
      }
    }
  }
}

ZHIPU_BASE_URL 可选,默认值为 https://open.bigmodel.cn/api/paas/v4ZHIPU_IMAGE_MODEL 可选,默认值为 glm-image。智谱与 OpenAI 的环境密钥不会互相回退。单次调用传入的 providerapi_keybase_urlmodel 优先于对应环境变量。

OPENAI_BASE_URL 是可选配置。不设置时,ImageForge MCP 默认使用 OpenAI 官方接口 https://api.openai.com/v1。只有使用 New API、CLI Proxy API 或其他 OpenAI 兼容网关时才需要设置:

"OPENAI_BASE_URL": "https://你的-OpenAI-兼容网关域名/v1"

地址应填写到网关的 /v1 根路径为止,服务会根据请求追加 /images/generations/images/edits

IMAGEFORGE_INPUT_CONCURRENCY 可选,用于控制同时加载的本地或远程输入图片数量。默认值为 4,必须是正整数,并直接受单次最多 16 张输入图片的限制。单次调用的输入图片合计大小仍固定限制为 200 MB。

DNS 安全检查默认启用。只有确实需要访问私有网络地址或 DNS 代理生成的图片地址时,才应设置 IMAGEFORGE_SKIP_DNS_SAFETY_CHECKS=true。启用后,每次重定向都不再执行非公网地址拦截和 DNS 地址固定,可能使 MCP 进程面临 SSRF 风险。HTTP(S) 协议限制、URL 凭据限制、重定向次数、图片大小和图片魔数校验仍然有效。真值支持 true1yeson,假值支持 false0nooff

不要把真实 API Key 写入 Git 或其他共享配置文件。

Codex 本地开发配置

根据本机路径创建项目级 .codex/config.toml

[mcp_servers.imageforge_dev]
command = "/你的/node/绝对路径"
args = ["/你的/ImageForgeMCP/绝对路径/dist/index.js"]
cwd = "/你的/ImageForgeMCP/绝对路径"
env_vars = ["OPENAI_API_KEY", "OPENAI_BASE_URL", "OPENAI_IMAGE_MODEL", "ZHIPU_API_KEY", "ZHIPU_BASE_URL", "ZHIPU_IMAGE_MODEL", "IMAGEFORGE_PROVIDER", "IMAGEFORGE_INPUT_CONCURRENCY", "IMAGEFORGE_SKIP_DNS_SAFETY_CHECKS"]
startup_timeout_sec = 10
tool_timeout_sec = 300
enabled = true
required = false

启动 Codex 前设置环境变量:

export OPENAI_API_KEY="你的网关令牌"
export OPENAI_BASE_URL="https://你的-OpenAI-兼容网关域名/v1"
export OPENAI_IMAGE_MODEL="gpt-image-2"
export IMAGEFORGE_INPUT_CONCURRENCY="4"

cd /你的/ImageForgeMCP/绝对路径
codex app

如果本地开发进程默认使用智谱,应改为导出智谱配置,不要复用 OpenAI 密钥或模型变量:

export IMAGEFORGE_PROVIDER="zhipu"
export ZHIPU_API_KEY="你的智谱令牌"
export ZHIPU_IMAGE_MODEL="glm-image"
# 可选:export ZHIPU_BASE_URL="https://open.bigmodel.cn/api/paas/v4"

Codex 只会加载已信任项目中的 .codex/config.toml。新增或修改 MCP 配置后,需要重新启动 Codex 或新建任务,再使用 /mcp verbose 确认 imageforge_dev 提供以下工具:

  • generate_image

  • edit_image

修改 TypeScript 源码后,需要重新构建并重启使用该 MCP 的任务:

npm run build

完整配置说明见 Codex MCP 官方文档

generate_image

参数

必填

默认值

说明

prompt

-

图片描述

model

环境变量或供应商默认值

OpenAI:gpt-image-2;智谱:glm-imagecogview-4-250304cogview-4cogview-3-flash

base_url

OPENAI_BASE_URLZHIPU_BASE_URL

单次调用覆盖对应供应商 API 地址

api_key

OPENAI_API_KEYZHIPU_API_KEY

单次调用覆盖对应供应商密钥;推荐使用环境变量

provider

IMAGEFORGE_PROVIDER,再默认 openai

openaizhipu

size

1024x1024

请求提供商输出的图片尺寸

quality

auto

OpenAI:auto/low/medium/highglm-imageauto/hd;其他智谱模型:auto/standard/hd

output_format

png

pngjpegwebp

output_path

-

本地保存路径;相对路径按 MCP 工作目录解析

watermark_enabled

-

仅智谱显式传入时发送;false 可能需要账号去水印权限。不支持的供应商静默忽略

reference_images

-

OpenAI 参考图,支持本地绝对路径和 HTTP(S) URL;智谱会明确拒绝

不传 reference_images 时调用 /images/generations;OpenAI 传入参考图时,将图片作为 multipart image[] 文件上传到 /images/edits

智谱首版仅支持同步文生图,不支持参考图和 edit_image。传入 reference_images 时会在读取参考文件和发起请求前明确报错;output_format 对智谱不生效。下载图片时不携带 Authorization,最终 MCP MIME 类型以实际图片内容为准。

智谱 glm-image,不覆盖供应商默认质量和水印行为:

{
  "provider": "zhipu",
  "model": "glm-image",
  "prompt": "日出时分的手绘湖畔村庄,暖色光线,无文字",
  "size": "1280x1280",
  "quality": "auto"
}

智谱 glm-image 请求关闭供应商水印:

{
  "provider": "zhipu",
  "model": "glm-image",
  "prompt": "中性背景上的干净棚拍产品渲染,无文字",
  "size": "1280x1280",
  "quality": "hd",
  "watermark_enabled": false,
  "output_path": "outputs/zhipu-product.png"
}

CogView 使用供应商标准质量快速生成:

{
  "provider": "zhipu",
  "model": "cogview-4",
  "prompt": "色彩丰富的现代城市公园编辑插画,无文字",
  "size": "1024x1024",
  "quality": "standard"
}

智谱失败会作为 MCP 工具错误返回,包含 HTTP 状态和最多 500 个字符的供应商错误摘要。认证失败必须修正配置而不是重试;HTTP 429 且业务错误码为 1113 表示账户欠费,其他 429 错误也可能表示限流、模型繁忙或套餐限制。ImageForge 不会自动重试可能产生费用的生图请求。业务错误码的当前含义以智谱官方错误码文档为准。

edit_image

edit_imagegenerate_image 使用相同的模型、API、输出和本地保存参数,但 input_images 必填:

参数

必填

说明

prompt

编辑指令

input_images

1–16 张输入图片,支持本地绝对路径或 HTTP(S) URL

本地图片会直接读取;URL 图片会经过下载和安全校验后再上传。每次重定向都会重新校验目标地址,非公网地址会被拒绝,同时会将校验后的 DNS 结果固定到实际连接,防止校验与下载之间发生 DNS Rebinding。

配置优先级为:工具参数、环境变量、内置默认值。

传入 output_path 时,服务会在返回原生 MCP 图片内容块的同时保存文件,并在文本内容块中返回最终绝对路径。父目录不存在时会自动创建;已有文件不会被覆盖。

部分 OpenAI 兼容网关可能不会严格遵循请求中的 size,应以实际返回文件的尺寸为准。

验证

npm test
npm run check

测试使用本地 HTTP mock,不会调用真实图片 API,也不会产生生图费用。

许可证

MIT

Available Tools

2 tools
edit_imageC

Edit one or more input images with gpt-image-2.

ParametersJSON Schema
NameRequiredDescriptionDefault
sizeNoOutput size, for example 1536x1024.1024x1024
modelNoModel name; only gpt-image-2 is supported.
promptYesInstructions for the image edit.
api_keyNoPer-call API key; OPENAI_API_KEY is preferred.
qualityNoauto
base_urlNoOpenAI-compatible base URL ending in /v1.
output_pathNoOptional local path to save the edited image. Relative paths resolve from the MCP working directory. Existing files are not overwritten.
input_imagesYesInput images as absolute local paths or HTTP(S) URLs.
output_formatNopng

TDQS

C2.9/5.0
Behavior2/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 disclosing side effects and behaviors. It merely says 'Edit' without mentioning that it modifies images, whether originals are preserved, any API key requirements, or the fact that output_path will not overwrite existing files (as noted in the schema). This lack of transparency is a significant gap for a mutation 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, front-loaded sentence with zero wasted words. It efficiently conveys the core purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, mutation operation) and the absence of an output schema, the description is far too brief. It doesn't explain expected return values, prerequisites like api_key or base_url, or how the tool integrates with the sibling generate_image. The description is minimally sufficient only for basic understanding.

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 78%, which is close to the high threshold, so the schema already documents most parameters. The description itself adds no parameter-level detail, falling to the baseline score of 3.

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 clearly states the action (edit) and the resource (one or more input images) with the specific model (gpt-image-2). It implicitly distinguishes from the sibling generate_image by focusing on editing existing images rather than creating new ones, though it doesn't explicitly name the alternative.

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 use this tool versus generate_image or any other alternatives. There are no stated prerequisites, exclusions, or contextual cues beyond the core action.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_imageB

Generate one image with gpt-image-2, optionally guided by reference images.

ParametersJSON Schema
NameRequiredDescriptionDefault
sizeNoOutput size, for example 1536x1024.1024x1024
modelNoModel name; only gpt-image-2 is supported.
promptYesImage description.
api_keyNoPer-call API key; OPENAI_API_KEY is preferred.
qualityNoauto
base_urlNoOpenAI-compatible base URL ending in /v1.
output_pathNoOptional local path to save the generated image. Relative paths resolve from the MCP working directory. Existing files are not overwritten.
output_formatNopng
reference_imagesNoOptional reference images as absolute local paths or HTTP(S) URLs.

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description alone must disclose behavioral traits, but it only mentions generation with reference-image guidance. It omits important behavior such as file-saving side effects (output_path), overwrite policy, API-key requirements, or what happens on failure.

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?

Two sentences, no fluff, front-loads the core purpose and key differentiator (optional reference images). Every word contributes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, a 9-parameter generation tool needs more than a two-sentence description to be fully actionable. Missing return-value behavior, usage boundaries relative to edit_image, and side-effecting save behavior for output_path.

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 coverage is high (78%), so the description need not restate parameters; it does add one useful semantic link by saying reference images are optional guidance. Otherwise, it adds little beyond the schema's own descriptions.

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?

Clearly states a specific action ('Generate') and resource ('one image'), identifies the model (gpt-image-2), and notes optional reference images; this distinguishes it from the sibling edit_image tool.

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?

Description implies the tool is for generating new images, not editing, but never explicitly tells the agent when to choose this over edit_image or any exclusion criteria. No alternative tool is named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.6/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: one generates new images, the other edits existing images. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tool names follow the same verb_noun pattern (generate_image, edit_image), providing a consistent and predictable naming convention.

Tool Count4/5

At two tools, the set is minimal but appropriate for the server's focused purpose of image generation and editing. While slightly thin, each tool is essential and well-scoped.

Completeness5/5

The tool surface fully covers the domain of image creation and modification. There are no obvious missing operations for the server's stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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/chanshawoh/imageforge-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server