IN

Intelligent Image Generator MCP Server for Professional Images

Transform casual prompts into professional-quality images with an MCP server that enhances AI-generated visuals for fast, reliable results.

Quick Install
npx -y @shinpr/mcp-image

Overview

This MCP (Model Context Protocol) server converts casual, user-friendly prompts into polished, production-ready contexts for image generation models. It sits between client applications and image-generation backends (e.g., diffusion models, hosted APIs) and performs prompt engineering, style normalization, and lightweight post-processing orchestration so models produce consistent, professional outputs with minimal client-side effort.

Designed for teams that need predictable, high-quality images at scale, the server centralizes styling presets, content policies, and transformation logic. Clients send an informal prompt and optional metadata; the server returns a refined prompt, generation parameters, and orchestration instructions that downstream model adapters can execute for fast, reliable results.

Features

  • Centralized prompt professionalization and normalization
  • Style presets (brand, photography, illustration) and parameter templates
  • MCP-compatible endpoints for prompt/context generation
  • Rate-limited, cacheable responses for improved throughput
  • Optional image post-processing hooks (upscale, color adjust, background removal)
  • Health and diagnostics endpoints for monitoring
  • Docker-ready, environment-driven configuration

Installation / Configuration

Prerequisites: Node.js 16+ and npm, or Docker.

Clone and run locally:

git clone https://github.com/shinpr/mcp-image.git
cd mcp-image
npm install
# run in development
npm run dev

Environment variables (example .env):

PORT=8080
MODEL_BACKEND_URL=https://api.example-model.com/v1/generate
MODEL_API_KEY=sk-xxxx
CACHE_TTL_SECONDS=300
STYLE_PRESETS_PATH=./presets.json
MAX_CONCURRENCY=8

Start with Docker:

# build
docker build -t mcp-image .
# run
docker run -p 8080:8080 \
  -e PORT=8080 \
  -e MODEL_BACKEND_URL=https://api.example-model.com/v1/generate \
  -e MODEL_API_KEY=sk-xxxx \
  mcp-image

Configuration file example (presets.json):

{
  "brand_photography": {
    "camera": "50mm, f/1.8",
    "lighting": "softbox, front",
    "color_grading": "warm, high-contrast",
    "negative_prompts": ["blurry", "low-res", "text"]
  },
  "illustration_flat": {
    "style": "flat vector",
    "palette": "brand",
    "line_weight": "2px"
  }
}

Available Resources

Endpoints

MethodPathDescription
POST/mcp/contextConvert casual prompt + metadata into generation context and parameters
POST/mcp/generateFull pipeline: professionalize prompt, call model backend, return image reference
GET/healthService health and basic metrics
GET/presetsList available style presets

Tools exposed by the server (logical operations available via MCP context):

  • professionalizePrompt: expand, disambiguate, and inject style/negative tokens
  • applyStylePreset: merge named preset into generation parameters
  • parameterTuner: adjust CFG/sampling/steps based on desired fidelity/time tradeoffs
  • postProcessHooks: pipeline steps for upscaling, denoising, color correction

Example request to /mcp/context:

POST /mcp/context
Content-Type: application/json

{
  "prompt": "a sleek coffee cup on a wooden table",
  "preset": "brand_photography",
  "aspect_ratio": "16:9",
  "quality": "high"
}

Example response:

{
  "refined_prompt": "A high-resolution product photo of a sleek ceramic coffee cup on a warm wooden table. 50mm lens, shallow depth of field, softbox lighting, warm color grading, high contrast, crisp detail.",
  "generation_params": {
    "width": 1920,
    "height": 1080,
    "steps": 40,
    "guidance_scale": 7.5,
    "negative_prompts": ["blur", "noise", "text"]
  },
  "post_process": ["upscale:2x", "color_grade:brand"]
}

Use Cases

  1. E-commerce product hero images

    • Input: “blue running shoes on white”
    • Server output: refined prompt with studio lighting, white seamless backdrop, consistent product scale, and negative prompts to avoid text/logos; then orchestration to upscale and crop for hero banner sizes.
  2. Marketing banners and social ads

    • Input: “team celebration, happy, confetti”
    • Server output: cinematic color grading, shallow depth-of-field for subject emphasis, aspect ratios for common ad slots; returns generation params tuned for fast iteration.
  3. Product mockups for design reviews

    • Input: “app UI on phone mockup”
    • Server output: photorealistic phone render preset, camera angle and shadow consistency, optional PSD/transparent background post-processing.
  4. Social media avatars and illustrations

    • Input: “stylized portrait, anime”
    • Server output: apply illustration_flat preset, restrict text and watermark artifacts, provide vector-friendly options and post-process for crisp line art.

Notes for Developers

  • The server is backend-agnostic: swap MODEL_BACKEND_URL to point to a hosted API or an internal model adapter.
  • Caching: commonly used prompt+preset combinations are cached to speed repeated requests.
  • Extendability: add presets by editing presets.json or via the /presets management endpoint.
  • Security: enforce content policy checks before sending prompts to model backend; configure API keys through environment variables.

This MCP server is intended as a middleware layer that standardizes prompt quality across teams and production pipelines, reducing variance and improving visual consistency for downstream image generators.

Tags:media