Gemini Image Generation logo

Gemini Image Generation

Community
creating-cat

An MCP server for image generation using the Gemini API.

Publishercreating-cat
Repositorygemini-image-mcp-server
LanguageTypeScript
Forks
1
Stars
2
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Gemini Image Generation exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    2 stars and 1 forks from the linked repository.

日本語版はこちら (Read in Japanese)

Gemini Image MCP Server

This is an MCP (Model Context Protocol) server that uses Google's Gemini API to generate images and save them to a specified directory. In addition to text prompts, you can optionally provide input images to guide the image generation process. Generated images are automatically compressed to reduce file size.


Features

  • Image generation from text prompts
  • (Optional) Image generation using input reference images
  • Automatic compression of generated images (JPEG, PNG)
  • Unique file name assignment to prevent file name conflicts
  • Operates as an MCP server, accepting tool calls via standard input/output

Prerequisites

  • Node.js (v18 or higher recommended)
  • Google Cloud Project with Gemini API enabled
  • Gemini API Key

Setup

Example MCP server configuration for Roo Code

json
{
  "mcpServers": {
    "gemini-image-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@creating-cat/gemini-image-mcp-server"
      ],
      "env": {
        "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY"
      },
      "disabled": false,
      "timeout": 300
    }
  }
}
  • Replace YOUR_GEMINI_API_KEY with your actual Gemini API Key.

    • You can also use ${env:GEMINI_API_KEY} to retrieve the key from environment variables (Roo Code feature).

Tool: generate_image

This MCP server provides a tool named generate_image.

Input Parameters

Parameter NameDescriptionDefault Value
prompt(string, required) Text prompt for image generation. If input images are provided, include instructions on how to incorporate them into the generated image. English is recommended.None
output_directory(string, optional) Directory path where the generated image will be saved.output/images
file_name(string, optional) Name of the saved image file (without extension).generated_image
input_image_paths(string[], optional) List of file paths for input reference images.[] (empty array)
use_enhanced_prompt(boolean, optional) Whether to use enhanced prompts to assist AI instructions.true
target_image_max_size(number, optional) Maximum size (in pixels) for the longer edge after resizing. The aspect ratio is preserved.512
force_conversion_type(string, optional) Optionally force conversion to a specific format ('jpeg', 'webp', 'png'). If not specified, the original format will be processed, defaulting to PNG for non-JPEG images.None
skip_compression_and_resizing(boolean, optional) Whether to skip compression and resizing of generated images. If true, force_conversion_type and target_image_max_size will be ignored.false
jpeg_quality(number, optional) JPEG quality (0-100). Lower values result in higher compression.80
webp_quality(number, optional) WebP quality (0-100). Lower values result in higher compression.80
png_compression_level(number, optional) PNG compression level (0-9). Higher values result in higher compression.9
optipng_optimization_level(number, optional) OptiPNG optimization level (0-7). Higher values result in higher compression.2

Output

On success, the server returns the save path of the generated image and a message detailing the process, including the original and compressed file sizes. Example:

json
{
  "content": [
    {
      "type": "text",
      "text": "Image successfully generated and compressed at output/images/my_cat.jpg.\nOriginal size: 1024.12KB, Final size: 150.45KB"
    }
  ]
}

If an error occurs, an error message will be returned.


Notes

  • The MIME type and aspect ratio of the generated images depend on the default settings of the Gemini API.
  • Handle your API key with care.
  • This server uses the model gemini-2.0-flash-preview-image-generation. Google may discontinue this model in the future.

License

MIT

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "gemini-image-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@creating-cat/gemini-image-mcp-server"
      ],
      "env": {
        "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY"
      }
    }
  }
}

Use Gemini Image Generation MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Gemini Image Generation is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Gemini Image Generation as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Gemini Image Generation MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "gemini-image-generation": {
      "command": "npx",
      "args": [
        "-y",
        "@creating-cat/gemini-image-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Gemini Image Generation MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Gemini Image Generation MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Gemini Image Generation to help me with this task?
Gemini Image Generation
Sure. I read it.
Here is what I found using Gemini Image Generation.

Frequently asked questions

What is the Gemini Image Generation MCP server used for?

Gemini Image Generation is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Gemini Image Generation MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Gemini Image Generation with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Gemini Image Generation MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Gemini Image Generation connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Gemini Image Generation MCP to TypingMind?

Gemini Image Generation runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Gemini Image Generation MCP provide in TypingMind?

Gemini Image Generation exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Gemini Image Generation MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Gemini Image Generation requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇