PolarHub
  • Agents
  • MCP Servers
  • Skills
  • PolarBear
PolarHub © 2026
MCP Serversapp-automationgemini-image-mcp-server
返回「app-automation」

gemini-image-mcp-server

modelscope·@creating-cat/gemini-image-mcp-server

app-automation0下载LocalModelScope

简介

暂无描述。

MCP Server 详情

来自 ModelScope 索引

日本語版 (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

{
  "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:

{
  "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

相关 MCP Servers(来自「app-automation」)

幻灯片编辑器(FastMCP)

一个由FastMCP驱动的服务器,用于通过编程方式创建、编辑和渲染PowerPoint(PPTX)演示文稿,具有幻灯片创建、内容插入和PNG渲染等功能。

@samos123/pptx-mcp

MCP PDF阅读器

赋予AI代理在项目背景下使用灵活的MCP工具安全读取和提取PDF文件中的信息(文本、元数据、页数)的能力。

@sylphxltd/pdf-reader-mcp

微软365 MCP 服务器

一种模型上下文协议服务器,通过 Graph API 实现与 Microsoft 365 服务(Excel、日历、邮件、OneDrive、Teams 等)的交互,使人工智能助手能够通过自然语言管理 Microsoft 365 资源。

@Softeria/ms-365-mcp-server

Avik-creator

暂无描述。

@Avik-creator/googlecalendarMCP

Caue397

暂无描述。

@Caue397/google-calendar-mcp

deciduus

暂无描述。

@deciduus/calendar-mcp

自动安装

点击按钮会唤起 PolarBear 客户端,并把当前 MCP Server 的 Markdown 详情文档地址传给客户端。

/api/mcps/creating-cat-gemini-image-mcp-server/markdown
打开 PolarBear 安装查看 Markdown 文档

手动安装

在 PolarBear 或其他支持 MCP 的客户端中,新建 MCP Server,并参考下方来源或安装提示配置。

* 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 Name | Description | Default 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. | …

基本信息

分类
app-automation / image-and-video-processing / content-management-systems
运行方式
No
许可证
MIT License
详情文件
creating-cat-gemini-image-mcp-server.md