@chrischall/gemini-mcp 2.1.4 → 2.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 +28 -1
- package/dist/bundle.js +723 -122
- package/dist/client.js +32 -3
- package/dist/images.js +20 -4
- package/dist/tools/_confirm.js +52 -28
- package/dist/tools/files.js +34 -13
- package/dist/tools/generate.js +18 -8
- package/dist/tools/interact.js +11 -5
- package/dist/tools/library.js +29 -9
- package/dist/tools/music.js +9 -4
- package/dist/tools/set.js +10 -5
- package/dist/tools/video.js +9 -4
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/server.json +9 -2
- package/skills/gemini-mcp/SKILL.md +3 -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": "2.
|
|
10
|
+
"version": "2.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": "2.
|
|
18
|
+
"version": "2.3.0",
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Chris Hall"
|
|
21
21
|
},
|
package/README.md
CHANGED
|
@@ -16,10 +16,28 @@ Developed and maintained by AI (Claude Code).
|
|
|
16
16
|
| `GEMINI_IMAGE_MODEL` | No | Override the default image model (default: `gemini-3.1-flash-image`) |
|
|
17
17
|
| `GEMINI_OUTPUT_DIR` | No | Default directory for generated images (default: current working directory) |
|
|
18
18
|
| `GEMINI_INPUT_DIR` | No | Directory to resolve bare input-image filenames against (so `images: ["foo.jpg"]` works) |
|
|
19
|
+
| `GEMINI_UPLOAD_DIR` | No | Restrict local files streamed to the Gemini Files API (`gemini_upload_file` `path`, `video_path`) to these directories — one or more, separated by `:` (`;` on Windows); `~` allowed. A path outside is refused before any upload. Unset: no restriction |
|
|
19
20
|
| `GEMINI_TIMEOUT_MS` | No | Upstream request timeout in ms (default: `60000`, or `120000` for `image_size: "4K"`); each generation tool also takes a per-call `timeout_ms` |
|
|
20
21
|
| `GEMINI_HEARTBEAT_MS` | No | Progress-notification cadence in ms while a generation runs (default: `10000`; `0` disables) — keeps MCP hosts that reset their timeout on progress from timing out long generations |
|
|
21
22
|
| `GEMINI_CHAIN_RETRY_MS` | No | How long to wait out interactions-store lag when a chained call 404s (default: `120000`; `0` disables retrying) |
|
|
22
23
|
|
|
24
|
+
### Confirmations
|
|
25
|
+
|
|
26
|
+
Sending a **local file** to Google (the `images` / `master_images` / `video_path` inputs, or
|
|
27
|
+
`gemini_upload_file`'s `path`) and every **delete** ask for confirmation first. A client that can
|
|
28
|
+
show a confirmation prompt (Claude Code) gets the real prompt. Elsewhere the first call does
|
|
29
|
+
nothing and returns a preview (the resolved local paths with their MIME types and sizes, or the
|
|
30
|
+
method/path being deleted) plus a `confirmToken`; only a repeat call with the same arguments and
|
|
31
|
+
that token proceeds. The token is single-use, expires, and is bound to the exact arguments — a
|
|
32
|
+
changed prompt or a swapped file between the two calls is refused. Pure text prompts, URLs,
|
|
33
|
+
`files/` references and base64 inputs are not gated.
|
|
34
|
+
|
|
35
|
+
| variable | default | |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `MCP_CONFIRM_MODE` | `ask-user` | What a write does on a client that cannot show a confirmation prompt (claude.ai, Claude Desktop). `ask-user`: two steps — the first call does nothing and returns a preview plus a token, and the model must get your approval in chat before calling again with it. `auto`: the same two steps, but the model may use the token after reviewing the preview itself. `refuse`: writes are refused on such clients. A client that can show prompts (Claude Code) always gets the real prompt. An unrecognised value is treated as `refuse`. |
|
|
38
|
+
| `MCP_CONFIRM_TTL_SECONDS` | `600` | How long a token stays valid. |
|
|
39
|
+
| `MCP_CONFIRM_SECRET` | random per process | Signing key; set it only if tokens must survive a server restart. |
|
|
40
|
+
|
|
23
41
|
### Long generations and client timeouts
|
|
24
42
|
|
|
25
43
|
4K / Pro-model generations can outrun an MCP host's own `tools/call` timeout (error `-32001`).
|
|
@@ -86,7 +104,7 @@ progress), two guards make re-issuing safe and unnecessary:
|
|
|
86
104
|
| `gemini_token_usage` | Token usage and an estimated USD cost for this session so far. Call it before and after a workflow and subtract to attribute that workflow's spend. Priced per call against each call's own model from a dated rate card (`GEMINI_RATE_CARD` overrides it); there is no account-balance endpoint to read, so this is how spend is attributed |
|
|
87
105
|
| `gemini_upload_file` | Upload an image (or video/audio) to the Gemini Files API once — from a `url`, `data_base64`, or a local `path` — and get a reusable `files/<id>` reference |
|
|
88
106
|
| `gemini_list_files` | List the files currently uploaded under this API key, with MIME types and expiry times |
|
|
89
|
-
| `gemini_delete_file` | Delete an uploaded file before its ~48h expiry (
|
|
107
|
+
| `gemini_delete_file` | Delete an uploaded file before its ~48h expiry (confirmed first — see [Confirmations](#confirmations)) |
|
|
90
108
|
| `gemini_sign_media` | *(hosted deployments only)* Mint a fresh signed URL for generated media from its `r2_key` — an expired link is not a dead end |
|
|
91
109
|
| `gemini_view_media` | *(hosted deployments only)* Return a generated image as an inline image block from its `r2_key`, so a model can actually see what it made before refining it |
|
|
92
110
|
| `gemini_get_upload_url` | *(hosted deployments only)* Mint a short-lived signed PUT URL so a shell can upload a reference image with no auth header; the PUT returns an `r2_key` usable in `images_r2_keys`, `gemini_save_character`, or `gemini_upload_file` |
|
|
@@ -172,6 +190,15 @@ safe form, and a markdown link is a reasonable enhancement where you know it ren
|
|
|
172
190
|
Signed-URL lifetime is clamped to `MEDIA_TTL_DAYS`, so a link never outlives the object it
|
|
173
191
|
points at.
|
|
174
192
|
|
|
193
|
+
**Prompts are stored too.** Each generated object on a hosted deployment gets a small JSON
|
|
194
|
+
record beside it holding the prompt (first 500 characters), model and interaction id — that is
|
|
195
|
+
what `gemini_list_recent_media` shows and what lets a lost turn be recovered. The record lives
|
|
196
|
+
and is swept with its object, so it is kept for the same `MEDIA_TTL_DAYS` window, not longer.
|
|
197
|
+
Locally, `gemini_interact` writes an `<image>.json` sidecar (model, interaction id, options and
|
|
198
|
+
any text the model replied with — not the prompt itself) next to each image in the output dir;
|
|
199
|
+
those files are yours to keep or delete and never expire on their own. If your
|
|
200
|
+
prompts describe real people, bear in mind they sit in your bucket for the retention window.
|
|
201
|
+
|
|
175
202
|
## Sending reference images without burning context
|
|
176
203
|
|
|
177
204
|
Every tool that takes a reference image — `gemini_image_generate`, `gemini_image_edit`,
|