gyuha
MCP Servergyuhapublic

mcp google gemini image generation

通过 Google Gemini API 实现基于文本提示的图像生成功能,支持多种配置和上下文集成。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
JavaScript
Language
-
License

About This Server

通过 Google Gemini API 实现基于文本提示的图像生成功能,支持多种配置和上下文集成。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

MCP Google Gemini Image Generation

MCP server for generating images using Google's Gemini API with Context7 integration.

Features

  • Generate images from text prompts using Google Gemini API
  • Save generated images to a specified directory
  • Configure different Gemini models for image generation
  • Context7 integration with sequential thinking capability
  • Supports both programmatic use and CLI interface

Installation

npm install -g mcp-google-gemini-image-generation

Or use it directly with npx:

npx mcp-google-gemini-image-generation

Configuration

Create a .env file in your project directory (you can copy from .env.example):

# Google Gemini API Key
GEMINI_API_KEY=your_api_key_here

# Output directory for images
OUTPUT_DIR=./output

# Default model for image generation
DEFAULT_MODEL=gemini-2.0-flash-preview-image-generation

Usage

Using in VS Code with MCP Extension

  1. Make sure you have the MCP Extension installed in VS Code
  2. Add the server to your MCP configuration:
{
  "servers": {
    "gemini-image-generation": {
      "command": "npx",
      "args": ["-y", "mcp-google-gemini-image-generation"]
    }
  }
}
  1. Use it in VS Code by providing context:
prompt: "Create an image of a dragon flying over a magical forest"
outputPath: "./images"
outputFilename: "dragon.png"
model: "gemini-2.0-flash-preview-image-generation"

Using with CLI

npx mcp-google-gemini-image-generation --api-key YOUR_API_KEY --output-dir ./images --model gemini-2.0-flash-preview-image-generation

Using Sequential Thinking

This MCP server includes a sequential thinking tool that helps break down complex image generation tasks:

{
  "thoughtNumber": 1,
  "totalThoughts": 3,
  "thought": "First, let's consider the key elements needed in this fantasy scene...",
  "nextThoughtNeeded": true
}

API Reference

Context Parameters

ParameterDescriptionRequiredDefault
promptThe text prompt to generate an image fromYes-
modelThe Gemini model to useNogemini-2.0-flash-preview-image-generation
outputPathDirectory to save the generated imageNo./output
outputFilenameFilename for the generated imageNogemini-image-[uuid].png

Tools

generate-image

Generates an image based on text prompt.

Parameters:

  • prompt (required): Text description of the image to generate
  • model: Name of the Gemini model to use
  • outputPath: Directory to save the image
  • outputFilename: Custom filename for the generated image

sequential-thinking

Enables step-by-step complex reasoning for image generation tasks.

Parameters:

  • thought (required): Current thinking step
  • nextThoughtNeeded (required): Whether another thought step is needed
  • thoughtNumber (required): Current thought number
  • totalThoughts (required): Estimated total thoughts needed
  • isRevision: Whether this revises previous thinking
  • revisesThought: Which thought is being reconsidered
  • branchFromThought: Branching point thought number
  • branchId: Branch identifier
  • needsMoreThoughts: If more thoughts are needed

License

ISC

Quick Start

1

Clone the repository

git clone https://github.com/gyuha/mcp-google-gemini-image-generation
2

Install dependencies

cd mcp-google-gemini-image-generation
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownergyuha
Repomcp-google-gemini-image-generation
LanguageJavaScript
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation