← All guides

Google · Coding agent

How to Generate Images in Gemini CLI with MCP

Connect PixelMCP to Gemini CLI and your agent can generate images while it builds: hero images, icons, illustrations, blog headers and OG cards. It can save the files straight into your project using Nano Banana, GPT Image, FLUX, Seedream or Recraft.

Connect PixelMCP to Google's Gemini CLI.

Before you start: Gemini CLI installed (npm install -g @google/gemini-cli). You'll also need a PixelMCP account. Get 100 free credits
  1. 1

    Add the server

    Run:

    gemini mcp add --transport http pixelmcp https://pixelmcp.com/mcp
  2. 2

    Or edit settings

    Equivalent entry in ~/.gemini/settings.json (or .gemini/settings.json in a project):

    {
      "mcpServers": {
        "pixelmcp": {
          "httpUrl": "https://pixelmcp.com/mcp"
        }
      }
    }
  3. 3

    Sign in

    Start gemini, run the auth command and approve access in your browser:

    /mcp auth pixelmcp

Things to try

  • “Make a 16:9 social card for our README announcing v2.0.”

Image models you can use in Gemini CLI

Not sure which to pick? Compare the models.

FAQ

What do I need to use PixelMCP in Gemini CLI?+

Gemini CLI installed (npm install -g @google/gemini-cli). You also need a PixelMCP account, which starts with 100 free credits.

Which image models can I use in Gemini CLI?+

Nano Banana 2 and Pro, GPT Image 2 and GPT Image 2 HD, FLUX.2 Pro and Klein, Seedream 5.0 Pro and Recraft V4.1. Name a model in your prompt or let the assistant choose.

How much does it cost?+

You pay per image with credits, from 6 credits (6¢) an image. There's no subscription and credits never expire. New accounts get 100 free credits.

How long does setup take?+

About a minute. Add the PixelMCP server URL to Gemini CLI, sign in once, and you're ready to generate.

Menus change often. If a label here doesn't match what you see, look for “Connectors”, “MCP” or “Integrations” in Gemini CLI's settings, or check Google's docs.