@chrischall/gemini-mcp 2.4.0 → 2.4.1
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/.mcp.json +5 -2
- package/README.md +19 -16
- package/dist/bundle.js +31772 -303
- package/dist/client.js +12 -3
- package/dist/fetch-image.js +70 -138
- package/dist/images.js +16 -23
- package/dist/media-url.js +4 -59
- package/dist/storage/media.js +3 -15
- package/dist/tools/_confirm.js +13 -33
- package/dist/tools/files.js +8 -8
- package/dist/tools/library.js +6 -6
- package/dist/tools/shared.js +1 -1
- package/dist/tools/uploads.js +1 -1
- package/dist/version.js +1 -1
- package/mint.yaml +18 -2
- package/package.json +4 -3
- package/server.json +3 -3
- package/skills/gemini-mcp/SKILL.md +34 -16
package/mint.yaml
CHANGED
|
@@ -17,12 +17,24 @@ env:
|
|
|
17
17
|
- name: GEMINI_OUTPUT_DIR
|
|
18
18
|
required: false
|
|
19
19
|
help: >-
|
|
20
|
-
Default directory for generated images (default:
|
|
21
|
-
|
|
20
|
+
Default directory for generated images (default: ~/Downloads/gemini-mcp,
|
|
21
|
+
not the cwd). When set, a per-call output_dir must be inside it.
|
|
22
22
|
- name: GEMINI_INPUT_DIR
|
|
23
23
|
required: false
|
|
24
24
|
help: >-
|
|
25
25
|
Directory to resolve bare input-image filenames against
|
|
26
|
+
- name: GEMINI_UPLOAD_DIR
|
|
27
|
+
required: false
|
|
28
|
+
help: >-
|
|
29
|
+
Directories (path.delimiter-separated) that local files uploaded to the
|
|
30
|
+
Gemini Files API must come from. Mostly a local-install knob: on a hosted
|
|
31
|
+
server, uploads come from gemini_get_upload_url instead.
|
|
32
|
+
- name: GEMINI_REFERENCE_DIR
|
|
33
|
+
required: false
|
|
34
|
+
help: >-
|
|
35
|
+
Directories (path.delimiter-separated) that local reference images must
|
|
36
|
+
come from (else GEMINI_UPLOAD_DIR). Unset on a hosted server, only
|
|
37
|
+
$MCP_DATA_DIR/uploads is allowed, so leave it unset there.
|
|
26
38
|
- name: GEMINI_TIMEOUT_MS
|
|
27
39
|
required: false
|
|
28
40
|
help: >-
|
|
@@ -38,6 +50,10 @@ env:
|
|
|
38
50
|
How often, in milliseconds, to emit a progress notification while a
|
|
39
51
|
generation is in flight. Hosts reset their tools/call timeout on progress,
|
|
40
52
|
so this lets a long 4K/Pro generation outlive the default budget.
|
|
53
|
+
- name: GEMINI_DEBUG
|
|
54
|
+
required: false
|
|
55
|
+
help: >-
|
|
56
|
+
When set, emit heartbeat diagnostics to stderr. Off by default.
|
|
41
57
|
- name: GEMINI_RATE_CARD
|
|
42
58
|
required: false
|
|
43
59
|
help: >-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrischall/gemini-mcp",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"mcpName": "io.github.chrischall/gemini-mcp",
|
|
5
5
|
"description": "Gemini image-generation MCP server for Claude — developed and maintained by AI (Claude Code)",
|
|
6
6
|
"author": "Claude Code (AI) <https://www.anthropic.com/claude>",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsc && npm run bundle",
|
|
41
|
-
"bundle": "esbuild src/index.ts --bundle --alias:zod/v4=./node_modules/zod/v4/index.cjs --platform=node --format=esm --external:dotenv --outfile=dist/bundle.js",
|
|
41
|
+
"bundle": "esbuild src/index.ts --bundle --alias:zod/v4=./node_modules/zod/v4/index.cjs --platform=node --format=esm --external:dotenv --banner:js=\"import { createRequire as __createRequire } from 'module'; import { fileURLToPath as __fileURLToPath } from 'url'; import { dirname as __pathDirname } from 'path'; const require = __createRequire(import.meta.url); const __filename = __fileURLToPath(import.meta.url); const __dirname = __pathDirname(__filename);\" --outfile=dist/bundle.js",
|
|
42
42
|
"dev": "node dist/index.js",
|
|
43
43
|
"test": "npm run typecheck && vitest run",
|
|
44
44
|
"test:watch": "vitest",
|
|
@@ -46,9 +46,10 @@
|
|
|
46
46
|
"typecheck": "tsc -p tsconfig.test.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@chrischall/mcp-utils": "^3.0.
|
|
49
|
+
"@chrischall/mcp-utils": "^3.0.3",
|
|
50
50
|
"@modelcontextprotocol/server": "^2.3.0",
|
|
51
51
|
"dotenv": "^18.0.2",
|
|
52
|
+
"undici": "^8.12.2",
|
|
52
53
|
"zod": "^4.6.5"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/chrischall/gemini-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.4.
|
|
9
|
+
"version": "2.4.1",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@chrischall/gemini-mcp",
|
|
14
|
-
"version": "2.4.
|
|
14
|
+
"version": "2.4.1",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"name": "GEMINI_OUTPUT_DIR",
|
|
35
|
-
"description": "Default directory for generated images (default:
|
|
35
|
+
"description": "Default directory for generated images (default: ~/Downloads/gemini-mcp). When set, a per-call output_dir must be inside it.",
|
|
36
36
|
"isRequired": false,
|
|
37
37
|
"format": "string",
|
|
38
38
|
"isSecret": false
|
|
@@ -96,7 +96,7 @@ Note: Image generation requires a billing-enabled Google Cloud project.
|
|
|
96
96
|
| `gemini_image_edit(prompt, images_url?, images_file_uris?, images?, images_base64?, google_search?, seed?, filename?, model?, aspect_ratio?, image_size?, thinking_level?, output_dir?, inline?)` | Edit or compose input image(s) with a text instruction. Requires ≥1 input from any of the four reference forms |
|
|
97
97
|
| `gemini_image_set(master_prompt, scenes? \| count?, reference_mode?, master_images_url?, master_images_file_uris?, 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. `master_images_url` / `master_images_file_uris` are resolved **once** and passed to the master *and* every scene |
|
|
98
98
|
|
|
99
|
-
### Reference images —
|
|
99
|
+
### Reference images — several ways in, one that costs context
|
|
100
100
|
|
|
101
101
|
These apply to **every** tool that takes a reference image: the four image tools, plus
|
|
102
102
|
`gemini_video_generate` (reference stills) and `gemini_music_generate`.
|
|
@@ -105,7 +105,9 @@ These apply to **every** tool that takes a reference image: the four image tools
|
|
|
105
105
|
|---|---|---|
|
|
106
106
|
| `images_url` (`master_images_url`) | the **server** downloads the https URL | none |
|
|
107
107
|
| `images_file_uris` (`master_images_file_uris`) | a `files/<id>` reference from `gemini_upload_file` | none |
|
|
108
|
+
| `images_r2_keys` (`master_images_r2_keys`) | the server reads its **own store** — an `r2_key` from `gemini_get_upload_url` or a generation result (hosted deployments only) | none |
|
|
108
109
|
| `images` | read off local disk (stdio builds only) | none |
|
|
110
|
+
| `characters` / `style` | saved library entries, attached by name (hosted deployments only) | none |
|
|
109
111
|
| `images_base64` | **through the tool-call JSON** | **~14k tokens per JPEG** |
|
|
110
112
|
|
|
111
113
|
**Reach for `images_base64` last.** It costs ~14k tokens per modest photo, and a truncated file
|
|
@@ -130,17 +132,32 @@ not an error.
|
|
|
130
132
|
| `gemini_list_files(page_size?)` | List current uploads with MIME types and expiry |
|
|
131
133
|
| `gemini_delete_file(file_uri, confirmToken?)` | Delete an upload before its ~48h expiry (confirmed first — see Notes) |
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
### Hosted deployment only
|
|
136
|
+
|
|
137
|
+
A hosted deployment has no filesystem, so these tools stand in for it. There is no `POST /upload`
|
|
138
|
+
endpoint (it went with the retired Worker connector): an agent with a shell uploads through a
|
|
139
|
+
signed URL instead.
|
|
140
|
+
|
|
141
|
+
| Tool | Description |
|
|
142
|
+
|------|-------------|
|
|
143
|
+
| `gemini_get_upload_url(filename, content_type)` | Mint a ~10-minute signed **PUT** URL. `curl -X PUT -H "Content-Type: <type>" --data-binary @file "<upload_url>"` needs no auth header. The result's `r2_key` goes to `images_r2_keys`, `gemini_save_character`, or `gemini_upload_file({ r2_key })` |
|
|
144
|
+
| `gemini_sign_media(r2_key)` | Mint a fresh signed link for stored media (links live at most 24h) — an expired link is not a reason to re-generate |
|
|
145
|
+
| `gemini_view_media(r2_key)` | Return a stored image inline so you can look at what was made before refining it |
|
|
146
|
+
| `gemini_list_recent_media(limit?, since_day?)` | Recent stored media with prompt, model and interaction id — how a lost result or turn is found again |
|
|
147
|
+
| `gemini_save_character` / `gemini_list_characters` / `gemini_delete_character` | Per-account character library (reference image + description, no expiry); attach with `characters: ["name"]` |
|
|
148
|
+
| `gemini_save_style` / `gemini_list_styles` / `gemini_delete_style` | Per-account style presets (prompt fragment, optional reference image, no expiry); attach with `style: "name"` |
|
|
135
149
|
|
|
136
150
|
```bash
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
#
|
|
151
|
+
# 1. tool: gemini_get_upload_url { filename: "photo.jpg", content_type: "image/jpeg" }
|
|
152
|
+
# → { upload_url, r2_key, expires_at, curl_hint }
|
|
153
|
+
# 2. shell:
|
|
154
|
+
curl -sS -X PUT -H "Content-Type: image/jpeg" --data-binary @photo.jpg "$UPLOAD_URL"
|
|
155
|
+
# 3. tool: gemini_image_edit { prompt: "make it winter", images_r2_keys: ["<r2_key from step 1>"] }
|
|
142
156
|
```
|
|
143
157
|
|
|
158
|
+
Uploads are raster images only, capped at 15MB, and follow the host's retention schedule; save
|
|
159
|
+
anything you want to keep with `gemini_save_character`.
|
|
160
|
+
|
|
144
161
|
### Multi-turn (Interactions API)
|
|
145
162
|
| Tool | Description |
|
|
146
163
|
|------|-------------|
|
|
@@ -183,15 +200,16 @@ gemini_image_edit(prompt: "make the background blue", images_url: ["https://exam
|
|
|
183
200
|
→ the server fetches the URL itself; returns path to edited PNG
|
|
184
201
|
```
|
|
185
202
|
|
|
186
|
-
**Reuse one photo across many generations (hosted
|
|
203
|
+
**Reuse one photo across many generations (hosted deployment, agent with a shell):**
|
|
187
204
|
```
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
gemini_image_edit(prompt: "make it winter",
|
|
193
|
-
gemini_image_edit(prompt: "make it sunrise",
|
|
194
|
-
→ two edits, one upload, zero image bytes in context.
|
|
205
|
+
gemini_get_upload_url(filename: "photo.jpg", content_type: "image/jpeg")
|
|
206
|
+
→ { upload_url, r2_key: "up/…/photo.jpg" }
|
|
207
|
+
$ curl -sS -X PUT -H "Content-Type: image/jpeg" --data-binary @photo.jpg "$UPLOAD_URL"
|
|
208
|
+
|
|
209
|
+
gemini_image_edit(prompt: "make it winter", images_r2_keys: ["up/…/photo.jpg"])
|
|
210
|
+
gemini_image_edit(prompt: "make it sunrise", images_r2_keys: ["up/…/photo.jpg"])
|
|
211
|
+
→ two edits, one upload, zero image bytes in context. To keep the photo past the
|
|
212
|
+
upload retention window, gemini_save_character it and pass characters: ["name"].
|
|
195
213
|
```
|
|
196
214
|
|
|
197
215
|
**Generate a consistent set (master + scenes):**
|