@chrischall/gemini-mcp 0.2.0 → 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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -0
- package/SKILL.md +43 -10
- package/dist/bundle.js +293 -50
- package/dist/client.js +124 -7
- package/dist/images.js +63 -6
- package/dist/index.js +2 -1
- package/dist/tools/generate.js +60 -10
- package/dist/tools/interact.js +89 -0
- package/dist/tools/set.js +30 -10
- package/dist/tools/shared.js +33 -8
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "MCP server for Google Gemini image generation and editing — generate and edit images via the Gemini API",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.3.0"
|
|
11
11
|
},
|
|
12
12
|
"plugins": [
|
|
13
13
|
{
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"displayName": "Gemini Images",
|
|
16
16
|
"source": "./",
|
|
17
17
|
"description": "Generate and edit images with Google Gemini image models (Nano Banana / Nano Banana Pro) via natural language prompts",
|
|
18
|
-
"version": "0.
|
|
18
|
+
"version": "0.3.0",
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Chris Hall"
|
|
21
21
|
},
|
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@ Developed and maintained by AI (Claude Code).
|
|
|
20
20
|
| `gemini_generate_image` | Generate image(s) from a text prompt |
|
|
21
21
|
| `gemini_edit_image` | Edit or compose one or more input images with a text instruction |
|
|
22
22
|
| `gemini_generate_set` | Generate a master image plus N consistent images referencing it |
|
|
23
|
+
| `gemini_interact` | Multi-turn generation/editing via the Interactions API (Beta); returns an `interaction_id` to refine the same image conversationally |
|
|
23
24
|
|
|
24
25
|
## Quick Start
|
|
25
26
|
|
package/SKILL.md
CHANGED
|
@@ -82,9 +82,14 @@ Note: Image generation requires a billing-enabled Google Cloud project.
|
|
|
82
82
|
### Image Generation
|
|
83
83
|
| Tool | Description |
|
|
84
84
|
|------|-------------|
|
|
85
|
-
| `gemini_generate_image(prompt, count?, model?, aspect_ratio?, image_size?, output_dir?, inline?)` | Generate image(s) from a text prompt |
|
|
86
|
-
| `gemini_edit_image(prompt, images
|
|
87
|
-
| `gemini_generate_set(master_prompt, scenes? \| count?, reference_mode?, model?, ...)` |
|
|
85
|
+
| `gemini_generate_image(prompt, count?, images?, images_base64?, video_url?, google_search?, seed?, filename?, model?, aspect_ratio?, image_size?, thinking_level?, output_dir?, inline?)` | Generate image(s) from a text prompt (optionally image-conditioned via `images`/`images_base64`, or video-conditioned via `video_url`) |
|
|
86
|
+
| `gemini_edit_image(prompt, images?, images_base64?, google_search?, seed?, filename?, model?, aspect_ratio?, image_size?, thinking_level?, output_dir?, inline?)` | Edit or compose input image(s) — by **path** (`images`) or **value** (`images_base64`: data URI or raw base64) — with a text instruction. Requires ≥1 input |
|
|
87
|
+
| `gemini_generate_set(master_prompt, scenes? \| count?, reference_mode?, master_images?, master_images_base64?, google_search?, seed?, basename?, model?, thinking_level?, ...)` | Master image (optionally seeded from a reference photo) plus N consistent images referencing it |
|
|
88
|
+
|
|
89
|
+
### Multi-turn (Interactions API — Beta)
|
|
90
|
+
| Tool | Description |
|
|
91
|
+
|------|-------------|
|
|
92
|
+
| `gemini_interact(input, previous_interaction_id?, images?, images_base64?, video_url?, google_search?, model?, aspect_ratio?, image_size?, thinking_level?, filename?, output_dir?, inline?)` | Generate/edit via Gemini's **Interactions API**. Returns an `interaction_id`; pass it back as `previous_interaction_id` to **iteratively refine the same image** conversationally — the recommended way to make incremental edits. Output is **JPEG**. (Beta API.) |
|
|
88
93
|
|
|
89
94
|
## Workflows
|
|
90
95
|
|
|
@@ -124,12 +129,40 @@ gemini_generate_set(
|
|
|
124
129
|
→ returns master + 5 variations
|
|
125
130
|
```
|
|
126
131
|
|
|
132
|
+
**Use a reference photo by value (no file needed):**
|
|
133
|
+
```
|
|
134
|
+
gemini_edit_image(
|
|
135
|
+
prompt: "place this house on a vintage travel-poster background",
|
|
136
|
+
images_base64: ["data:image/jpeg;base64,/9j/4AAQ..."] // or raw base64
|
|
137
|
+
)
|
|
138
|
+
→ returns path to the edited image
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Iterate on ONE image conversationally (multi-turn):**
|
|
142
|
+
```
|
|
143
|
+
r1 = gemini_interact(input: "a cozy reading nook, watercolor")
|
|
144
|
+
→ { images: [...], interaction_id: "v1_abc…" }
|
|
145
|
+
r2 = gemini_interact(input: "add a sleeping cat on the chair",
|
|
146
|
+
previous_interaction_id: r1.interaction_id)
|
|
147
|
+
→ refined image that preserves r1; returns a NEW interaction_id
|
|
148
|
+
```
|
|
149
|
+
Prefer this over re-running `gemini_edit_image` when you're making a *series* of incremental edits — the model keeps the prior result in context.
|
|
150
|
+
Pasted/attached images aren't written to disk by the host, so pass their bytes via `images_base64` (a `data:` URI or raw base64) instead of a path.
|
|
151
|
+
|
|
127
152
|
## Notes
|
|
128
153
|
|
|
129
|
-
- `
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
154
|
+
- **Input images** accept either file **paths** (`images` / `master_images`) or **base64/data-URI values** (`images_base64` / `master_images_base64`).
|
|
155
|
+
- **`seed`** makes a result reproducible; it's echoed in the result metadata (a random one is chosen + echoed when omitted). `count>1` uses `seed, seed+1, …` so the images differ. Determinism isn't fully guaranteed by the model.
|
|
156
|
+
- **`filename`/`basename`** set the output name (extension stripped); names never overwrite (a `-2`, `-3` suffix is added). The result echoes the absolute path(s), `model`, `seed`, and aspect/size.
|
|
157
|
+
- **No edit-strength control.** Gemini exposes no denoise/strength knob, and Nano Banana over-preserves the input — big structural edits ("move/remove/shrink", add a mat border) are often ignored. Workarounds: reroll with a different `seed`, raise `thinking_level` to `high`, use forceful wording, do layout changes (padding/borders) externally, or use `gemini_interact` multi-turn.
|
|
158
|
+
- **`thinking_level`** (`minimal`/`high`, Gemini 3 models) controls reasoning depth — `high` can improve complex compositions/edits at higher latency/cost.
|
|
159
|
+
- **Model text.** When the model returns a caption/explanation (mostly Gemini 3 **Pro**), it's surfaced as `text` in the result metadata.
|
|
160
|
+
- **`google_search: true`** grounds the image in live Google Search (current events, weather, real data — great for infographics). The result metadata includes `grounding` with the `queries` run and the `sources` (`{uri, title}`) used. (`gemini_interact` surfaces `grounding.queries` only — the Interactions API returns no clean source list.)
|
|
161
|
+
- **`video_url`** (a public YouTube URL, on `gemini_generate_image` / `gemini_interact`) generates an image from a video reference — **requires a Flash model** (e.g. `model: "gemini-3.1-flash-image"`). Non-YouTube video (Files API upload) is not supported.
|
|
162
|
+
- **`gemini_interact`** is the multi-turn path: it returns an `interaction_id`; thread it back via `previous_interaction_id` for conversational refinement. Output is **JPEG only**. It's a **Beta** API (separate from the stable `generate`/`edit`/`set` tools).
|
|
163
|
+
- `output_dir` per-call overrides `$GEMINI_OUTPUT_DIR` overrides cwd. `inline: true` returns bytes (with a metadata text block) instead of writing.
|
|
164
|
+
- `count` and `scenes` are mutually exclusive in `gemini_generate_set`; `reference_mode: "chain"` references the previous image instead of the master.
|
|
165
|
+
- Aspect ratios: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `2:3`, `3:2`, … · Image sizes: `512` (0.5K, Flash only), `1K`, `2K`, `4K`. `4K` is the max native output — true 18×24 in @ 300 DPI (5400×7200) needs an external upscale step.
|
|
166
|
+
- All generated images carry a **SynthID** watermark (Google).
|
|
167
|
+
- The model can mis-render text/Roman numerals (e.g. years) — verify any text in the output; it's a model limitation, not a tool setting.
|
|
168
|
+
- Server logs to stderr only — stdout is reserved for JSON-RPC.
|