Get the FREE Ultimate OpenClaw Setup Guide →

gemini-imagen

MCP server from serkanhaslak/gemini-imagen-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio serkanhaslak-gemini-imagen-mcp-server npx -y gemini-imagen-mcp-server \
  --env GEMINI_API_KEY="your-api-key-here"

How to use

This MCP server integrates Google Gemini Imagen image generation directly into Claude Code workflows. Using npx, you can run the server on demand without a full installation, and it saves generated images into your project's imagen/ folder. The server supports multiple Imagen models (imagen-3, imagen-4, imagen-4-ultra) and provides options for batch generation, seeds, aspect ratios, negative prompts, and output formats. You control the server through MCP configuration, enabling image generation as you write code, create UI mocks, or build assets within your project. To start, provide your Gemini API key via the GEMINI_API_KEY environment variable and invoke the server through your Claude Code MCP settings. The server exposes tools like generate_image, batch_generate, list_models, and health_check to streamline asset creation and status checks within your development workflow.

How to install

Prerequisites:

  • Node.js 18+ installed on your system
  • Access to the internet to fetch the MCP server package
  • A Gemini API key from Google AI Studio

Installation steps:

  1. Install Node.js 18+ if not already present.
  2. Install the MCP server package globally or use npx as described in the quick start.
  3. Add your Gemini API key to the MCP configuration or environment before starting generation.

Option A: Quick start (NPX, no installation)

  • In Claude Code MCP settings, configure:
{
  "mcpServers": {
    "gemini-imagen": {
      "command": "npx",
      "args": ["-y", "gemini-imagen-mcp-server"],
      "env": {"GEMINI_API_KEY": "your-api-key-here"}
    }
  }
}

Option B: Global install (node-based)

npm install -g gemini-imagen-mcp-server

Configure:

{
  "mcpServers": {
    "gemini-imagen": {
      "command": "gemini-imagen-mcp-server",
      "env": {"GEMINI_API_KEY": "your-api-key-here"}
    }
  }
}

Option C: Local development

git clone https://github.com/serkanhaslak/gemini-imagen-mcp-server.git
cd gemini-imagen-mcp-server
npm install
npm run build

Additional notes

Tips and caveats:

  • Always set GEMINI_API_KEY in the MCP configuration to authenticate with Google's Gemini Imagen API.
  • The server writes generated images to your project’s imagen/ folder by default; ensure the folder is writable.
  • If you encounter "GEMINI_API_KEY not found", double-check that the env var is passed in the MCP settings.
  • For batch generation, utilize the --batch and --max-batch-size options to control throughput and quotas.
  • You can specify different models using the --model option when running via npx gemini-imagen-mcp-server or through the MCP GUI if supported.
  • Review quotas and pricing in the API provider's docs to avoid unexpected costs during batch operations.

Related MCP Servers

Sponsor this space

Reach thousands of developers