ultimate-gemini-mcp 1.5.1__py3-none-any.whl → 1.6.0__py3-none-any.whl
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.
- src/__init__.py +1 -1
- src/core/validation.py +7 -5
- src/services/image_service.py +6 -4
- src/tools/batch_generate.py +15 -0
- src/tools/generate_image.py +21 -0
- {ultimate_gemini_mcp-1.5.1.dist-info → ultimate_gemini_mcp-1.6.0.dist-info}/METADATA +44 -5
- {ultimate_gemini_mcp-1.5.1.dist-info → ultimate_gemini_mcp-1.6.0.dist-info}/RECORD +10 -10
- {ultimate_gemini_mcp-1.5.1.dist-info → ultimate_gemini_mcp-1.6.0.dist-info}/WHEEL +0 -0
- {ultimate_gemini_mcp-1.5.1.dist-info → ultimate_gemini_mcp-1.6.0.dist-info}/entry_points.txt +0 -0
- {ultimate_gemini_mcp-1.5.1.dist-info → ultimate_gemini_mcp-1.6.0.dist-info}/licenses/LICENSE +0 -0
src/__init__.py
CHANGED
src/core/validation.py
CHANGED
|
@@ -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
|
-
#
|
|
129
|
-
safe_name = re.sub(r'[
|
|
130
|
-
# Remove
|
|
131
|
-
safe_name =
|
|
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"
|
src/services/image_service.py
CHANGED
|
@@ -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
|
|
57
|
+
"""Generate clean, short filename."""
|
|
58
58
|
timestamp = self.timestamp.strftime("%Y%m%d_%H%M%S")
|
|
59
|
-
#
|
|
60
|
-
|
|
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"{
|
|
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."""
|
src/tools/batch_generate.py
CHANGED
|
@@ -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(
|
src/tools/generate_image.py
CHANGED
|
@@ -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(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ultimate-gemini-mcp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
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
|
|
@@ -201,13 +201,25 @@ Add to your `claude_desktop_config.json`:
|
|
|
201
201
|
"command": "uvx",
|
|
202
202
|
"args": ["ultimate-gemini-mcp"],
|
|
203
203
|
"env": {
|
|
204
|
-
"GEMINI_API_KEY": "your-api-key-here"
|
|
204
|
+
"GEMINI_API_KEY": "your-api-key-here",
|
|
205
|
+
"OUTPUT_DIR": "/path/to/your/images"
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
```
|
|
210
211
|
|
|
212
|
+
**Important Notes:**
|
|
213
|
+
|
|
214
|
+
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:
|
|
215
|
+
- **macOS**: `"/Users/yourusername/gemini_images"`
|
|
216
|
+
- **Windows**: `"C:\\Users\\YourUsername\\gemini_images"`
|
|
217
|
+
|
|
218
|
+
2. **uvx path issues on macOS**: If you get `spawn uvx ENOENT` errors, use the full path to uvx:
|
|
219
|
+
```json
|
|
220
|
+
"command": "/Users/yourusername/.local/bin/uvx"
|
|
221
|
+
```
|
|
222
|
+
|
|
211
223
|
**Config file locations:**
|
|
212
224
|
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
213
225
|
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
@@ -215,10 +227,15 @@ Add to your `claude_desktop_config.json`:
|
|
|
215
227
|
### With Claude Code (VS Code)
|
|
216
228
|
|
|
217
229
|
```bash
|
|
218
|
-
# Add MCP server to Claude Code
|
|
219
|
-
claude mcp add ultimate-gemini
|
|
230
|
+
# Add MCP server to Claude Code (with required OUTPUT_DIR)
|
|
231
|
+
claude mcp add ultimate-gemini \
|
|
232
|
+
--env GEMINI_API_KEY=your-api-key \
|
|
233
|
+
--env OUTPUT_DIR=/path/to/your/images \
|
|
234
|
+
-- uvx ultimate-gemini-mcp
|
|
220
235
|
```
|
|
221
236
|
|
|
237
|
+
**Note**: Replace `/path/to/your/images` with an absolute path to where you want images saved.
|
|
238
|
+
|
|
222
239
|
### With Cursor
|
|
223
240
|
|
|
224
241
|
Add to Cursor's MCP configuration (`.cursor/mcp.json`):
|
|
@@ -230,13 +247,16 @@ Add to Cursor's MCP configuration (`.cursor/mcp.json`):
|
|
|
230
247
|
"command": "uvx",
|
|
231
248
|
"args": ["ultimate-gemini-mcp"],
|
|
232
249
|
"env": {
|
|
233
|
-
"GEMINI_API_KEY": "your-api-key-here"
|
|
250
|
+
"GEMINI_API_KEY": "your-api-key-here",
|
|
251
|
+
"OUTPUT_DIR": "/path/to/your/images"
|
|
234
252
|
}
|
|
235
253
|
}
|
|
236
254
|
}
|
|
237
255
|
}
|
|
238
256
|
```
|
|
239
257
|
|
|
258
|
+
**Note**: Set `OUTPUT_DIR` to an absolute path where you want generated images saved.
|
|
259
|
+
|
|
240
260
|
## 🎯 Available Models
|
|
241
261
|
|
|
242
262
|
### Gemini Models
|
|
@@ -412,6 +432,24 @@ View current server configuration.
|
|
|
412
432
|
|
|
413
433
|
## 🐛 Troubleshooting
|
|
414
434
|
|
|
435
|
+
### "spawn uvx ENOENT" error
|
|
436
|
+
- **Cause**: Claude Desktop cannot find the `uvx` command in its PATH
|
|
437
|
+
- **Solution**: Use the full path to uvx in your config:
|
|
438
|
+
```json
|
|
439
|
+
"command": "/Users/yourusername/.local/bin/uvx"
|
|
440
|
+
```
|
|
441
|
+
- Find your uvx location with: `which uvx`
|
|
442
|
+
|
|
443
|
+
### "[Errno 30] Read-only file system: 'generated_images'"
|
|
444
|
+
- **Cause**: When using `uvx`, the default directory is in a read-only cache location
|
|
445
|
+
- **Solution**: Add `OUTPUT_DIR` to your MCP config:
|
|
446
|
+
```json
|
|
447
|
+
"env": {
|
|
448
|
+
"GEMINI_API_KEY": "your-key",
|
|
449
|
+
"OUTPUT_DIR": "/Users/yourusername/gemini_images"
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
415
453
|
### "GEMINI_API_KEY not found"
|
|
416
454
|
- Add your API key to `.env` or environment variables
|
|
417
455
|
- Get a free key at [Google AI Studio](https://makersuite.google.com/app/apikey)
|
|
@@ -427,6 +465,7 @@ View current server configuration.
|
|
|
427
465
|
### Images not saving
|
|
428
466
|
- Check that OUTPUT_DIR exists and is writable
|
|
429
467
|
- Verify you have sufficient disk space
|
|
468
|
+
- Create the directory manually: `mkdir -p /path/to/your/images`
|
|
430
469
|
|
|
431
470
|
## 🤝 Contributing
|
|
432
471
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
src/__init__.py,sha256=
|
|
1
|
+
src/__init__.py,sha256=DVg45mva4gVQV6mFPilN8aNmhbGo2xlOE1vayS-P8GU,435
|
|
2
2
|
src/server.py,sha256=hyXuhS1h6DN2EiGle8giEPSV1UB3ba7t4do_2olTK3A,5862
|
|
3
3
|
src/config/__init__.py,sha256=hL0recV_ycXBEGCym7BqwyaPCnQHy8o429pBirnBeiA,704
|
|
4
4
|
src/config/constants.py,sha256=ue4dT6wFwCzAgDWvSt8RnbdaoaGHY8c7SViNxI-P73w,1870
|
|
5
5
|
src/config/settings.py,sha256=uTxxblnyqmglz1COd3QxjC2w3o6l51S9MTanP4HBrgE,4257
|
|
6
6
|
src/core/__init__.py,sha256=PQKMAY5eYIEO1oS_hrzeuDgRopl76Wn6NLfhtXBX92I,1200
|
|
7
7
|
src/core/exceptions.py,sha256=NVb4tpwoX_DR-Wp8r73brXvZhEP35SUMyuEis8llFR0,1211
|
|
8
|
-
src/core/validation.py,sha256=
|
|
8
|
+
src/core/validation.py,sha256=ZlKDcviKQvZLCfOALSIn7sOOt1DxNlchPq0YhJJMqKI,4887
|
|
9
9
|
src/services/__init__.py,sha256=n6FVDj052zvTerDFJSjaiLIycWGePm8Wr6dabbvd9o0,395
|
|
10
10
|
src/services/gemini_client.py,sha256=VPuBPDHhAag_8xBqzMuVIEWVG0BINXOHkwKIALzcFAk,8324
|
|
11
|
-
src/services/image_service.py,sha256=
|
|
11
|
+
src/services/image_service.py,sha256=6eqp7dukRPfIgHs4sBvfxZ7hsc8E6LrvPx_RdU_h1OM,7300
|
|
12
12
|
src/services/imagen_client.py,sha256=mvwbmtYQHqpKKM36tp8JPZTjxav5eeeist37lRJsv4k,6122
|
|
13
13
|
src/services/prompt_enhancer.py,sha256=J_0s1EVmXdPAhjZPM4hL1vk9YiawqfH_ogF89VrFkW8,4776
|
|
14
14
|
src/tools/__init__.py,sha256=zBfAjFT51LvvD7WXTfDYiyJstRdphr2ChddAmGMZxkI,346
|
|
15
|
-
src/tools/batch_generate.py,sha256=
|
|
16
|
-
src/tools/generate_image.py,sha256=
|
|
17
|
-
ultimate_gemini_mcp-1.
|
|
18
|
-
ultimate_gemini_mcp-1.
|
|
19
|
-
ultimate_gemini_mcp-1.
|
|
20
|
-
ultimate_gemini_mcp-1.
|
|
21
|
-
ultimate_gemini_mcp-1.
|
|
15
|
+
src/tools/batch_generate.py,sha256=R_aqngSCwg3QAprPHe_0uqH_KJ35G6DoSVA9CU3KkZk,5744
|
|
16
|
+
src/tools/generate_image.py,sha256=wNN1w_KlMpqDP80EhNiDzvEvPozCOFweY9y4w9NtWac,9458
|
|
17
|
+
ultimate_gemini_mcp-1.6.0.dist-info/METADATA,sha256=Za0rXQI56tJxAvDE9gOclcIq4C8lBlY0dAgiu9EMlEo,17588
|
|
18
|
+
ultimate_gemini_mcp-1.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
19
|
+
ultimate_gemini_mcp-1.6.0.dist-info/entry_points.txt,sha256=-BeRTT4oR05e-YnF1ZNbNxlaekD4LsWhD-Zy_1dyRnc,56
|
|
20
|
+
ultimate_gemini_mcp-1.6.0.dist-info/licenses/LICENSE,sha256=ilyzUnN0QHYtYGJks-NFUwiniNu08IedLmn_muRqa0o,1480
|
|
21
|
+
ultimate_gemini_mcp-1.6.0.dist-info/RECORD,,
|
|
File without changes
|
{ultimate_gemini_mcp-1.5.1.dist-info → ultimate_gemini_mcp-1.6.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{ultimate_gemini_mcp-1.5.1.dist-info → ultimate_gemini_mcp-1.6.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|