MCP Connector

Generate and Edit Images with Gemini

MCP server generating and editing images via Gemini, OpenAI, or Seedream, auto-enhancing short prompts with composition, lighting, and camera detail.


91
Spark score
out of 100
Updated 16 days ago
Source checked Sep 7, 2026
Version 0.13.2
Models
gemini 2 0gpt 4ouniversal

Add to Favorites

Why it matters

Leverage Google Gemini 3 Pro Image to generate and edit high-resolution images with intelligent prompt enhancement. Supports multi-image blending, character consistency, and various aspect ratios for creative control.

Outcomes

What it gets done

01

Generate images from text prompts with advanced enhancement.

02

Edit existing images using natural language instructions.

03

Control image resolution, aspect ratio, and output format.

04

Maintain character consistency across multiple image generations.

Install

Add it to your toolbox

Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-intelligent-image-generator | bash

After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.

Reports

Agent outcome reports

No reports yet

Capabilities

Tools your agent gets

generate_image

Generates and edits images using text prompts with automatic prompt enhancement and high-resolution support.

Overview

Intelligent Image Generator MCP Server

mcp-image is an MCP server for generating and editing images via Gemini, OpenAI, or BytePlus Seedream. Before sending a request to the image model, it rewrites short prompts into detailed, art-directed ones (composition, lighting, camera angle) while preserving the original intent, and returns the generated file as an MCP resource. Use it to generate or edit images from plain-English requests without hand-writing detailed prompts; set SKIP_PROMPT_ENHANCEMENT=true to bypass the rewrite if you already have your own prompt conventions. Gemini needs the least setup; OpenAI may require org verification and Seedream tops out at 2K.

What it does

mcp-image is an MCP server for generating and editing images from Codex, Cursor, Claude Code, or any MCP client, routing requests to Gemini, OpenAI, or BytePlus Seedream. Its distinguishing behavior is prompt enhancement: before sending a request to the image model, it rewrites a short instruction into a more specific prompt, filling in details like composition, lighting, and camera angle while preserving everything you actually asked for - the project's own example expands "a photo of a roast chicken dinner... partway through being carved so you can tell how juicy it is" into a fully art-directed prompt (golden-brown glistening skin, tender meat, glistening juices, shallow depth of field) without inventing new subject matter. The more detail you provide up front, the less it changes.

When to use - and when NOT to

Use it when you want an AI assistant to generate or edit real image files without hand-writing detailed prompts yourself - the enhancement step exists specifically to close the gap between a plain-English ask and what an image model actually needs to produce a good result. Gemini is the default and needs the least setup (and is the only provider with Google Search grounding for current-information scenes); OpenAI supports the same 1K/2K/4K sizes but may require organization verification before it can generate images; BytePlus Seedream tops out at 2K and only accepts PNG/JPEG for editing. If you already have prompt-writing conventions you prefer, or want the model to see your exact wording unmodified, set SKIP_PROMPT_ENHANCEMENT=true to bypass the rewrite entirely. Input images for editing must be PNG, JPEG, or WebP under 10MB.

Inputs and outputs

Input is a natural-language description or editing instruction, optionally with an absolute path to a source image (for edits), an aspect ratio (from square through ultra-wide 21:9 and tall panels), an image size, and flags like blendImages, maintainCharacterConsistency, or useWorldKnowledge for historical/factual accuracy. Output is a generated or edited image file written to a configured output directory and returned to the assistant as an MCP resource - IMAGE_OUTPUT_DIR should be set to an absolute path in the MCP config, since the server's working directory (and therefore the meaning of a relative path) depends on which client launches it.

Integrations

{
  "mcpServers": {
    "mcp-image": {
      "command": "npx",
      "args": ["-y", "mcp-image"],
      "env": {
        "GEMINI_API_KEY": "your_gemini_api_key_here",
        "IMAGE_OUTPUT_DIR": "/absolute/path/to/images"
      }
    }
  }
}

Requires Node.js 22+ and an API key for at least one provider (GEMINI_API_KEY, OPENAI_API_KEY, or ARK_API_KEY for Seedream); documented configs exist for Codex, Cursor, and Claude Code (claude mcp add mcp-image --env ... -- npx -y mcp-image, with --scope user for every project). Multiple providers can be configured simultaneously and selected per request. The repository also ships a standalone Agent Skill teaching the same prompt-writing approach for assistants that already have their own image tool, installable separately with npx mcp-image skills install --path <skills-directory>.

Who it's for

Developers and teams using an MCP-compatible AI assistant who want it to generate or edit real product photos, illustrations, or scenes from a short natural-language request - especially when the difference between a flat description and a well-art-directed prompt matters for the result. It's released under the MIT license.

Source README

MCP Image Generator 🍌

Generate and edit images from Codex, Cursor, Claude Code, or any MCP client. mcp-image adds visual direction to your request before sending it to Gemini, OpenAI, or BytePlus Seedream.

npm version
npm downloads
License: MIT

Tell it what image to create or what to change in an existing image, and what it is for. The result is saved to disk and returned to your assistant.

What It Does

Before generating an image, mcp-image rewrites short requests into more specific prompts. It keeps what you asked for and fills in details such as composition, lighting, and camera angle. The more detail you provide, the less it changes.

You ask:

"A photo of a roast chicken dinner for a recipe site. It should look like it was actually cooked, and it should be partway through being carved so you can tell how juicy it is."

mcp-image sends to the image model:

"... a beautifully roasted whole chicken, golden-brown and glistening, resting on a rustic wooden cutting board. One leg is partially carved, revealing tender, succulent white meat and rich, glistening juices pooling around the carving knife ... shallow depth of field focused on the carved chicken."

Generated with Gemini using the default fast quality preset.

What carried through:

  • for a recipe site: one clear subject, with everything else kept subordinate
  • actually cooked: uneven browning and juices across the board
  • partway through being carved: the cut face and slices beside it
  • how juicy it is: close framing and shallow depth of field around the cut
Compare the same request with prompt enhancement turned off Baseline result with prompt enhancement turned off

Baseline from the same request, with prompt enhancement disabled.

Set SKIP_PROMPT_ENHANCEMENT=true to send the original prompt to the image model unchanged.

Quick Start

You need Node.js 22 or later, an MCP-compatible client, and an API key for one image provider.

1. Get an API key

All three providers generate and edit images. Gemini is the default and requires the least configuration.

Provider Image size Output format Setup
Gemini (default) 1K, 2K, 4K Automatic Get a key, then set GEMINI_API_KEY
OpenAI 1K, 2K, 4K PNG or JPEG Get a key, then set IMAGE_PROVIDER=openai and OPENAI_API_KEY
BytePlus Seedream 1K, 2K PNG or JPEG Get an AP region key, then set IMAGE_PROVIDER=seedream and ARK_API_KEY

Google Search grounding is available with Gemini only. OpenAI may require organization verification before it can generate images.

The examples below use Gemini. Replace the provider settings if you prefer OpenAI or Seedream.

2. Configure your MCP client

Codex

Add this to ~/.codex/config.toml:

[mcp_servers.mcp-image]
command = "npx"
args = ["-y", "mcp-image"]

[mcp_servers.mcp-image.env]
GEMINI_API_KEY = "your_gemini_api_key_here"
IMAGE_OUTPUT_DIR = "/absolute/path/to/images"
Cursor

Add this to ~/.cursor/mcp.json for all projects, or .cursor/mcp.json in a project:

{
  "mcpServers": {
    "mcp-image": {
      "command": "npx",
      "args": ["-y", "mcp-image"],
      "env": {
        "GEMINI_API_KEY": "your_gemini_api_key_here",
        "IMAGE_OUTPUT_DIR": "/absolute/path/to/images"
      }
    }
  }
}
Claude Code

Run this in your project directory:

claude mcp add mcp-image --env GEMINI_API_KEY=your-api-key --env IMAGE_OUTPUT_DIR=/absolute/path/to/images -- npx -y mcp-image

Add --scope user after mcp-image to make it available in every project.

Never commit API keys to version control. Use an absolute IMAGE_OUTPUT_DIR in MCP configuration because the server's working directory depends on the client. If omitted, images are written to ./output relative to that working directory.

3. Generate an image

Restart your MCP client after changing its configuration, then ask your AI assistant:

Generate a product photo of a ceramic coffee mug on a wooden desk.

The generated file is saved in the configured output directory and returned to the assistant as an MCP resource.

Run mcp-image from a local checkout
pnpm install
pnpm run build

Configure the MCP client to run the local build instead of npx -y mcp-image:

node /absolute/path/to/mcp-image/dist/index.js

More Examples

Edit an existing image

Give the assistant an absolute path to the source image:

Edit /path/to/image.jpg so the person is facing right.

Control the result

  • Generate a high-quality product photo of a smartphone with clear text on the screen.
  • Generate a cinematic desert landscape in a 21:9 aspect ratio.
  • Keep the knight's appearance consistent with the previous image.

See the tool reference for the options your assistant can pass explicitly.

Configuration

Changing the provider changes both prompt enhancement and image generation. The way you ask for an image stays the same.

Quality

IMAGE_QUALITY accepts fast (default), balanced, or quality. Set it in the MCP server environment:

IMAGE_QUALITY=balanced

A request-level quality option takes precedence. Each provider maps the three values to its own image settings.

Environment variables

Variable Default Description
IMAGE_PROVIDER gemini Default provider: gemini, openai, or seedream
GEMINI_API_KEY - API key for Gemini
OPENAI_API_KEY - API key for OpenAI
ARK_API_KEY - ModelArk AP API key for Seedream
IMAGE_OUTPUT_DIR ./output Directory where generated images are saved; use an absolute path in MCP configuration
IMAGE_QUALITY fast Default quality preset: fast, balanced, or quality
SKIP_PROMPT_ENHANCEMENT false Set to true to send prompts through unchanged

You can configure keys for more than one provider and switch per request. A request-level provider option takes precedence over IMAGE_PROVIDER.

Tool Reference

Your MCP client calls this tool for you. Open the reference when you need to check an option or provider limitation.

generate_image parameters
Parameter Type Required Description
prompt string Yes Image description or editing instruction
quality string No fast, balanced, or quality; overrides IMAGE_QUALITY
provider string No gemini, openai, or seedream; overrides IMAGE_PROVIDER
inputImagePath string No Absolute path to an input image for editing
fileName string No Output filename; .png, .jpg, or .jpeg selects the format for OpenAI and Seedream
aspectRatio string No 1:1 (default), 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 1:8, 4:1, or 8:1
imageSize string No 1K, 2K, or 4K; availability depends on the provider
blendImages boolean No Add blending guidance when combining visual elements
maintainCharacterConsistency boolean No Keep a character's appearance consistent across images
useWorldKnowledge boolean No Add context for historical figures, landmarks, and factual scenes
useGoogleSearch boolean No Gemini only. Use Google Search grounding for current information
purpose string No Intended use, such as cookbook cover or social media post

Troubleshooting

API key not found

Check that the key for the selected provider is present in the MCP server's environment:

  • Gemini: GEMINI_API_KEY
  • OpenAI: OPENAI_API_KEY
  • Seedream: ARK_API_KEY

Restart the MCP client after changing its configuration.

Input image file not found

Use an absolute path and make sure the MCP server can read the file. Input images can be PNG, JPEG, or WebP and must be no larger than 10 MB. Seedream editing accepts PNG and JPEG only.

Provider rejects a request

Check the requested size in the provider table. useGoogleSearch works with Gemini only, and Seedream does not support 4K. For OpenAI permission errors, check your organization settings. For quota or rate-limit errors, check the selected provider account.

Image Generation Prompt Skill

This repository also includes an Agent Skill for assistants that already have access to an image generation tool. It teaches the prompt-writing approach used by mcp-image and works independently of this server.

Install it with:

npx mcp-image skills install --path <skills-directory>

For example, use ~/.codex/skills, ~/.cursor/skills, or ~/.claude/skills as the destination.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.