image-router-mcp 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,15 +27,15 @@ Run it directly from npm with `npx`. You only need an API key for the provider y
27
27
 
28
28
  Model IDs are examples and defaults, not an allowlist. Other compatible model IDs can be supplied through the `model` argument.
29
29
 
30
- ### Model update notes (checked 2026-10-05)
30
+ ### Model update notes (checked 2026-11-05)
31
31
 
32
- - OpenAI: Sunburst is the default for editing precision. Choose `gpt-image-2.5-flare` for everyday generation, or explicitly set `gpt-image-2` to retain the previous model. `xhigh` and `max` require GPT Image 2.5 or a compatible newer model. [Official guide](https://developers.openai.com/api/docs/guides/image-generation)
33
- - Google: `gemini-3.1-flash-lite-image` (Nano Banana 2 Lite) is an optional faster, lower-cost model, limited to `1K` output. The default remains `gemini-3.1-flash-image`. [Official guide](https://ai.google.dev/gemini-api/docs/image-generation)
34
- - xAI: Imagine Image 2.0 replaces the previous built-in default. The old `grok-imagine-image-quality` slug is scheduled to redirect to 2.0 at `low` quality on November 2, 2026. With 2.0, omitted `quality` uses provider `auto`, currently `low` for generation and `medium` for edits. Pin `quality` to control this cost/quality choice. Environment model pins still take precedence. [Migration guide](https://docs.x.ai/developers/migration/imagine-image-quality-nov-2)
32
+ - OpenAI: Select `gpt-image-2.6-sunburst` or `gpt-image-2.6-flare` for complexity control and SVG/GIF generation. For example, pass `model: "gpt-image-2.6-flare", output_format: "svg", n: 1` with your prompt. The default stays on 2.5 Sunburst. [Image guide](https://developers.openai.com/api/docs/guides/image-generation)
33
+ - Google: For new projects, select `gemini-nano-banana-2.1` for conversational edits, up to 14 references and medium thinking. The compatibility default `gemini-3.1-flash-image` is deprecated with no shutdown date announced. [Model card](https://aistudio.google.com/docs/models/gemini-nano-banana-2.1)
34
+ - xAI: Since November 2 the exact `grok-imagine-image-quality` and `grok-imagine-image-pro` slugs route to Imagine Image 2.0 at low quality. Use `grok-imagine-image-2.0` explicitly to select quality. [Migration guide](https://docs.x.ai/developers/migration/imagine-image-quality-nov-2)
35
35
 
36
36
  Model access depends on your provider account. No automatic fallback to another paid model is performed.
37
37
 
38
- Version 0.2.1 keeps these defaults and Node.js 20 support. It fixes `moderation` forwarding for GPT Image edits, validates legacy xAI dated aliases, and updates MCP SDK 1.32.0 plus two vulnerable transitive dependencies. See the [October audit](https://github.com/JiaDians/image-router-mcp/blob/main/docs/provider-audits/2026-10-05.md) for sources, deferred changes and verification limits.
38
+ No configuration change is required. See the [November audit](https://github.com/JiaDians/image-router-mcp/blob/main/docs/provider-audits/2026-11-05.md) for API limits and dependency decisions.
39
39
 
40
40
  If you pin an older OpenAI model, review its retirement date: `gpt-image-1` on October 23, 2026, and `gpt-image-1-mini`, `gpt-image-1.5`, `chatgpt-image-latest` on December 1, 2026. Explicit pins are not silently migrated. [Official deprecations](https://developers.openai.com/api/docs/deprecations)
41
41
 
@@ -133,7 +133,7 @@ Use absolute paths in prompts and tool calls. Relative paths depend on the worki
133
133
  - When `output_path` is omitted, files are saved under `DEFAULT_OUTPUT_DIR`, or `./generated-images` relative to the MCP server working directory.
134
134
  - Use absolute input and output paths for predictable behavior across clients.
135
135
  - For portable local-image use across providers, use PNG, JPG/JPEG, or WebP files. The Google and xAI loaders accept these extensions.
136
- - xAI Imagine Image 2.0 accepts at most 5 `input_images`. Older model IDs retain the 3-image limit.
136
+ - xAI Imagine Image 2.0 and the redirected quality/pro slugs accept at most 5 `input_images`. Legacy 1.0 models retain the 3-image limit.
137
137
 
138
138
  ### Return modes
139
139
 
@@ -167,7 +167,10 @@ Use `file` for large images. Use `inline` or `both` only when the MCP client can
167
167
  | `size` | `auto`, `1024x1024`, `1536x1024`, or another supported `WIDTHxHEIGHT` | Provider default |
168
168
  | `quality` | `auto`, `low`, `medium`, `high`, `xhigh`, `max`, `standard`, `hd` (model-dependent) | Provider default |
169
169
  | `background` | `transparent`, `opaque`, `auto` | Provider default |
170
- | `output_format` | `png`, `jpeg`, `webp` | `png` |
170
+ | `output_format` | `png`, `jpeg`, `webp`, or 2.6 generation-only `svg` / `gif`. SVG requires `n: 1`. | `png` |
171
+ | `complexity` | `low`, `medium`, `high` on 2.6, independently of `quality` | Provider default |
172
+ | `frame_count` / `frame_duration_ms` | GIF only: 2–16 frames, 20–2000 ms per frame | Provider default |
173
+ | `markup` | Path to a transparent PNG overlay matching the first input image's dimensions after orientation, for GPT Image 2.5/2.6 edits | None |
171
174
  | `output_compression` | Integer `0`–`100`, GPT Image JPEG/WebP output only | Provider default |
172
175
  | `moderation` | `low`, `auto`, for GPT Image generation and editing (not sent to DALL-E) | Provider default |
173
176
  | `style` | `vivid`, `natural`; used with DALL-E 3 | Provider default |
@@ -179,7 +182,7 @@ Use `file` for large images. Use `inline` or `both` only when the MCP client can
179
182
  | `aspect_ratio` | For example `1:1`, `16:9`, `9:16`, `4:3`, or `3:2` | Provider default |
180
183
  | `image_size` | `512`, `0.5K`, `1K`, `2K`, `4K`; availability depends on the model | Provider default |
181
184
  | `output_format` | `png`, `jpeg` | Provider default |
182
- | `thinking_level` | `minimal`, `high`, for Gemini 3.1 Flash Image / Flash Lite Image | Provider default |
185
+ | `thinking_level` | `minimal`, `high`, plus `medium` on Nano Banana 2.1 | Provider default |
183
186
  | `previous_interaction_id` | `metadata.interactionId` from a previous Google result | None |
184
187
 
185
188
  `0.5K` is accepted as a legacy alias and normalized to `512`.
package/README.zh-TW.md CHANGED
@@ -27,15 +27,15 @@
27
27
 
28
28
  以上模型是範例與預設值,不是允許清單。可透過 `model` 參數傳入其他相容的模型 ID。
29
29
 
30
- ### 模型更新說明(2026-10-05 查核)
30
+ ### 模型更新說明(2026-11-05 查核)
31
31
 
32
- - OpenAI:預設使用偏重精準編輯的 Sunburst,日常生成可選 `gpt-image-2.5-flare`。若要維持先前模型,可明確指定 `gpt-image-2`。`xhigh`、`max` 需使用 GPT Image 2.5 或相容的新模型。[官方指南](https://developers.openai.com/api/docs/guides/image-generation)
33
- - Google:可選速度更快、成本較低的 `gemini-3.1-flash-lite-image`(Nano Banana 2 Lite),僅支援 `1K` 輸出。預設仍為 `gemini-3.1-flash-image`。[官方指南](https://ai.google.dev/gemini-api/docs/image-generation)
34
- - xAI:內建預設改為 Imagine Image 2.0。舊 `grok-imagine-image-quality` 預計於 2026 年 11 月 2 日轉向 2.0 的 `low` 品質。2.0 未指定 `quality` 時採供應商的 `auto`,目前生成使用 `low`、編輯使用 `medium`,費用隨實際品質而異。可明確指定品質,環境變數固定模型的行為仍保留。[遷移指南](https://docs.x.ai/developers/migration/imagine-image-quality-nov-2)
32
+ - OpenAI:指定 `gpt-image-2.6-sunburst` 或 `gpt-image-2.6-flare` 即可控制構圖複雜度、生成 SVG 或動態 GIF。例如在提示詞之外傳入 `model: "gpt-image-2.6-flare", output_format: "svg", n: 1`。預設仍為 2.5 Sunburst。[影像指南](https://developers.openai.com/api/docs/guides/image-generation)
33
+ - Google:新專案建議選用 `gemini-nano-banana-2.1`,可接續編輯、使用最多 14 張參考圖及中等思考等級。為相容舊設定,本工具仍預設使用 `gemini-3.1-flash-image`。Google 已將其列為棄用,但尚未公告停用日。[模型文件](https://aistudio.google.com/docs/models/gemini-nano-banana-2.1)
34
+ - xAI:自 11 月 2 日起,`grok-imagine-image-quality` 與 `grok-imagine-image-pro` 兩個別名由供應商轉向 Imagine Image 2.0 的低品質。若要自行選擇品質,請指定 `grok-imagine-image-2.0`。[遷移指南](https://docs.x.ai/developers/migration/imagine-image-quality-nov-2)
35
35
 
36
36
  模型存取權依供應商帳戶而定。無法使用時,不會自動改呼叫其他付費模型。
37
37
 
38
- 0.2.1 維持以上預設值及 Node.js 20 支援,修正 GPT Image 編輯時的 `moderation` 傳遞與 xAI 舊日期版模型的限制檢查,更新 MCP SDK 至 1.32.0 並修補兩項間接依賴漏洞。官方來源、暫緩項目及驗證範圍見[十月查核紀錄](https://github.com/JiaDians/image-router-mcp/blob/main/docs/provider-audits/2026-10-05.md)。
38
+ 升級不需修改原有設定。官方來源、限制及依賴選擇見[十一月查核紀錄](https://github.com/JiaDians/image-router-mcp/blob/main/docs/provider-audits/2026-11-05.md)。
39
39
 
40
40
  若固定使用舊 OpenAI 模型,請留意停用日期:`gpt-image-1` 為 2026 年 10 月 23 日,`gpt-image-1-mini`、`gpt-image-1.5`、`chatgpt-image-latest` 為 2026 年 12 月 1 日。本工具不會暗中替換指定模型。[官方棄用公告](https://developers.openai.com/api/docs/deprecations)
41
41
 
@@ -133,7 +133,7 @@ OPENAI_API_KEY = "your_openai_key"
133
133
  - 未傳入 `output_path` 時,圖片會儲存在 `DEFAULT_OUTPUT_DIR`,若未設定該變數,則使用 MCP server 工作目錄下的 `./generated-images`。
134
134
  - 建議輸入與輸出都使用絕對路徑,確保不同客戶端有一致結果。
135
135
  - 若要跨供應商使用本機圖片,建議採用 PNG、JPG/JPEG 或 WebP。Google 與 xAI 的載入器接受這些副檔名。
136
- - xAI Imagine Image 2.0 最多接受 5 張 `input_images`,舊模型維持 3 張限制。
136
+ - xAI Imagine Image 2.0 與已轉向的 quality/pro 別名最多接受 5 張 `input_images`,舊版 1.0 仍限 3 張。
137
137
 
138
138
  ### 回傳模式
139
139
 
@@ -167,7 +167,10 @@ OPENAI_API_KEY = "your_openai_key"
167
167
  | `size` | `auto`、`1024x1024`、`1536x1024` 或其他支援的 `WIDTHxHEIGHT` | 供應商預設值 |
168
168
  | `quality` | `auto`、`low`、`medium`、`high`、`xhigh`、`max`、`standard`、`hd`,依模型支援 | 供應商預設值 |
169
169
  | `background` | `transparent`、`opaque`、`auto` | 供應商預設值 |
170
- | `output_format` | `png`、`jpeg`、`webp` | `png` |
170
+ | `output_format` | `png`、`jpeg`、`webp`,或 2.6 僅供生成的 `svg`、`gif`。SVG 限 `n: 1`。 | `png` |
171
+ | `complexity` | 2.6 支援 `low`、`medium`、`high`,與 `quality` 分開控制 | 供應商預設值 |
172
+ | `frame_count`/`frame_duration_ms` | 僅限 GIF:2–16 幀,每幀 20–2000 毫秒 | 供應商預設值 |
173
+ | `markup` | 2.5/2.6 編輯用的透明 PNG 標註圖路徑,尺寸須符合第一張輸入圖校正方向後的尺寸 | 無 |
171
174
  | `output_compression` | 整數 `0`–`100`,僅供 GPT Image 的 JPEG/WebP 輸出使用 | 供應商預設值 |
172
175
  | `moderation` | `low`、`auto`,適用 GPT Image 生成與編輯,不傳給 DALL-E | 供應商預設值 |
173
176
  | `style` | `vivid`、`natural`,供 DALL-E 3 使用 | 供應商預設值 |
@@ -179,7 +182,7 @@ OPENAI_API_KEY = "your_openai_key"
179
182
  | `aspect_ratio` | 例如 `1:1`、`16:9`、`9:16`、`4:3` 或 `3:2` | 供應商預設值 |
180
183
  | `image_size` | `512`、`0.5K`、`1K`、`2K`、`4K`,實際可用值依模型而定 | 供應商預設值 |
181
184
  | `output_format` | `png`、`jpeg` | 供應商預設值 |
182
- | `thinking_level` | `minimal`、`high`,供 Gemini 3.1 Flash Image/Flash Lite Image 使用 | 供應商預設值 |
185
+ | `thinking_level` | `minimal`、`high`,Nano Banana 2.1 另支援 `medium` | 供應商預設值 |
183
186
  | `previous_interaction_id` | 前次 Google 結果的 `metadata.interactionId` | 無 |
184
187
 
185
188
  `0.5K` 是相容舊版的別名,送出前會正規化為 `512`。
package/dist/files.js CHANGED
@@ -9,6 +9,8 @@ const MIME_BY_EXT = {
9
9
  ".webp": "image/webp",
10
10
  };
11
11
  const EXT_BY_MIME = {
12
+ "image/svg+xml": ".svg",
13
+ "image/gif": ".gif",
12
14
  "image/png": ".png",
13
15
  "image/jpeg": ".jpg",
14
16
  "image/webp": ".webp",
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ export function createServer() {
35
35
  });
36
36
  server.registerTool("openai_generate_image", {
37
37
  title: "OpenAI image generation and editing",
38
- description: "Generate or edit images with OpenAI GPT Image 2.5 Sunburst and Flare, including xhigh/max quality, JPEG/WebP compression and optional moderation on both endpoints. Compatible model IDs remain flexible.",
38
+ description: "Generate or edit GPT Images. Select gpt-image-2.6-sunburst or gpt-image-2.6-flare for complexity control and SVG/GIF generation. Use a local PNG markup overlay for GPT Image 2.5/2.6 edits. The default remains 2.5 Sunburst.",
39
39
  inputSchema: openAIInputShape,
40
40
  }, async (rawParams) => {
41
41
  try {
@@ -49,7 +49,7 @@ export function createServer() {
49
49
  });
50
50
  server.registerTool("google_generate_image", {
51
51
  title: "Google Gemini/Nano Banana image generation and editing",
52
- description: "Generate or edit images with Google Gemini image models, including Nano Banana 2, Nano Banana 2 Lite, and Nano Banana Pro. Continue edits with previous_interaction_id and choose PNG/JPEG output.",
52
+ description: "Generate or edit Gemini images. Select gemini-nano-banana-2.1 for up to 14 references and optional medium thinking. Continue edits with previous_interaction_id and choose PNG/JPEG output.",
53
53
  inputSchema: googleInputShape,
54
54
  }, async (rawParams) => {
55
55
  try {
@@ -13,6 +13,12 @@ export function setGoogleClientForTests(client) {
13
13
  }
14
14
  export async function generateGoogleImage(params, client = getGoogleClient()) {
15
15
  const model = process.env.DEFAULT_GOOGLE_IMAGE_MODEL ?? params.model;
16
+ if (params.thinking_level === "medium" && /^gemini-3\.1-flash(?:-lite)?-image(?:-|$)/.test(model)) {
17
+ throw new UserInputError("Use gemini-nano-banana-2.1 for medium thinking, or choose minimal/high on Flash Image.");
18
+ }
19
+ if (/^gemini-nano-banana-2\.1(?:-|$)/.test(model) && (params.input_images?.length ?? 0) > 14) {
20
+ throw new UserInputError("Nano Banana 2.1 supports up to 14 reference images.");
21
+ }
16
22
  if (/^gemini-3\.1-flash-lite-image(?:-|$)/.test(model) && params.image_size && params.image_size !== "1K") {
17
23
  throw new UserInputError("Gemini 3.1 Flash Lite Image supports only image_size 1K.");
18
24
  }
@@ -34,11 +34,26 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
34
34
  const outputFormat = params.output_format ?? "png";
35
35
  const inputImages = params.input_images ?? [];
36
36
  const dallEModel = isDallEModel(model);
37
- if (params.output_compression !== undefined && (dallEModel || outputFormat === "png")) {
37
+ const generationOnly = outputFormat === "svg" || outputFormat === "gif";
38
+ const pre25 = dallEModel || /^gpt-image-(?:1(?:[.-]|$)|2(?:-|$))/.test(model);
39
+ if ((generationOnly || params.complexity) && (pre25 || /^gpt-image-2\.5(?:-|$)/.test(model))) {
40
+ throw new UserInputError("SVG, GIF and complexity require GPT Image 2.6 or a compatible newer model.");
41
+ }
42
+ if (generationOnly && inputImages.length)
43
+ throw new UserInputError("SVG and GIF output are for generation, not edits.");
44
+ if (outputFormat === "svg" && (params.n ?? 1) !== 1)
45
+ throw new UserInputError("SVG output requires n=1.");
46
+ if (outputFormat !== "gif" && (params.frame_count !== undefined || params.frame_duration_ms !== undefined)) {
47
+ throw new UserInputError("Animation frame options require GIF output.");
48
+ }
49
+ if (params.markup && (pre25 || !inputImages.length || !/\.png$/i.test(params.markup))) {
50
+ throw new UserInputError("Markup requires a GPT Image 2.5 or newer edit with an input image and a transparent PNG overlay.");
51
+ }
52
+ if (params.output_compression !== undefined && (dallEModel || !["jpeg", "webp"].includes(outputFormat))) {
38
53
  throw new UserInputError("output_compression requires a GPT Image model with output_format jpeg or webp.");
39
54
  }
40
55
  if ((params.quality === "xhigh" || params.quality === "max") &&
41
- (dallEModel || /^gpt-image-(?:1(?:[.-]|$)|2(?:-|$))/.test(model))) {
56
+ pre25) {
42
57
  throw new UserInputError("Quality xhigh and max require GPT Image 2.5 or a compatible newer model.");
43
58
  }
44
59
  // SDK 6 keeps Node.js 20 support. It forwards the API's new quality values unchanged,
@@ -54,7 +69,9 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
54
69
  ? { response_format: "b64_json" }
55
70
  : {
56
71
  background: params.background,
72
+ // SDK 6 serializes these newer formats but types only the raster subset.
57
73
  output_format: outputFormat,
74
+ complexity: params.complexity,
58
75
  output_compression: params.output_compression,
59
76
  moderation: params.moderation,
60
77
  }),
@@ -66,6 +83,7 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
66
83
  }
67
84
  return client.images.edit({
68
85
  ...common,
86
+ ...(params.markup && { markup: createReadStream(params.markup) }),
69
87
  quality: quality,
70
88
  image: inputImages.length === 1
71
89
  ? createReadStream(inputImages[0])
@@ -75,13 +93,14 @@ export async function generateOpenAIImage(params, client = getOpenAIClient()) {
75
93
  : await client.images.generate({
76
94
  ...common,
77
95
  quality,
96
+ ...(outputFormat === "gif" && { frame_count: params.frame_count, frame_duration_ms: params.frame_duration_ms }),
78
97
  ...(dallEModel ? { style: params.style } : {}),
79
98
  });
80
99
  const data = "data" in response ? response.data ?? [] : [];
81
100
  if (data.length === 0) {
82
101
  throw new Error("OpenAI response did not include generated images.");
83
102
  }
84
- const mimeType = `image/${outputFormat === "jpeg" ? "jpeg" : outputFormat}`;
103
+ const mimeType = outputFormat === "svg" ? "image/svg+xml" : `image/${outputFormat}`;
85
104
  return {
86
105
  provider: "openai",
87
106
  model,
@@ -18,7 +18,8 @@ async function imageFromXAIItem(item) {
18
18
  export async function generateXAIImage(params, fetchImpl = fetch) {
19
19
  const model = process.env.DEFAULT_XAI_IMAGE_MODEL ?? params.model;
20
20
  const legacyModel = /^grok-imagine-image(?:-quality|-pro)?(?:-latest|-\d{8}|-\d{4}-\d{2}-\d{2})?$/.test(model);
21
- if (legacyModel && (params.input_images?.length ?? 0) > 3) {
21
+ const redirectedToLow = model === "grok-imagine-image-quality" || model === "grok-imagine-image-pro";
22
+ if (legacyModel && !redirectedToLow && (params.input_images?.length ?? 0) > 3) {
22
23
  throw new UserInputError("This older xAI model supports up to 3 input images. Use grok-imagine-image-2.0 for up to 5.");
23
24
  }
24
25
  if (legacyModel && params.quality !== undefined) {
package/dist/schemas.d.ts CHANGED
@@ -27,7 +27,17 @@ export declare const openAIInputShape: {
27
27
  png: "png";
28
28
  jpeg: "jpeg";
29
29
  webp: "webp";
30
+ svg: "svg";
31
+ gif: "gif";
30
32
  }>>;
33
+ readonly complexity: z.ZodOptional<z.ZodEnum<{
34
+ low: "low";
35
+ medium: "medium";
36
+ high: "high";
37
+ }>>;
38
+ readonly frame_count: z.ZodOptional<z.ZodNumber>;
39
+ readonly frame_duration_ms: z.ZodOptional<z.ZodNumber>;
40
+ readonly markup: z.ZodOptional<z.ZodString>;
31
41
  readonly output_compression: z.ZodOptional<z.ZodNumber>;
32
42
  readonly moderation: z.ZodOptional<z.ZodEnum<{
33
43
  auto: "auto";
@@ -57,6 +67,7 @@ export declare const googleInputShape: {
57
67
  }>>;
58
68
  readonly previous_interaction_id: z.ZodOptional<z.ZodString>;
59
69
  readonly thinking_level: z.ZodOptional<z.ZodEnum<{
70
+ medium: "medium";
60
71
  high: "high";
61
72
  minimal: "minimal";
62
73
  }>>;
@@ -126,7 +137,17 @@ export declare const openAIParamsSchema: z.ZodObject<{
126
137
  png: "png";
127
138
  jpeg: "jpeg";
128
139
  webp: "webp";
140
+ svg: "svg";
141
+ gif: "gif";
129
142
  }>>;
143
+ complexity: z.ZodOptional<z.ZodEnum<{
144
+ low: "low";
145
+ medium: "medium";
146
+ high: "high";
147
+ }>>;
148
+ frame_count: z.ZodOptional<z.ZodNumber>;
149
+ frame_duration_ms: z.ZodOptional<z.ZodNumber>;
150
+ markup: z.ZodOptional<z.ZodString>;
130
151
  output_compression: z.ZodOptional<z.ZodNumber>;
131
152
  moderation: z.ZodOptional<z.ZodEnum<{
132
153
  auto: "auto";
@@ -156,6 +177,7 @@ export declare const googleParamsSchema: z.ZodObject<{
156
177
  }>>;
157
178
  previous_interaction_id: z.ZodOptional<z.ZodString>;
158
179
  thinking_level: z.ZodOptional<z.ZodEnum<{
180
+ medium: "medium";
159
181
  high: "high";
160
182
  minimal: "minimal";
161
183
  }>>;
package/dist/schemas.js CHANGED
@@ -27,7 +27,11 @@ export const openAIInputShape = {
27
27
  size: nonEmptyString.optional().describe("OpenAI size, such as auto, 1024x1024, 1536x1024, or any supported WIDTHxHEIGHT."),
28
28
  quality: z.enum(["auto", "low", "medium", "high", "xhigh", "max", "standard", "hd"]).optional().describe("OpenAI quality. xhigh and max require GPT Image 2.5 or a compatible newer model. Higher quality can increase cost and latency."),
29
29
  background: z.enum(["transparent", "opaque", "auto"]).optional().describe("OpenAI background option."),
30
- output_format: z.enum(["png", "jpeg", "webp"]).default("png").describe("Output image format."),
30
+ output_format: z.enum(["png", "jpeg", "webp", "svg", "gif"]).default("png").describe("SVG and animated GIF are generation-only on GPT Image 2.6. SVG requires n=1."),
31
+ complexity: z.enum(["low", "medium", "high"]).optional().describe("GPT Image 2.6 planning complexity, independent of rendering quality."),
32
+ frame_count: z.number().int().min(2).max(16).optional().describe("GIF generation only. 2–16 frames (portable range across the guide and API reference)."),
33
+ frame_duration_ms: z.number().int().min(20).max(2000).optional().describe("GIF generation only. Frame delay in milliseconds, rounded by the provider to 10 ms."),
34
+ markup: nonEmptyString.optional().describe("Local transparent PNG annotation overlay for a GPT Image 2.5/2.6 edit. Match the first input image's oriented dimensions."),
31
35
  output_compression: z.number().int().min(0).max(100).optional().describe("Output compression from 0 to 100 for JPEG or WebP GPT Image output."),
32
36
  moderation: z.enum(["low", "auto"]).optional().describe("Moderation for GPT Image generation and editing. Omit to use the provider default. Not sent to DALL-E models."),
33
37
  style: z.enum(["vivid", "natural"]).optional().describe("DALL-E 3 style option."),
@@ -37,7 +41,7 @@ export const googleInputShape = {
37
41
  model: nonEmptyString.default("gemini-3.1-flash-image").describe("Google image model ID. Defaults to Nano Banana 2."),
38
42
  output_format: z.enum(["png", "jpeg"]).optional().describe("Requested Google image output format. Omit to use the provider default."),
39
43
  previous_interaction_id: nonEmptyString.optional().describe("Continue a Google image editing conversation using metadata.interactionId from a previous result. Requires that interaction to remain available in the same provider account."),
40
- thinking_level: z.enum(["minimal", "high"]).optional().describe("Thinking level for Gemini 3.1 Flash Image and Flash Lite Image. Higher thinking can increase cost and latency."),
44
+ thinking_level: z.enum(["minimal", "medium", "high"]).optional().describe("Nano Banana 2.1 supports minimal, medium and high. Older Flash Image and Lite accept minimal or high."),
41
45
  aspect_ratio: nonEmptyString.optional().describe("Aspect ratio, for example 1:1, 16:9, 9:16, 4:3, or 3:2."),
42
46
  image_size: z
43
47
  .enum(["512", "0.5K", "1K", "2K", "4K"])
@@ -46,7 +50,7 @@ export const googleInputShape = {
46
50
  };
47
51
  export const xaiInputShape = {
48
52
  ...commonImageShape,
49
- input_images: z.array(nonEmptyString).max(5).optional().describe("Local image paths used as edit/reference inputs. Imagine Image 2.0 supports up to 5 input images, older models up to 3."),
53
+ input_images: z.array(nonEmptyString).max(5).optional().describe("Up to 5 local references for Imagine Image 2.0 and its redirected quality/pro slugs. Up to 3 for legacy 1.0."),
50
54
  model: nonEmptyString.default("grok-imagine-image-2.0").describe("xAI/Grok image model ID. Defaults to Imagine Image 2.0."),
51
55
  quality: z.enum(["low", "medium", "auto"]).optional().describe("Imagine Image 2.0 quality. Provider auto currently uses low for generation and medium for editing, with different costs. Set low or medium to pin quality."),
52
56
  aspect_ratio: nonEmptyString.optional().describe("Aspect ratio, for example 1:1, 16:9, 9:16, 3:2, or auto."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "image-router-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "MCP server for routing image generation and editing across xAI, Google Gemini/Nano Banana, and OpenAI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,15 +38,15 @@
38
38
  "license": "MIT",
39
39
  "dependencies": {
40
40
  "@google/genai": "2.21.0",
41
- "@modelcontextprotocol/sdk": "1.32.0",
41
+ "@modelcontextprotocol/sdk": "1.32.2",
42
42
  "openai": "6.49.0",
43
- "zod": "4.4.3"
43
+ "zod": "4.6.7"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "25.9.1",
47
47
  "tsx": "4.23.1",
48
48
  "typescript": "6.0.3",
49
- "vitest": "4.1.11"
49
+ "vitest": "4.1.12"
50
50
  },
51
51
  "repository": {
52
52
  "type": "git",