PM

piephai/mcp-image-optimizer

Developer tools
11 stars 2 forks Quality 74 Trend 18MIT

A model context protocol server for image optimization. Process images from URLs or local files with advanced transformations powered by Sharp

Overview

A Model Context Protocol server for image optimization. Process images from URLs or local files with advanced transformations powered by Sharp. - 🖼️ Process images from URLs or local files - 🔄 Resize, rotate, flip, blur, sharpen, and more - 📦 Batch process multiple images - 🎨 Convert between JPEG, PNG, WebP, AVIF, TIFF - ✂️ Auto-crop borders and whitespace - 🎯 Smart crop with attention detection - 🌫️ Generate low-quality placeholders (LQIP) - 💧 Add watermarks (image or text) with full control - 🌟 Generate favicons in all required sizes and formats Add to your Claude Desktop config file: - : ~/Library/Application Support/Claude/claude_desktop_config.json - : %APPDATA%\Claude\claude_desktop_config.json - : ~/.config/Claude/claude_desktop_config.

README

MCP Image Optimizer

A Model Context Protocol server for image optimization. Process images from URLs or local files with advanced transformations powered by Sharp.

Features

  • 🖼️ Process images from URLs or local files
  • 🔄 Resize, rotate, flip, blur, sharpen, and more
  • 📦 Batch process multiple images
  • 🎨 Convert between JPEG, PNG, WebP, AVIF, TIFF
  • ✂️ Auto-crop borders and whitespace
  • 🎯 Smart crop with attention detection
  • 🌫️ Generate low-quality placeholders (LQIP)
  • 💧 Add watermarks (image or text) with full control
  • 🌟 Generate favicons in all required sizes and formats

Installation

Usage Examples

Ask your AI assistant:

  • “Optimize ~/Desktop/photo.jpg to 800px width”
  • “Convert https://images.pexels.com/photos/32206277/pexels-photo-32206277.jpeg to WebP”
  • “Batch optimize all images in ~/Downloads/”
  • “Create a 200x200 thumbnail with smart crop”
  • “Generate a placeholder for lazy loading”
  • “Add my company logo as watermark to product images”
  • “Add ‘Copyright 2025’ text watermark”
  • “Generate all favicon sizes from my logo”

Available Tools

Path Support

  • ✅ URLs: https://example.com/image.jpg
  • ✅ Absolute paths: /Users/name/Desktop/image.jpg
  • ✅ Home directory: ~/Desktop/image.jpg
  • ⚠️ Relative paths: Works with cwd config setting

To use relative paths, add a working directory:

{
  "command": "npx",
  "args": ["mcp-image-optimizer"],
  "cwd": "/Users/yourname/Desktop"
}

Requirements

  • Node.js 22+ (npx handles this automatically)
  • Compatible MCP client

Troubleshooting

“Command not found”

  • Make sure Node.js is installed: node --version
  • Try the global install method

“File not found”

  • Use absolute paths: /Users/name/Desktop/image.jpg
  • Check file permissions

“MCP tools not available”

  • Restart your MCP client after configuration
  • Check config file is valid JSON

License

MIT

View the full README on GitHub

Install

npx mcp-image-optimizer
New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "image-optimizer": { "command": "npx", "args": ["mcp-image-optimizer"] } } }