Skip to main content
Glama

imaginate-mc

OpenAI GPT ImageとGoogle Gemini(Nano Banana)で画像を生成・編集するMCPサーバーです。stdio上で動作し、すべての画像をディスクに保存して、ファイルパスを返します。これにより、アシスタントはその結果を引き続き作業に利用できます。

できること

プロバイダーごとに分けられた6つのツール:

ツール

説明

openai_generate_image

GPT Image モデルでテキストから画像を生成

openai_edit_image

1枚の画像をを編集、マスクでインペインティング、複数の参照画像を合成

openai_list_image_models

モデルID、強み、制限を一覧表示

gemini_generate_image

Nano Banana モデルでテキストから画像を生成。Google Search のグラウンディングも選択可能

gemini_edit_image

編集、スタイルマ変換、セマンティックなインペインティング、複数画像の画像を合成

gemini_list_image_models

モデルID、参照画像の上上限、解像度ティアを一表

設定したキーに対応するツールだけが登録されます。OPENAI_API_KEY だけを設定し、それ以外の何も設定していない場合、アシスタントには3つのツールだけが表示され、どのツールもGoogle側のキー欠落で失敗したくなることはありません。これが、provider 引数を使う単一ツールにするのではなく、ツールをプロバイダーごとに分けた主な理由です。

Related MCP server: MCP OpenAI Image Generation Server

要件

  • Node.js 3 (20以降)

  • OpenAI API キー、Gemini API キー、またはその両方

GPT Image モデルを利用するには、OpenAI API の組織認証が必要です。認証を済ませていない場合、OpenAIはリクエストを拒否し、、サーバージがその旨を通知します。

接続

npx で公開済みのパッケージを実行します。リポジトリをクローンしたり、パッケージをグローバルにインストールしたりする必要はありません。

npx -y @pinkpixel/imaginate-mcp

サーバーをクライアントの設定に追加します。Claude Desktop の場合は claude_desktop_config.json を編集し、Claude Code の場合はプロジェクト内の .mcp.json か、ユーザー設定の .mcp.json を使います。

{
  "mcpServers": {
    "imaginate": {
      "command": "npx",
      "args": ["-y", "@pinkpixel/imaginate-mcp"],
      "env": {
        "OPENAI_API_KEY": "sk-...",
        "GEMINI_API_KEY": "...",
        "IMAGINATE_OUTPUT_DIR": "~/Pictures/imaginate"
      }
    }
  }
}

設定を編集したら、クライアントを再起動します。画像ツールが表示されない場合は、imaginate_setup_help を呼び出してみてください。このツールが存在するのはプロバイダーのキーが見つからなかった場合だけです。存在しない?原出?警告 should be: "このツールはプロバイダーのキーが一つも見つからなかった場合にのみ存在し、まだ設定すべきキーの変数を一覧表示します。"

ソースから実行

ローカルでサーバーを開発する場合は、リポジトリをクローンしてビルドします:

git clone https://github.com/pinkpixel-dev/imaginate-mcp.git
cd imaginate-mcp
npm install
npm run build
node dist/index.js

このビルドにMCPクライアントを接続するには、"command": "node" を使い、args に dist/index.js の絶対パスを設定します。

設定

すべての変数は起動時に一度だけ読み込まれ。変更した場合はクライアントを再起動してください。

変数

必須

既定値

説明

OPENAI_API_KEY

いずれか1つが必要

なし

openai_* ツールを登録する

GEMINI_API_KEY

いずれか1つが必要

なし

gemini_* ツールを登録する。GOOGLE_API_KEY でも可

IMAG INATE_OUTPUT_DIR

不要

~/Pictures/imaginate

}} 画像の保存先。先頭の ~ は展開される

IMAGINATE_OPENAI_MODEL

不要

gpt-image-2

呼び出しでモデルが指定されない場合の既定モデル

IMAGINATE_GEMINI_MODEL

不要

gemini-3.1-flash-image

モデルが指定されない場合の既定 Gemini モデル

OPENAI_BASE_URL

不要

OpenAI の既定値

OpenAI 互換のプロキシーを指す

どのツール呼び出しでも、output_dir で保存先を ファイル名 をオーバーライドできます。

ファイルの仕組み

画像は出力ディレクトリに保存されます。サーバーは決して上書きしません。cat.png という名前のファイルが既に存在する場合、cat-1.png、そして cat-2.png になります。

既定のファイル名は openai-a-red-fox-20260825-134512-071.png のような形式になります。これは、プロバイダーのプレフィックス、プロンプトの言葉、タイムスタンプを結合したものです。特定の名前を付けたい場合は filename を渡してください。

編集の元画像はローカルファイルである必要があります。絶対パスを渡してください。このツールはリモートのURLをダウンロードしないため、Web上にあるファイルは先に取得しておいてください。元のソースファイルは読み取り専用で、変更されることはありません。

使用方法

サーバーを接続したら、後は基本的には通常通りアシスタントと会話するだけです。ただ、知っておくと便利なポイントがいくつがあります。

プロバイダーの選択

両方のプロバイターは、それぞれ異なる分野に優れています。

Gemini は、画像内の文字、世界の知識、インフォグラフィックの制作に強く、描く前に Google 検索のグラウンディングもできます。また、インタラクションIDを返すため、画像を再度アップロードすることなく、調整を続けられます。

GPTにも対応しています。 GPT Image は、詳細なレイアウトの指示書にもまた忠実です。サイズ、品質、背景を細々と調整できます。透明背景が必要な場合ってはこれを使えば良いのですが、gpt-image-2 は透明対応が廃止されたため、gpt-image-1.5 以前のモデルが必要です。

Gemini 画像の反復調整

Gemini のすべての結果にインタラクションID が含まれます。次の gemini_edit_image 呼び出しで、previous_interaction_id としてそのまま渡して、画像の再送信を省略できます:

  1. 自分のプロンプトを使って処理 generate_image すると、結果にインタラクションID を取得します。

  2. previous_interaction_id を渡して「横書きにして」というプロンプトで gemini_edit_image を呼び出します。

再アップロードするよりも低コスト scraping で、複数ラウンドの間も画像の一貫性が保たれもします。

編集と合成

両方の *_edit_image ツールは、いずれの同じインターフェースで複数のタスクを扱います。画像パスを1つ渡せばその画像を編集し、複数渡せばそれらを組み合わせて新しいシーンを構成します。

マスクしたインペイントインティングでは、2つのプロバイダーの方法が異なります。OpenAI は実際にアルファチャンネルを持つマスク PNG を渡し、mask として指定する必要があります。Gemini はセマンティックな処理を行うため、「空のみを変更して、他はすべてそのまま」という風に指示するだけで、マスクファイルは不要です。

参照画像の上限は Gemini のモデルにより異なります: Lite で 14 オー、Nano Banana では 10 枚、Pro では 6 枚が。gemini_list_models で確認してください。

開発

npm run build      # compile to dist/
npm run watch      # compile on change
npm run typecheck  # types only, no output
npm test           # compile tests and run them

テストにはNode.js組み込みのテストランナーを使用します。ファイルの命名と保存ロジック、Geminiのレスポンス解析、エラーメージのマッピングをカバーしています。どちらのAPIも呼び出さないため、キーがなくても実行できます。

構成する。

src/
  index.ts               entry point, conditional tool registration
  config.ts              environment parsing
  lib/                   file handling, errors, result formatting, model catalog
  providers/openai/      OpenAI client wrapper and tool definitions
  providers/google/      Gemini client wrapper and tool definitions
tests/

制限事項

  • 画像元はローカルファイルである必要があります。リモートURLには使用できません。

  • ストリーミングと部分的な画像には対応していません。呼び出しは画像が完成されたとき戻ります。

  • Gemini では要求した image 数を確実に守られないため、呼び出しごとに画像 one one を生成を依頼してしてください。OpenAI ツールでは n を許可して、標準で機能します。

  • OpenAI は、複雑なプロンプトで最大2分かかることがあります。これはAPI側の遅延であり、標準的です。

  • Gemini の画像すべてには、目に見えない SynthID のウォーターマークががまれれます。

  • モデルIDと料金は両方すばやく変わります。一覧ツールがはこのバージョンの既知の情報を表示します。それは、あなたのアカウントで実際に届ける範囲と乖離があるます。

ライセンス

Apache 2.0.詳しくは LICENSE を参照してください。

Pink Pixel からたい愛を込めて。

Available Tools

1 tool
imaginate_setup_helpImaginate setup helpA
Read-onlyIdempotent

Explain why this server currently has no image generation tools and how to enable them.

This tool only exists when no image provider API key is configured. Call it if you expected image generation tools and cannot find any.

Args: none.

Returns: The environment variables to set and where to set them.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, and non-destructive behavior. The description adds that the tool returns the environment variables to set and where to set them, plus the precondition for its existence. This gives the agent concrete expectations beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences each carry necessary information: purpose, existence condition, usage trigger, and return value. The structure is front-loaded with the core purpose and contains no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even without an output schema, the description fully covers what the tool does, when to invoke it, and what it returns. For a zero-parameter informational tool, an agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and schema coverage is 100%, so there is nothing meaningful to add. The description redundantly states 'Args: none,' which is harmless but adds no semantic value. The zero-parameter baseline of 4 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific purpose: explaining why the server lacks image generation tools and how to enable them. The conditional existence context makes the tool's role unmistakable even without sibling tools to compare against.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says the tool only exists when no image provider API key is configured, and instructs agents to call it if expected image generation tools cannot be found. This is a clear, actionable when-to-use rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observedimaginate_setup_help

TDQS

A4.2/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool available, there is zero ambiguity in tool selection. The lone tool's purpose is clearly stated and distinct from any hypothetical generation tools it replaces.

Naming Consistency5/5

The single tool name 'imaginate_setup_help' follows a consistent pattern of server name plus action, and since there is only one tool, there are no naming inconsistencies to evaluate.

Tool Count1/5

A server named 'imaginate' with only a setup help tool is severely under-provisioned for its apparent purpose. Image generation typically requires multiple operational tools, so having only one explanatory tool is an extreme mismatch.

Completeness1/5

The server provides no actual image generation capabilities at all—the only tool explains how to configure an API key. This is a severely incomplete surface for the stated domain, leaving agents unable to perform any core task.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers