AI-powered image generation using Google Gemini, integrated with Claude Code via Skills or Claude.ai via MCP (Model Context Protocol).
$git clone https://github.com/guinacio/claude-image-genInstalls into the current project.
Install claude-image-gen by running `git clone https://github.com/guinacio/claude-image-gen`, then use it for the current task and follow its documentation at https://github.com/guinacio/claude-image-gen.
| 1 | # Gemini Image Generation - Claude Skill + MCP |
| 2 | |
| 3 | AI-powered image generation using Google Gemini, integrated with Claude Code. |
| 4 | |
| 5 | ## Features |
| 6 | |
| 7 | - Generate images from text prompts using Gemini AI |
| 8 | - Proactive Claude skill suggests images for websites, presentations, and more |
| 9 | - **Two execution modes**: CLI script (skill-only) or MCP server (protocol-based) |
| 10 | - Configurable aspect ratios (1:1, 16:9, 9:16, etc.) |
| 11 | - Multiple model support (quality vs speed) |
| 12 | - Images saved to disk with file paths returned |
| 13 | |
| 14 | ## Prerequisites |
| 15 | |
| 16 | - Google Gemini API key ([Get one here](https://aistudio.google.com/apikey)) |
| 17 | - Node.js 18+ (only for manual installation) |
| 18 | |
| 19 | ## Installation |
| 20 | |
| 21 | ### Quick Install (Claude Code Plugin) |
| 22 | |
| 23 | The plugin installs **skill + CLI + MCP server** in one step—no separate configuration needed. |
| 24 | |
| 25 | ```bash |
| 26 | # Add the marketplace |
| 27 | /plugin marketplace add guinacio/claude-image-gen |
| 28 | |
| 29 | # Install the plugin |
| 30 | /plugin install media-pipeline@media-pipeline-marketplace |
| 31 | ``` |
| 32 | |
| 33 | Or install directly from GitHub: |
| 34 | |
| 35 | ```bash |
| 36 | /plugin install guinacio/claude-image-gen |
| 37 | ``` |
| 38 | |
| 39 | Once installed: |
| 40 | - **Skill** uses the bundled CLI script (no MCP overhead) |
| 41 | - **MCP server** is also available for direct tool calls |
| 42 | |
| 43 | > **Tip:** Since the skill runs the CLI directly, you can disable the MCP server in Claude Code's MCP list to reduce startup overhead. The skill will continue to work without it. |
| 44 | |
| 45 | --- |
| 46 | |
| 47 | ### Quick Install (Claude Desktop Extension) |
| 48 | |
| 49 | For Claude Desktop users, install the pre-built extension: |
| 50 | |
| 51 | 1. Download `media-pipeline.mcpb` from [Releases](https://github.com/guinacio/claude-image-gen/releases) |
| 52 | 2. Open Claude Desktop |
| 53 | 3. Go to **Settings** → **Extensions** → **Advanced settings** |
| 54 | 4. Click **Install Extension** and select the `.mcpb` file |
| 55 | 5. Enter your Gemini API key when prompted |
| 56 | |
| 57 | --- |
| 58 | |
| 59 | ### Manual Installation |
| 60 | |
| 61 | For developers who want to customize or build from source: |
| 62 | |
| 63 | #### 1. Build the MCP Server |
| 64 | |
| 65 | ```bash |
| 66 | cd mcp-server |
| 67 | npm install |
| 68 | npm run bundle |
| 69 | ``` |
| 70 | |
| 71 | #### 2. Use the Standalone CLI |
| 72 | |
| 73 | ```bash |
| 74 | cd mcp-server |
| 75 | GEMINI_API_KEY=your-api-key-here node build/cli.bundle.js \ |
| 76 | --prompt "Landing page hero image for a fintech startup" \ |
| 77 | --aspect-ratio "16:9" |
| 78 | ``` |
| 79 | |
| 80 | The CLI runs directly against Gemini and returns structured JSON on stdout. It does not require the MCP server layer. |
| 81 | |
| 82 | #### 3. Add to Claude Code |
| 83 | |
| 84 | **Option A: Using MCP server** |
| 85 | |
| 86 | ```bash |
| 87 | claude mcp add --transport stdio media-pipeline \ |
| 88 | --env GEMINI_API_KEY=your-api-key-here \ |
| 89 | -- node /path/to/claude-image-gen/mcp-server/build/bundle.js |
| 90 | ``` |
| 91 | |
| 92 | The `--` separates Claude CLI flags from the server command. |
| 93 | |
| 94 | **Option B: Manual config** |
| 95 | |
| 96 | Add to your Claude Code config (`~/.claude.json`): |
| 97 | |
| 98 | ```json |
| 99 | { |
| 100 | "mcpServers": { |
| 101 | "media-pipeline": { |
| 102 | "command": "node", |
| 103 | "args": ["/path/to/claude-image-gen/mcp-server/build/bundle.js"], |
| 104 | "env": { |
| 105 | "GEMINI_API_KEY": "${GEMINI_API_KEY}", |
| 106 | "GEMINI_DEFAULT_MODEL": "${GEMINI_DEFAULT_MODEL:-gemini-3-pro-image-preview}", |
| 107 | "IMAGE_OUTPUT_DIR": "${IMAGE_OUTPUT_DIR:-./generated-images}", |
| 108 | "GEMINI_REQUEST_TIMEOUT_MS": "${GEMINI_REQUEST_TIMEOUT_MS:-60000}", |
| 109 | "MEDIA_PIPELINE_LOG_LEVEL": "${MEDIA_PIPELINE_LOG_LEVEL:-info}" |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | ``` |
| 115 | |
| 116 | The `${VAR:-default}` syntax uses environment variables with fallback defaults. |
| 117 | |
| 118 | #### 4. Install Skill Manually (Optional) |
| 119 | |
| 120 | If not using the plugin: |
| 121 | |
| 122 | ```bash |
| 123 | cp -r skills/image-generation ~/.claude/skills/ |
| 124 | ``` |
| 125 | |
| 126 | #### 4. Build Extension from Source (Optional) |
| 127 | |
| 128 | To create your own `.mcpb` extension for Claude Desktop: |
| 129 | |
| 130 | ```bash |
| 131 | cd mcp-server |
| 132 | npm install -g @anthropic-ai/mcpb |
| 133 | npm run pack:mcpb |
| 134 | ``` |
| 135 | |
| 136 | This creates `mcp-server/media-pipeline.mcpb` using bundled runtime entry points for both the MCP server and the standalone CLI. |
| 137 | |
| 138 | ## Usage |
| 139 | |
| 140 | ### Direct Tool Usage |
| 141 | |
| 142 | ``` |
| 143 | Use create_asset to create a hero image for a tech startup website |
| 144 | ``` |
| 145 | |
| 146 | ### With the Skill |
| 147 | |
| 148 | The skill will proactively suggest image generation when: |
| 149 | - Building websites with hero sections |
| 150 | - Creating presentations |
| 151 | - Working with placeholder images |
| 152 | - Developing marketing materials |
| 153 | |
| 154 | ## Configuration |
| 155 | |
| 156 | ### Environment Variables |
| 157 | |
| 158 | | Variable | Required | Default | Description | |
| 159 | |----------|----------|---------|-------------| |
| 160 | | `GEMINI_API_KEY` | Yes | - | Your Gemini API key | |
| 161 | | `GEMINI_DEFAULT_MODEL` | No | `gemini-3-pro-image-preview` | Default model to use | |
| 162 | | `IMAGE_OUTPUT_DIR` | No | `./generated-images` | Where to save images | |
| 163 | | `GEMINI_REQUEST_TIMEOUT_MS` | No | `60000` | Timeout for Gemini requests | |
| 164 | | `MEDIA_PIPELINE_LOG_LEVEL` | No | `info` | Stderr logging level | |
| 165 | |
| 166 | ### Models |
| 167 | |
| 168 | Available image models are fetched dynamically from the Gemini API at runtime. The CLI and MCP tool validate model choices against the current image-capable model list, and `GEMINI_DEFAULT_MODEL` is used when available. |
| 169 | |
| 170 | ### Aspect Ratios |
| 171 | |
| 172 | | Ratio | Best For | |
| 173 | |-------|----------| |
| 174 | | `1:1` | Social media, thumbnails | |
| 175 | | `16:9` | Hero images, presentations | |
| 176 | | `9:16` | Mobile stories, vertical banners | |
| 177 | | `4:3` | Blog posts, general web | |
| 178 | | `3:2` | Photography-style |