Back to Home
pietrozullo icon

image_gen_mcp

Verified Safe

by pietrozullo

Overview

Generates high-quality images from text prompts and transforms existing images using Google's Gemini AI model.

Installation

Run Command
python server.py

Environment Variables

  • GEMINI_API_KEY
  • PORT
  • MCP_URL
  • IMAGE_STORAGE_DIR

Security Notes

The server uses `os.environ.get` for API keys, avoiding hardcoded secrets. It implements path sanitization (`is_relative_to`) to prevent directory traversal when serving images. Image uploads and URLs are validated for size and format (`MAX_IMAGE_SIZE_BYTES`, `ALLOWED_IMAGE_FORMATS`) to mitigate risks like decompression bombs and arbitrary file uploads. A cleanup mechanism for old images is in place. While `host="0.0.0.0"` is used, typical for cloud deployments, it requires proper firewalling in production environments. No `eval` or `exec` from user input was found.

Similar Servers

Stats

Interest Score0
Security Score8
Cost ClassMedium
Avg Tokens750
Stars0
Forks0
Last Update2026-01-16

Tags

GeminiImage GenerationImage TransformationAIMCP Server