Price Per TokenPrice Per Token
Gemini Imagen4

Gemini Imagen4

by chug2k

GitHub 2 4 uses Remote
0

About

Gemini Imagen4 is an MCP server that enables AI image generation using Google's Imagen 4.0 models. It transforms text descriptions into high-quality images through the Model Context Protocol, with outputs saved locally for easy access and management. Key capabilities include: - Three model variants (Standard, Fast, and Ultra) offering different trade-offs between generation speed and image quality - Configurable aspect ratios including 1:1, 3:4, 4:3, 9:16, and 16:9 - Support for PNG and JPEG output formats - Built-in safety filtering with reason reporting for content moderation - Local file storage with timestamped filenames in a designated directory - MCP resource integration for browsing generated images within compatible AI assistants The server requires a Google Gemini API key and can be run locally via npx or installed globally through npm.

README

🎨 Gemini-Imagen4

Local AI Image Generation MCP Server powered by Google's Imagen 4.0 models

Generate stunning images from text descriptions using Google's cutting-edge Imagen 4.0 models through the Model Context Protocol (MCP). Images are saved locally to ./generated-images/ directory.

✨ Features

  • 🖼️ High-quality image generation using Google's latest Imagen 4.0 models
  • Multiple model variants for different speed/quality needs
  • 🎯 Flexible aspect ratios (1:1, 3:4, 4:3, 9:16, 16:9)
  • 📸 Multiple output formats (PNG, JPEG)
  • 🔒 Built-in safety filtering with reason reporting
  • 💾 Local file storage - images saved to ./generated-images/ directory
  • 🚀 Easy local setup - run with npx or npm
  • 🔌 MCP Resources - browse generated images via MCP protocol
  • 🚀 Quick Start

    Prerequisites

  • Node.js 18+
  • Google Gemini API key (Get one here)
  • Installation & Usage

    #### Option 1: Install from npm (Recommended)

    npm install -g gemini-imagen4
    

    Then run:

    gemini-imagen4
    

    #### Option 2: Run directly with npx

    npx gemini-imagen4
    

    #### Option 3: Clone and run locally

    git clone https://github.com/chug2k/gemini-imagen4.git
    cd gemini-imagen4
    npm install
    npm run dev
    

    You'll be prompted to enter your Gemini API key when you first run it.

    Usage

    Once running, the server provides:

    #### Tool: generate_image_from_text Generate images from text descriptions with optional customization.

    Parameters:

  • prompt (required): Text description of the image to generate
  • model (optional): Choose from:
  • - imagen-4.0-generate-preview-06-06 (default - balanced) - imagen-4.0-fast-generate-preview-06-06 (faster generation) - imagen-4.0-ultra-generate-preview-06-06 (highest quality)
  • aspectRatio (optional): 1:1, 3:4, 4:3, 9:16, or 16:9
  • outputMimeType (optional): image/png (default) or image/jpeg
  • Example:

    {
      "prompt": "A majestic dragon soaring through a sunset sky",
      "model": "imagen-4.0-ultra-generate-preview-06-06",
      "aspectRatio": "16:9",
      "outputMimeType": "image/png"
    }
    

    Response: Images are saved to ./generated-images/ with timestamped filenames like 1754998591_majestic_dragon_soaring.png

    #### Resource: generated-images Browse the generated images directory via MCP resources protocol.

    🔌 Adding to Claude Desktop

    To use this server with Claude Desktop, add it to your MCP configuration:

    Edit your claude_desktop_config.json:

    {
      "mcpServers": {
        "gemini-imagen4": {
          "command": "npx",
          "args": ["gemini-imagen4"],
          "env": {
            "GEMINI_API_KEY": "your-api-key-here"
          }
        }
      }
    }
    

    Replace your-api-key-here with your actual Gemini API key, then restart Claude Desktop.

    🔧 Configuration

    The server requires a Gemini API key and supports the following configuration:

    # smithery.yaml
    runtime: typescript
    startCommand:
      type: http
      configSchema:
        type: object
        required: ["geminiApiKey"]
        properties:
          geminiApiKey:
            type: string
            title: "Gemini API Key"
            description: "Your Google Gemini API key"
          modelName:
            type: string
            title: "Model Name"
            description: "Default Imagen model to use"
            default: "imagen-4.0-generate-preview-06-06"
            enum: 
              - "imagen-4.0-generate-preview-06-06"
              - "imagen-4.0-fast-generate-preview-06-06"
              - "imagen-4.0-ultra-generate-preview-06-06"
    

    🏃‍♂️ Development

    Run the development server:

    npm run dev
    

    📦 Model Variants

  • Standard (imagen-4.0-generate-preview-06-06): Best balance of quality and speed
  • Fast (imagen-4.0-fast-generate-preview-06-06): Optimized for quick generation
  • Ultra (imagen-4.0-ultra-generate-preview-06-06): Maximum quality output
  • 🛡️ Safety & Content Filtering

    All images are processed through Google's built-in safety filters. If content is filtered, the tool will return the reason for filtering instead of an image.

    🤝 Contributing

    Contributions are welcome! Please feel free to submit a Pull Request.

    📄 License

    MIT License - see LICENSE file for details.

    🔗 Links

  • Google AI Studio
  • Model Context Protocol
  • Smithery Platform
  • ---

    Built with ❤️ using Google's Imagen 4.0 and the Model Context Protocol

    Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24
    Math-MCP

    Math-MCP

    EthanHenrickson

    Math-MCP is a computation server that enables Large Language Models (LLMs) to perform accurate numerical calculations through the Model Context Protocol. It provides precise mathematical operations via a simple API to overcome LLM limitations in arithmetic and statistical reasoning. Key features of Math-MCP: - Basic arithmetic operations: addition, subtraction, multiplication, division, modulo, and bulk summation - Statistical analysis functions: mean, median, mode, minimum, and maximum calculations - Rounding utilities: floor, ceiling, and nearest integer rounding - Trigonometric functions: sine, cosine, tangent, and their inverses with degrees and radians conversion support

    Developer Tools
    22 81