Image Edit MCP Server
AI-powered image editing and generation using Google's Gemini models, including image understanding, photorealistic generation, product image cleanup, and smart cropping.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Image Edit MCP Server Generate a photorealistic red ceramic mug on white background"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Image Edit MCP Server
AI-powered image editing and generation server using the Model Context Protocol (MCP). Provides tools for intelligent image manipulation, cleanup, and generation using Google's Gemini AI models.
Features
Image Understanding: Ask questions about images using Gemini 2.5 Pro vision
Image Generation: Create photorealistic images from text using Imagen 4.0
Product Image Cleanup: Remove watermarks while preserving backgrounds
White Background Mode: E-commerce ready product images
Smart Crop: Center crop to 1:1 square format
Intelligent Expand: Fill borders with AI-matched backgrounds
AI Quality Reviews: Automatic quality assessment for generated/edited images
Related MCP server: Nano-Banana MCP Server
Tools
1. understand_image
Ask questions about image content using Gemini 2.5 Pro vision.
Parameters:
image_source(required): Local file path or URLquestion(optional): Your question about the image
Example:
{
"image_source": "/path/to/image.jpg",
"question": "What is the main product in this image?"
}2. generate_image
Generate photorealistic product images from text descriptions using Imagen AI.
Parameters:
description(required): Detailed image description (max 480 tokens)aspect_ratio(optional):1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9(default:1:1)
Example:
{
"description": "Red ceramic coffee mug, white background, studio lighting, macro lens, sharp focus, professional product photography, 4K",
"aspect_ratio": "1:1"
}3. clean_product_image
Remove watermarks and overlays while preserving original background.
Parameters:
input_path(required): Local file path or URLaspect_ratio(optional): Output aspect ratio (default:1:1)additional_instructions(optional): Extra instructions for AI
4. clean_product_image_white_bg
Remove watermarks and replace background with pure white + studio lighting.
Parameters:
input_path(required): Local file path or URLaspect_ratio(optional): Output aspect ratio (default:1:1)additional_instructions(optional): Extra instructions for AI
5. crop_image_to_square
Fast center crop to 1:1 square (1024x1024). No AI processing.
Parameters:
input_path(required): Local file path or URL
6. expand_image_to_square
Intelligently fill borders to create 1:1 square while preserving original content.
Parameters:
input_path(required): Local file path or URL
Installation
Prerequisites
Node.js 18+
pnpm (recommended) or npm
Google Gemini API key
Setup
Clone or download this repository:
cd ~/projects
git clone <repository-url> image-edit-mcp
cd image-edit-mcpInstall dependencies:
pnpm installCreate
.envfile:
cp .env.example .envAdd your Gemini API key to
.env:
GEMINI_API_KEY=your_api_key_here
# Optional: Use custom Gemini endpoint (e.g., proxy)
# GEMINI_BASE_URL=https://api2.aigcbest.topGet your API key from: https://aistudio.google.com/app/apikey
Note: The generate_image tool always uses the official Google API as imagen models are not supported by proxy endpoints. Other tools will use GEMINI_BASE_URL if configured.
Build the project:
pnpm buildConfiguration
Claude Desktop
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"image-edit": {
"command": "node",
"args": ["/Users/shun/projects/image-edit-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key_here"
}
}
}
}With custom Gemini endpoint (optional):
{
"mcpServers": {
"image-edit": {
"command": "node",
"args": ["/Users/shun/projects/image-edit-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key_here",
"GEMINI_BASE_URL": "https://api2.aigcbest.top"
}
}
}
}Note: generate_image always uses official Google API (imagen models not supported by proxies).
Other MCP Clients
The server communicates via stdio and can be used with any MCP-compatible client. Configure according to your client's documentation.
Output
All processed images are saved to your system's temporary directory with unique filenames:
macOS/Linux:
/tmp/image-edit-mcp/Windows:
C:\Users\{user}\AppData\Local\Temp\image-edit-mcp\
Output format: High-quality WebP (lossless, quality 100)
API Keys
Gemini API Key
Required for all image operations
Free tier: 15 requests per minute, 1500 requests per day
Get your key: https://aistudio.google.com/app/apikey
Note on Imagen
The generate_image tool uses a hardcoded official Google API key for compatibility. For production use, you should obtain your own Imagen API access.
Development
Build
pnpm buildWatch mode
pnpm devProject Structure
image-edit-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── config.ts # Environment configuration
│ ├── types.ts # TypeScript type definitions
│ └── tools/
│ └── images.ts # Image editing tools
├── prompts/ # AI prompts for image operations
├── dist/ # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── README.mdTroubleshooting
"GEMINI_API_KEY is required" error
Make sure your .env file contains a valid Gemini API key, or configure it in your MCP client settings.
Build errors
Try clearing the build cache and reinstalling:
rm -rf node_modules dist
pnpm install
pnpm buildImage generation fails
Check your API key is valid
Verify you haven't exceeded rate limits
Ensure your prompt is under 480 tokens
License
MIT
Credits
Built with:
Sharp for image processing
Available Tools
13 toolsclean_product_imageA
Remove watermarks, logos, and overlays while preserving original background and lighting. Keeps product features intact, maintains natural photography style. Supports aspect ratio adjustment (default 1:1). Outputs high-res WebP with AI review.
Inputs: input_path (required), aspect_ratio, additional_instructions.
clean_product_image_white_bgA
Remove watermarks/overlays and replace background with pure white (#FFFFFF) + professional studio lighting. E-commerce ready for Amazon/eBay/Shopify. Preserves product shape, colors, features. Supports aspect ratio adjustment (default 1:1). Outputs high-res WebP with AI review.
Inputs: input_path (required), aspect_ratio, additional_instructions.
crop_image_to_squareA
Crop image to 1:1 square using center crop. Uses the shorter edge as crop size, then scales to 1024x1024. Fast, lossless operation without AI. Outputs high-res WebP.
Inputs: input_path (required).
edit_imageA
Edit images based on text instructions using AI with support for multiple reference images. Modify colors, add/remove objects, change backgrounds, adjust lighting, apply artistic effects, or combine multiple images. Uses reference image(s) + text prompt for intelligent editing. Supports various aspect ratios. Outputs high-res WebP with AI quality review.
Inputs: prompt (required), input_paths, aspect_ratio.
expand_image_to_squareA
Convert any aspect ratio to 1:1 square by intelligently filling border areas while preserving original content pixel-perfect. AI matches background style (solid/gradient/textured/environmental), continues lighting and perspective with seamless blending. Outputs 1024x1024 WebP with AI review.
Inputs: input_path (required).
generate_bracelet_model_wearingA
Generate realistic wrist close-up photo showing bracelet worn on model's wrist. Creates authentic luxury brand lifestyle photography helping customers visualize wearing the bracelet. Maintains accurate bead count and structure from references.
Inputs: reference_image_urls (required), aspect_ratio.
generate_bracelet_tabletop_elegantB
Generate elegant minimalist lifestyle photo of a bracelet on pure white tabletop. Creates clean, sophisticated product photography perfect for modern luxury e-commerce. Maintains accurate bead count and structure from references.
Inputs: reference_image_urls (required), aspect_ratio.
generate_bracelet_white_backgroundA
Generate premium white background product photo of a bracelet from reference images. Creates professional studio photography with pure white background, top-down circular layout. Maintains accurate bead count and structure from references.
Inputs: reference_image_urls (required), aspect_ratio.
generate_imageA
Generate photorealistic product images from text descriptions using Imagen AI. Supports 5 aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4), outputs high-res WebP with AI quality review.
Prompt structure: [Subject] + [Background] + [Style/modifiers] Example: 'Red ceramic mug, white background, studio lighting, macro lens, sharp focus, 4K'
Modifiers: camera angles (aerial/45-degree/eye level), lighting (natural/studio/dramatic), focus (sharp/soft/depth of field), lenses (macro/wide-angle), quality enhancers (4K/photorealistic/professional).
Inputs: description (required), aspect_ratio.
generate_necklace_model_wearingA
Generate realistic neck close-up photo showing necklace worn on model. Frame from jawline/chin down to upper chest, focusing on elegant neck area and jewelry. Creates authentic luxury brand campaign photography.
Inputs: reference_image_urls (required), aspect_ratio.
generate_necklace_tabletop_elegantA
Generate elegant minimalist lifestyle photo of a necklace on pure white tabletop. Creates clean, sophisticated product photography perfect for modern luxury e-commerce. Maintains exact product design with accurate chain structure from references.
Inputs: reference_image_urls (required), aspect_ratio.
generate_necklace_white_backgroundA
Generate premium white background product photo of a necklace from reference images. Creates professional studio photography with pure white background, suitable for e-commerce. Maintains exact product design from references while removing watermarks/logos.
Inputs: reference_image_urls (required), aspect_ratio.
understand_imageA
Ask questions about image content using Gemini 2.5 Pro vision. Extract text, identify objects, describe products, check quality, or get detailed descriptions. Accepts local file paths or URLs.
Inputs: image_source (required), question.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool has a clear action and subject, but a few close pairs (clean_product_image vs clean_product_image_white_bg and the white-background/tabletop necklace generators) could be confused if descriptions are skimmed. With careful reading, the targets are distinct enough for an agent to choose correctly.
Tool names generally follow a consistent verb_noun snake_case pattern and are readable. The minor abbreviation mismatch (white_bg vs white_background) and the mixed specificity of generation tool names prevent a perfect score.
13 tools is within a reasonable range and the core editing/analysis tools are well-scoped. The six specialized jewelry-generation tools make the set feel slightly broader than the generic 'image edit' server name suggests, but they do serve distinct output needs.
Core image workflows are covered: analyze, generate, edit, clean, crop, and expand. Minor gaps remain (e.g., arbitrary aspect-ratio changes and transparent-background output are not exposed as dedicated tools), though edit_image can approximate them.
Maintenance
Related MCP Connectors
Hosted MCP server for AI photo editing: nothing to install, no desktop photo editor needed.
MCP server for Qwen Image 3 AI image generation
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models. Up to 4 images per call, SVG vectorization, background removal, upscaling and image-to-video. Remote MCP with OAuth, no API keys.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models and 10 tools: up to 4 images per call, SVG vectorization, editing and more. Remote MCP with OAuth, no API keys. Pay per image, no subscription.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.19MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. It allows users to create new images from text, modify existing files, and perform iterative edits through natural language prompts.61,740 npmMIT
- FlicenseNot gradedqualityDmaintenanceA powerful Model Context Protocol (MCP) server for image processing, designed to empower AI models with advanced image manipulation capabilities.1-
- AlicenseAqualityDmaintenanceMCP server for generating and editing images using Google Gemini API, with support for multi-turn iterative refinement.3135 npmMIT