mcpGetImage
An MCP server for generating candy product images with white backgrounds and removing backgrounds to produce transparent WebP images, using OpenAI's image API and rembg.
README
mcpGetImage
Servidor MCP en Python para pedir imágenes de dulces, refinarlas como fotografía de producto sobre fondo blanco y quitarles el fondo con rembg/U2-Net, inspirado en el flujo de PACA.
El flujo usa Image API porque la guía de OpenAI la recomienda cuando se necesita crear una imagen desde un solo prompt. El modelo por defecto es gpt-image-2, configurable con OPENAI_IMAGE_MODEL.
Requisitos
- Python 3.10+
OPENAI_API_KEY- La primera vez,
rembgdescarga el modelo U2-Net localmente.
Instalación
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .env
Edita .env y agrega tu OPENAI_API_KEY.
Ejecutar como servidor MCP
mcp-get-image
Ese comando es para clientes MCP y usa stdio. Si lo corres directo en la terminal, se queda esperando mensajes JSON-RPC del cliente; no es un chat interactivo. Para probar manualmente usa la CLI de abajo.
Configuración típica para un cliente MCP:
{
"mcpServers": {
"mcp-get-image": {
"command": "/Users/djoker/code/mcpGetImage/.venv/bin/mcp-get-image"
}
}
}
Herramientas MCP
refine_candy_prompt: convierte una petición como "necesito imágenes de dulces" en un prompt de producto más preciso.generate_candy_image: genera la imagen con OpenAI, pide fondo blanco, remueve el fondo y guarda un WebP transparente.remove_background: procesa una imagen local existente y la exporta como WebP transparente.
CLI local
Sirve para probar sin cliente MCP:
mcp-get-image-cli "gomitas enchiladas mexicanas en bolsa transparente"
Mientras genera, la CLI escribe progreso en stderr:
[ 20%] Refining candy prompt for white-background product photography.
[ 40%] Calling OpenAI Images. This is usually the slowest step.
[ 60%] White-background image saved: ...
[ 80%] Removing background with rembg/U2-Net.
[100%] Transparent WebP saved: ...
OpenAI no expone porcentaje interno real durante una llamada normal a images.generate, así que el 40% puede tardar. Ese mensaje significa que la imagen ya fue solicitada y estamos esperando respuesta del modelo.
Para ver el prompt sin generar imagen ni gastar API:
mcp-get-image-cli --prompt-only "gomitas enchiladas mexicanas en bolsa transparente"
Para quitar fondo a una imagen local:
mcp-get-image-cli --remove-background outputs/mi_imagen.png
Los archivos se guardan por defecto en ./outputs.
Notas
El API oficial de OpenAI Images permite generar imágenes desde texto con modelos GPT Image y devuelve base64 para los modelos GPT Image. Este proyecto usa images.generate, configurable con OPENAI_IMAGE_MODEL; por defecto usa gpt-image-2.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.