ultimate-gemini-mcp 1.5.1__tar.gz → 1.6.1__tar.gz

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.

Potentially problematic release.


This version of ultimate-gemini-mcp might be problematic. Click here for more details.

Files changed (31) hide show
  1. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/PKG-INFO +46 -5
  2. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/README.md +45 -4
  3. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/pyproject.toml +1 -1
  4. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/__init__.py +1 -1
  5. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/core/validation.py +7 -5
  6. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/services/image_service.py +6 -4
  7. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/tools/batch_generate.py +15 -0
  8. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/tools/generate_image.py +21 -0
  9. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/.env.example +0 -0
  10. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/.github/workflows/README.md +0 -0
  11. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/.github/workflows/claude-code-review.yml +0 -0
  12. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/.github/workflows/claude.yml +0 -0
  13. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/.github/workflows/publish.yml +0 -0
  14. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/.github/workflows/test.yml +0 -0
  15. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/.gitignore +0 -0
  16. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/CLAUDE.md +0 -0
  17. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/LICENSE +0 -0
  18. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/MANIFEST.in +0 -0
  19. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/PUBLISHING.md +0 -0
  20. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/TEST_RESULTS.md +0 -0
  21. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/config/__init__.py +0 -0
  22. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/config/constants.py +0 -0
  23. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/config/settings.py +0 -0
  24. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/core/__init__.py +0 -0
  25. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/core/exceptions.py +0 -0
  26. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/server.py +0 -0
  27. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/services/__init__.py +0 -0
  28. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/services/gemini_client.py +0 -0
  29. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/services/imagen_client.py +0 -0
  30. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/services/prompt_enhancer.py +0 -0
  31. {ultimate_gemini_mcp-1.5.1 → ultimate_gemini_mcp-1.6.1}/src/tools/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ultimate-gemini-mcp
3
- Version: 1.5.1
3
+ Version: 1.6.1
4
4
  Summary: Ultimate image generation MCP server unifying Gemini 2.5 Flash Image and Imagen 4/Fast/Ultra with advanced features
5
5
  Project-URL: Homepage, https://github.com/anand-92/ultimate-image-gen-mcp
6
6
  Project-URL: Repository, https://github.com/anand-92/ultimate-image-gen-mcp
@@ -38,6 +38,8 @@ Description-Content-Type: text/markdown
38
38
 
39
39
  > The most comprehensive MCP server for AI image generation, unifying Google's Gemini 2.5 Flash Image and Imagen 4/Ultra models with advanced features.
40
40
 
41
+ [![MCP Badge](https://lobehub.com/badge/mcp-full/anand-92-ultimate-image-gen-mcp)](https://lobehub.com/mcp/anand-92-ultimate-image-gen-mcp)
42
+
41
43
  ## ✨ Features
42
44
 
43
45
  ### Unified API Support
@@ -201,13 +203,25 @@ Add to your `claude_desktop_config.json`:
201
203
  "command": "uvx",
202
204
  "args": ["ultimate-gemini-mcp"],
203
205
  "env": {
204
- "GEMINI_API_KEY": "your-api-key-here"
206
+ "GEMINI_API_KEY": "your-api-key-here",
207
+ "OUTPUT_DIR": "/path/to/your/images"
205
208
  }
206
209
  }
207
210
  }
208
211
  }
209
212
  ```
210
213
 
214
+ **Important Notes:**
215
+
216
+ 1. **OUTPUT_DIR is required** when using `uvx` to avoid read-only file system errors. Set it to an absolute path where you want generated images saved:
217
+ - **macOS**: `"/Users/yourusername/gemini_images"`
218
+ - **Windows**: `"C:\\Users\\YourUsername\\gemini_images"`
219
+
220
+ 2. **uvx path issues on macOS**: If you get `spawn uvx ENOENT` errors, use the full path to uvx:
221
+ ```json
222
+ "command": "/Users/yourusername/.local/bin/uvx"
223
+ ```
224
+
211
225
  **Config file locations:**
212
226
  - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
213
227
  - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
@@ -215,10 +229,15 @@ Add to your `claude_desktop_config.json`:
215
229
  ### With Claude Code (VS Code)
216
230
 
217
231
  ```bash
218
- # Add MCP server to Claude Code
219
- claude mcp add ultimate-gemini --env GEMINI_API_KEY=your-api-key -- uvx ultimate-gemini-mcp
232
+ # Add MCP server to Claude Code (with required OUTPUT_DIR)
233
+ claude mcp add ultimate-gemini \
234
+ --env GEMINI_API_KEY=your-api-key \
235
+ --env OUTPUT_DIR=/path/to/your/images \
236
+ -- uvx ultimate-gemini-mcp
220
237
  ```
221
238
 
239
+ **Note**: Replace `/path/to/your/images` with an absolute path to where you want images saved.
240
+
222
241
  ### With Cursor
223
242
 
224
243
  Add to Cursor's MCP configuration (`.cursor/mcp.json`):
@@ -230,13 +249,16 @@ Add to Cursor's MCP configuration (`.cursor/mcp.json`):
230
249
  "command": "uvx",
231
250
  "args": ["ultimate-gemini-mcp"],
232
251
  "env": {
233
- "GEMINI_API_KEY": "your-api-key-here"
252
+ "GEMINI_API_KEY": "your-api-key-here",
253
+ "OUTPUT_DIR": "/path/to/your/images"
234
254
  }
235
255
  }
236
256
  }
237
257
  }
238
258
  ```
239
259
 
260
+ **Note**: Set `OUTPUT_DIR` to an absolute path where you want generated images saved.
261
+
240
262
  ## 🎯 Available Models
241
263
 
242
264
  ### Gemini Models
@@ -412,6 +434,24 @@ View current server configuration.
412
434
 
413
435
  ## 🐛 Troubleshooting
414
436
 
437
+ ### "spawn uvx ENOENT" error
438
+ - **Cause**: Claude Desktop cannot find the `uvx` command in its PATH
439
+ - **Solution**: Use the full path to uvx in your config:
440
+ ```json
441
+ "command": "/Users/yourusername/.local/bin/uvx"
442
+ ```
443
+ - Find your uvx location with: `which uvx`
444
+
445
+ ### "[Errno 30] Read-only file system: 'generated_images'"
446
+ - **Cause**: When using `uvx`, the default directory is in a read-only cache location
447
+ - **Solution**: Add `OUTPUT_DIR` to your MCP config:
448
+ ```json
449
+ "env": {
450
+ "GEMINI_API_KEY": "your-key",
451
+ "OUTPUT_DIR": "/Users/yourusername/gemini_images"
452
+ }
453
+ ```
454
+
415
455
  ### "GEMINI_API_KEY not found"
416
456
  - Add your API key to `.env` or environment variables
417
457
  - Get a free key at [Google AI Studio](https://makersuite.google.com/app/apikey)
@@ -427,6 +467,7 @@ View current server configuration.
427
467
  ### Images not saving
428
468
  - Check that OUTPUT_DIR exists and is writable
429
469
  - Verify you have sufficient disk space
470
+ - Create the directory manually: `mkdir -p /path/to/your/images`
430
471
 
431
472
  ## 🤝 Contributing
432
473
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  > The most comprehensive MCP server for AI image generation, unifying Google's Gemini 2.5 Flash Image and Imagen 4/Ultra models with advanced features.
4
4
 
5
+ [![MCP Badge](https://lobehub.com/badge/mcp-full/anand-92-ultimate-image-gen-mcp)](https://lobehub.com/mcp/anand-92-ultimate-image-gen-mcp)
6
+
5
7
  ## ✨ Features
6
8
 
7
9
  ### Unified API Support
@@ -165,13 +167,25 @@ Add to your `claude_desktop_config.json`:
165
167
  "command": "uvx",
166
168
  "args": ["ultimate-gemini-mcp"],
167
169
  "env": {
168
- "GEMINI_API_KEY": "your-api-key-here"
170
+ "GEMINI_API_KEY": "your-api-key-here",
171
+ "OUTPUT_DIR": "/path/to/your/images"
169
172
  }
170
173
  }
171
174
  }
172
175
  }
173
176
  ```
174
177
 
178
+ **Important Notes:**
179
+
180
+ 1. **OUTPUT_DIR is required** when using `uvx` to avoid read-only file system errors. Set it to an absolute path where you want generated images saved:
181
+ - **macOS**: `"/Users/yourusername/gemini_images"`
182
+ - **Windows**: `"C:\\Users\\YourUsername\\gemini_images"`
183
+
184
+ 2. **uvx path issues on macOS**: If you get `spawn uvx ENOENT` errors, use the full path to uvx:
185
+ ```json
186
+ "command": "/Users/yourusername/.local/bin/uvx"
187
+ ```
188
+
175
189
  **Config file locations:**
176
190
  - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
177
191
  - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
@@ -179,10 +193,15 @@ Add to your `claude_desktop_config.json`:
179
193
  ### With Claude Code (VS Code)
180
194
 
181
195
  ```bash
182
- # Add MCP server to Claude Code
183
- claude mcp add ultimate-gemini --env GEMINI_API_KEY=your-api-key -- uvx ultimate-gemini-mcp
196
+ # Add MCP server to Claude Code (with required OUTPUT_DIR)
197
+ claude mcp add ultimate-gemini \
198
+ --env GEMINI_API_KEY=your-api-key \
199
+ --env OUTPUT_DIR=/path/to/your/images \
200
+ -- uvx ultimate-gemini-mcp
184
201
  ```
185
202
 
203
+ **Note**: Replace `/path/to/your/images` with an absolute path to where you want images saved.
204
+
186
205
  ### With Cursor
187
206
 
188
207
  Add to Cursor's MCP configuration (`.cursor/mcp.json`):
@@ -194,13 +213,16 @@ Add to Cursor's MCP configuration (`.cursor/mcp.json`):
194
213
  "command": "uvx",
195
214
  "args": ["ultimate-gemini-mcp"],
196
215
  "env": {
197
- "GEMINI_API_KEY": "your-api-key-here"
216
+ "GEMINI_API_KEY": "your-api-key-here",
217
+ "OUTPUT_DIR": "/path/to/your/images"
198
218
  }
199
219
  }
200
220
  }
201
221
  }
202
222
  ```
203
223
 
224
+ **Note**: Set `OUTPUT_DIR` to an absolute path where you want generated images saved.
225
+
204
226
  ## 🎯 Available Models
205
227
 
206
228
  ### Gemini Models
@@ -376,6 +398,24 @@ View current server configuration.
376
398
 
377
399
  ## 🐛 Troubleshooting
378
400
 
401
+ ### "spawn uvx ENOENT" error
402
+ - **Cause**: Claude Desktop cannot find the `uvx` command in its PATH
403
+ - **Solution**: Use the full path to uvx in your config:
404
+ ```json
405
+ "command": "/Users/yourusername/.local/bin/uvx"
406
+ ```
407
+ - Find your uvx location with: `which uvx`
408
+
409
+ ### "[Errno 30] Read-only file system: 'generated_images'"
410
+ - **Cause**: When using `uvx`, the default directory is in a read-only cache location
411
+ - **Solution**: Add `OUTPUT_DIR` to your MCP config:
412
+ ```json
413
+ "env": {
414
+ "GEMINI_API_KEY": "your-key",
415
+ "OUTPUT_DIR": "/Users/yourusername/gemini_images"
416
+ }
417
+ ```
418
+
379
419
  ### "GEMINI_API_KEY not found"
380
420
  - Add your API key to `.env` or environment variables
381
421
  - Get a free key at [Google AI Studio](https://makersuite.google.com/app/apikey)
@@ -391,6 +431,7 @@ View current server configuration.
391
431
  ### Images not saving
392
432
  - Check that OUTPUT_DIR exists and is writable
393
433
  - Verify you have sufficient disk space
434
+ - Create the directory manually: `mkdir -p /path/to/your/images`
394
435
 
395
436
  ## 🤝 Contributing
396
437
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ultimate-gemini-mcp"
3
- version = "1.5.1"
3
+ version = "1.6.1"
4
4
  description = "Ultimate image generation MCP server unifying Gemini 2.5 Flash Image and Imagen 4/Fast/Ultra with advanced features"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -7,7 +7,7 @@ A unified MCP server that combines the best features from:
7
7
  - Advanced features: batch processing, editing, templates, and more
8
8
  """
9
9
 
10
- __version__ = "1.5.1"
10
+ __version__ = "1.6.1"
11
11
  __author__ = "Ultimate Gemini MCP"
12
12
 
13
13
  from .config import get_settings
@@ -124,11 +124,13 @@ def validate_prompts_list(prompts: list[str]) -> None:
124
124
 
125
125
 
126
126
  def sanitize_filename(filename: str) -> str:
127
- """Sanitize filename to remove unsafe characters."""
128
- # Remove or replace unsafe characters
129
- safe_name = re.sub(r'[<>:"/\\|?*\x00-\x1f]', "_", filename)
130
- # Remove leading/trailing dots and spaces
131
- safe_name = safe_name.strip(". ")
127
+ """Sanitize filename to remove unsafe and special characters."""
128
+ # Replace all non-alphanumeric characters (except hyphens) with underscores
129
+ safe_name = re.sub(r'[^a-zA-Z0-9-]', '_', filename)
130
+ # Remove multiple consecutive underscores
131
+ safe_name = re.sub(r'_+', '_', safe_name)
132
+ # Remove leading/trailing underscores
133
+ safe_name = safe_name.strip("_")
132
134
  # Ensure filename is not empty
133
135
  if not safe_name:
134
136
  safe_name = "image"
@@ -54,12 +54,14 @@ class ImageResult:
54
54
  raise ImageProcessingError(f"Failed to save image: {e}") from e
55
55
 
56
56
  def _generate_filename(self) -> str:
57
- """Generate descriptive filename."""
57
+ """Generate clean, short filename."""
58
58
  timestamp = self.timestamp.strftime("%Y%m%d_%H%M%S")
59
- # Sanitize prompt for filename
60
- prompt_snippet = sanitize_filename(self.prompt[:50])
59
+ # Shorten model name (e.g., gemini-2.5-flash-image -> gemini-flash)
60
+ model_short = self.model.replace("gemini-2.5-flash-image", "gemini-flash").replace("imagen-4-", "img4-")
61
+ # Sanitize and shorten prompt (max 30 chars)
62
+ prompt_snippet = sanitize_filename(self.prompt[:30])
61
63
  index_str = f"_{self.index + 1}" if self.index > 0 else ""
62
- return f"{self.model}_{timestamp}_{prompt_snippet}{index_str}.png"
64
+ return f"{model_short}_{timestamp}_{prompt_snippet}{index_str}.png"
63
65
 
64
66
  def get_size(self) -> int:
65
67
  """Get image size in bytes."""
@@ -133,6 +133,21 @@ def register_batch_generate_tool(mcp_server: Any) -> None:
133
133
 
134
134
  Returns:
135
135
  JSON string with batch results including individual image paths
136
+
137
+ IMPORTANT - AI Assistant Instructions:
138
+ After batch generation completes, you MUST:
139
+ 1. Parse the JSON response to extract file paths from result["results"][i]["images"][0]["path"]
140
+ 2. Show the user a summary of all generated images with their file paths
141
+ 3. Optionally display one or more images using the Read tool
142
+ 4. Let the user know the total count of successful vs failed generations
143
+
144
+ Example response to user:
145
+ "Successfully generated 3 images:
146
+ 1. /path/to/image1.png - [description]
147
+ 2. /path/to/image2.png - [description]
148
+ 3. /path/to/image3.png - [description]"
149
+
150
+ DO NOT just say "batch generation completed" without listing the file paths!
136
151
  """
137
152
  try:
138
153
  result = await batch_generate_images(
@@ -217,6 +217,27 @@ def register_generate_image_tool(mcp_server: Any) -> None:
217
217
 
218
218
  Returns:
219
219
  JSON string with generation results and file paths
220
+
221
+ IMPORTANT - AI Assistant Instructions:
222
+ After generating an image, you MUST:
223
+ 1. Parse the JSON response to extract the file path from result["images"][0]["path"]
224
+ 2. Inform the user of the EXACT file path where the image was saved
225
+ 3. Use the Read tool to load and display the image to the user
226
+ 4. Optionally: Use bash to open the image in the default viewer:
227
+ - macOS: `open /path/to/image.png`
228
+ - Linux: `xdg-open /path/to/image.png`
229
+ - Windows: `start /path/to/image.png`
230
+
231
+ Example workflow:
232
+ ```
233
+ 1. Call generate_image tool
234
+ 2. Parse response JSON to get file_path
235
+ 3. Tell user: "Image saved to: /Users/name/gemini_images/image.png"
236
+ 4. Call Read tool with the file_path to display the image
237
+ 5. Optionally call Bash with `open /path/to/image.png` to open in Preview
238
+ ```
239
+
240
+ DO NOT just say "image generated successfully" without showing the path and image!
220
241
  """
221
242
  try:
222
243
  result = await generate_image_tool(