@chrischall/gemini-mcp 1.6.1 → 1.6.2

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.
@@ -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": "1.6.1"
10
+ "version": "1.6.2"
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": "1.6.1",
18
+ "version": "1.6.2",
19
19
  "author": {
20
20
  "name": "Chris Hall"
21
21
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gemini-mcp",
3
3
  "displayName": "Gemini Images",
4
- "version": "1.6.1",
4
+ "version": "1.6.2",
5
5
  "description": "MCP server for Google Gemini image generation and editing — generate and edit images via the Gemini API",
6
6
  "author": {
7
7
  "name": "Chris Hall",
@@ -33,6 +33,7 @@
33
33
  * They also happen to be the shapes this MCP's own connector used, which is why
34
34
  * media links minted before the migration still resolve. Do not "tidy" them.
35
35
  */
36
+ import { signedLinks } from './signed-url.js';
36
37
  const READ = (key, exp) => `${key}\n${exp}`;
37
38
  const WRITE = (key, ct, exp) => `put\0${key}\0${ct}\0${exp}`;
38
39
  /**
@@ -61,7 +62,22 @@ async function hmac(secret, payload) {
61
62
  * care how many segments the host uses.
62
63
  */
63
64
  export function prefixFromBaseUrl(baseUrl) {
64
- const path = new URL(baseUrl).pathname.replace(/^\/+|\/+$/g, '');
65
+ let parsed;
66
+ try {
67
+ parsed = new URL(baseUrl);
68
+ }
69
+ catch {
70
+ // This runs at module scope (client.ts builds its singleton eagerly), so a
71
+ // stale or half-substituted value does not fail a request — it stops the
72
+ // server booting. `TypeError: Invalid URL`, thrown from a stack with no
73
+ // mention of storage, is a miserable thing to debug from a host's logs;
74
+ // name the variable and the value instead. Still a throw: a store nobody
75
+ // can address is not something to degrade quietly around, because media,
76
+ // the library and signed uploads would all silently vanish.
77
+ throw new Error(`MCP_BLOB_BASE_URL is not a valid URL (got ${JSON.stringify(baseUrl)}). ` +
78
+ 'It should look like https://<host>/b/<registrationId> — check the deployment\'s environment.');
79
+ }
80
+ const path = parsed.pathname.replace(/^\/+|\/+$/g, '');
65
81
  const marker = path.startsWith('b/') ? path.slice(2) : path;
66
82
  return marker;
67
83
  }
@@ -172,5 +188,5 @@ export function blobStoreFromEnv(env = process.env, overrides = {}) {
172
188
  if (!baseUrl || !signingKey)
173
189
  return undefined;
174
190
  const bucket = createBlobBucket({ ...overrides, baseUrl, signingKey });
175
- return { bucket, baseUrl, signRead: bucket.signRead, signWrite: bucket.signWrite };
191
+ return { bucket, baseUrl, links: signedLinks(baseUrl), signRead: bucket.signRead, signWrite: bucket.signWrite };
176
192
  }