TG

trevoruptain/gemini-image-mcp

Productivity workflow

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

11 stars 3 forks 品質 64 トレンド 18

Google Nano Banana Pro(Antigravityのイメージツールより)を使用して画像を生成、保存、再利用するCursor用のMCPサーバー

概要

MCP (Model Context Protocol) サーバは、AI アシスタントが Google の Gemini API を使用して画像を生成および編集することを可能にするウェブ開発用に最適化しました。 MCP サーバーを Cursor に追加した後、AI をプロンプトで生成したり、画像を編集したりできます。エージェントは残りを行います。 - - 側面の比率プリセット(ヒーロー、正方形、ポートレート、ランドスケープ、バナー、モバイル)で画像を生成し、最大4Kまでの解像度 - 自然言語でワークスペース内の既存の画像を編集 - 一般的なWeb開発ユースケース用に設計されたプリセット - MCPリソースとして生成画像へのアクセス - 画像を直接HTTPアクセスするためのエクスプレスサーバー - Node.js 18 + - 画像生成にアクセスできるGoogle Gemini APIキー MCP のインスペクタを使用して、サーバーのテストとデバッグを行います。 これは1. TypeScriptコード2をビルドします。 ブラウザ3でMCPインスペクタを起動します。 ツールをテストしたり、リソースを表示したり、リクエスト/レスポンスをデバッグしたりできます。 .env ファイルが GEMINI API KEY で設定されていることを確認してください.

概要(AI 翻訳)

MCP (Model Context Protocol) サーバは、AI アシスタントが Google の Gemini API を使用して画像を生成および編集することを可能にするウェブ開発用に最適化しました。

MCP サーバーを Cursor に追加した後、AI をプロンプトで生成したり、画像を編集したりできます。エージェントは残りを行います。

##特徴

  • 画像生成 - アスペクト比プリセット(ヒーロー、正方形、ポートレート、風景、バナー、モバイル)で画像を生成し、最大4Kまでの解像度
  • 画像編集 - 自然言語でワークスペースに既存の画像を編集する -Web最適化 - 一般的なWeb開発ユースケース用に設計されたプリセット
  • MCPリソース - MCPリソースとして生成された画像へのアクセス -Static File Server - 直接HTTPアクセス用のExpressサーバー

前提条件

  • Node.js 18 +
  • 画像生成にアクセスできるGoogle Gemini APIキー

インストール

設定

環境変数

| 変数 | 必須 | デフォルト | 説明 | | ----- | ----- | ----- | ----- | ----- | ----- | | [[[T0] | はい | | 御社のGoogle Gemini APIキー | | 【`GEMINI_IMAGE_MODEL` | ナンバー | [`gemini-3-pro-image-preview`] | ジオミニ映像作品集 `gemini-2 を使う.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Gemini Image MCP

An MCP (Model Context Protocol) server optimized for web development that enables AI assistants to generate and edit images using Google’s Gemini API.

After adding the MCP server to Cursor, just prompt the AI to generate or edit images for you - the agent will do the rest.

Features

  • Image Generation - Generate images with aspect ratio presets (hero, square, portrait, landscape, banner, mobile) and resolutions up to 4K
  • Image Editing - Edit existing images in your workspace with natural language
  • Web-Optimized - Presets designed for common web development use cases
  • MCP Resources - Access generated images as MCP resources
  • Static File Server - Express server for direct HTTP access to images

Prerequisites

Installation

git clone https://github.com/yourusername/gemini-image-mcp.git
cd gemini-image-mcp
npm install
npm run build

Configuration

Environment Variables

Variable Required Default Description
GEMINI_API_KEY Yes - Your Google Gemini API key
GEMINI_IMAGE_MODEL No gemini-3-pro-image-preview Gemini image model to use. Use gemini-2.5-flash-image for the GA model.
PORT No 3001 Port for the Express static file server

Cursor

Add to your ~/.cursor/mcp.json:

{
  "mcpServers": {
    "gemini-image": {
      "command": "node",
      "args": ["/path/to/gemini-image-mcp/dist/server.js"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Antigravity

Add to your MCP server configuration:

{
  "gemini-image": {
    "command": "node",
    "args": ["/path/to/gemini-image-mcp/dist/server.js"],
    "env": {
      "GEMINI_API_KEY": "your-api-key-here"
    }
  }
}

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "gemini-image": {
      "command": "node",
      "args": ["/path/to/gemini-image-mcp/dist/server.js"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Testing with MCP Inspector

Use the MCP Inspector to test and debug your server:

npm run inspect

This will:

  1. Build the TypeScript code
  2. Launch the MCP Inspector in your browser
  3. Allow you to test tools, view resources, and debug requests/responses

Make sure your .env file is set up with GEMINI_API_KEY before running the inspector.

Tools

generate_image

Generate an image from a text prompt, optionally using reference images to guide the style or composition. The AI must determine the correct output path in your project before calling this tool.

GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "gemini-image": { "command": "node", "args": ["/path/to/gemini-image-mcp/dist/server.js"], "env": { "GEMINI_API_KEY": "your-api-key-here" } } } }