Get the FREE Ultimate OpenClaw Setup Guide →

claude-image-gen

AI-powered image generation using Google Gemini, integrated with Claude Code via Skills or Claude.ai via MCP (Model Context Protocol).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio guinacio-claude-image-gen node /path/to/claude-image-gen/mcp-server/build/index.js \
  --env GEMINI_API_KEY="<YOUR_GEMINI_API_KEY>" \
  --env IMAGE_OUTPUT_DIR="${IMAGE_OUTPUT_DIR:-./generated-images}" \
  --env GEMINI_DEFAULT_MODEL="${GEMINI_DEFAULT_MODEL:-gemini-3-pro-image-preview}"

How to use

This MCP server implements a Gemini-based image generation capability that integrates with Claude through an MCP tool named media-pipeline. The server exposes a generic tool abstraction for image creation, allowing Claude to invoke image generation directly via the MCP protocol or through the CLI skill that calls the bundled CLI script. When used via MCP, you can specify prompts, aspect ratios, and model quality, and the server will generate images on demand and return file paths where the images are saved.

To use the MCP flow, connect Claude to the media-pipeline MCP service and call the create_asset tool (or equivalent) to generate images from textual prompts. If you prefer the skill-assisted path, the Claude image-generation skill can trigger the same underlying CLI, leveraging the bundled dependencies for a seamless experience. The two execution modes ensure flexibility: the CLI route is lean and fast for skill-driven prompts, while the MCP route supports direct tool calls for non-skill workflows.

How to install

Prerequisites:

  • Node.js 18+ (required for manual installation)
  • A Google Gemini API key
  1. Build and run the MCP server locally
  • From the repository root, install dependencies and build:
    cd mcp-server
    npm install
    npm run build
    
  1. Add the MCP server to Claude Code (MCP-based workflow)
  • Option A: Using Claude CLI (recommended for ease of use)

    claude mcp add --transport stdio media-pipeline \
      --env GEMINI_API_KEY=your-api-key-here \
      -- node /path/to/claude-image-gen/mcp-server/build/index.js
    

    The -- separates Claude CLI flags from the server command.

  • Option B: Manual config (advanced) Add to Claude Code config (~/.claude.json):

    {
      "mcpServers": {
        "media-pipeline": {
          "command": "node",
          "args": ["/path/to/claude-image-gen/mcp-server/build/index.js"],
          "env": {
            "GEMINI_API_KEY": "${GEMINI_API_KEY}",
            "GEMINI_DEFAULT_MODEL": "${GEMINI_DEFAULT_MODEL:-gemini-3-pro-image-preview}",
            "IMAGE_OUTPUT_DIR": "${IMAGE_OUTPUT_DIR:-./generated-images}"
          }
        }
      }
    }
    
  1. (Optional) Install the Skill Manually
  • If you’re not using the plugin, copy the skill assets to Claude’s skills folder as described:
    cp -r skills/image-generation ~/.claude/skills/
    
  1. (Optional) Build Extension for Claude Desktop
  • If you want to package your own extension for Claude Desktop:
    cd mcp-server
    npm install -g @anthropic-ai/mcpb
    mcpb pack
    
    This creates a media-pipeline.mcpb extension file.

Prerequisites recap:

  • Gemini API key
  • Node.js 18+ (for manual installation and running the MCP server)
  • Access to Claude with MCP integration or the CLAUDE CLI tooling described above

Additional notes

Tips and notes:

  • Environment variables support defaults via the ${VAR:-default} syntax for convenient local development.
  • If you primarily need skill-driven usage, you can disable the MCP server in Claude Code to reduce startup overhead; the skill will still function and call the bundled CLI.
  • The MCP server version uses the generic tool naming (media-pipeline) and create_asset-style interaction to encourage proper tool discovery by the assistant rather than direct, image-specific function calls.
  • Ensure GEMINI_API_KEY is kept secure and not checked into version control.
  • The default output directory is ./generated-images; you can customize this via IMAGE_OUTPUT_DIR.

Related MCP Servers

Sponsor this space

Reach thousands of developers