image-convert-mcp
Click on "Install 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-convert-mcpconvert image.jpg to webp"
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 Convert MCP Server
💡 If this tool saves you time, please consider buying me a coffee! Your support helps maintain and improve this project.
A Model Context Protocol (MCP) server for high-performance image format conversion supporting WebP and AVIF formats with parallel processing capabilities.
🚀 Features
Multiple Format Support: Convert images to WebP, AVIF, or both formats simultaneously
Batch Processing: Process entire directories with configurable parallel workers
Image Resizing: Optional width/height constraints with aspect ratio preservation
Quality Control: Configurable quality settings for both WebP and AVIF
High Performance: Multi-process parallel execution for batch operations
Flexible Input: Supports PNG, JPG, JPEG, TIFF, BMP, and WebP as input formats
Related MCP server: WebP Batch Converter
📋 Requirements
Python 3.11+
MCP Python SDK (
mcp>=1.0.0)Pillow (PIL)
pillow-avif-plugin
libavif-dev (system dependency)
🔧 Installation
Using pip
cd /path/to/image-convert-mcp
pip install -e .Or install requirements directly:
pip install -r requirements.txt💻 CLI Usage
After installation, you can use the image-convert command directly:
# Convert to both WebP and AVIF
image-convert photo.png
# Convert to WebP only
image-convert photo.png -f webp -q 85
# Use a preset
image-convert photo.png --preset thumbnail
# Batch convert a directory
image-convert ./images/ --batch -f webp
# Show compression statistics
image-convert photo.png -f webp --stats
# List available presets
image-convert --list-presetsAvailable Presets
Preset | Description |
| Optimized for web (WebP, quality 80, max 1920px) |
| Small thumbnails (WebP, 300x300) |
| Social media images (1200x630) |
| HD resolution (1920x1080) |
| 4K resolution (3840x2160) |
| High quality archival (both formats) |
| Lossless WebP compression |
| Maximum file size reduction (AVIF) |
Using Docker
docker build -t image-convert-mcp .📖 Usage
The MCP server implements the Model Context Protocol with support for both Stdio and Unified HTTP transports.
🚌 Transport Modes
The server supports two transport mechanisms:
1. Stdio (Default)
Standard communication via stdin/stdout. Ideal for local use with MCP clients like Claude Desktop.
python mcp_server.py --transport stdio2. HTTP (Unified)
Web-based communication via HTTP. This is the modern, recommended transport for remote MCP access.
python mcp_server.py --transport http --host 0.0.0.0 --port 8000When running in HTTP mode, the server provides a unified MCP endpoint at the root path (e.g., http://localhost:8000/).
MCP Tools
convert_image_single
Convert a single image to WebP and/or AVIF format.
Parameters:
input_path(required): Path to the input image fileoutput_dir(optional): Directory for output files (default: same as input)format(optional): Output format - "webp", "avif", or "both" (default: "both")webp_quality(optional): WebP quality 1-100 (default: 80)avif_quality(optional): AVIF quality 1-100 (default: 50)lossless(optional): Enable lossless WebP compression (default: false)max_width(optional): Maximum output widthmax_height(optional): Maximum output height
convert_image_batch
Convert multiple images in a directory to WebP and/or AVIF format.
Parameters:
input_path(required): Path to directory containing imagesoutput_dir(optional): Directory for output files (default: same as input)format(optional): Output format - "webp", "avif", or "both" (default: "both")webp_quality(optional): WebP quality 1-100 (default: 80)avif_quality(optional): AVIF quality 1-100 (default: 50)lossless(optional): Enable lossless WebP compression (default: false)max_width(optional): Maximum output widthmax_height(optional): Maximum output heightworkers(optional): Number of parallel workers (default: CPU count)
🔑 Parameters
Parameter | Type | Default | Description |
| string |
| Processing mode: |
| string | required | Path to image file (single mode) or directory (batch mode) |
| string | parent of input | Directory for output files |
| string |
| Output format: |
| int |
| WebP quality (1-100) |
| int |
| AVIF quality (1-100) |
| bool |
| Enable lossless compression for WebP |
| int |
| Maximum output width (maintains aspect ratio) |
| int |
| Maximum output height (maintains aspect ratio) |
| int | CPU count | Number of parallel workers (batch mode only) |
🐳 Docker Usage
# Build the image
docker build -t image-convert-mcp .
# Run conversion
echo '{"params":{"input_path":"/app/input.png","format":"webp"}}' | \
docker run -i -v /path/to/images:/app image-convert-mcp🔌 MCP Configuration
Add to your MCP settings file (e.g., opencode.json):
{
"mcpServers": {
"image-convert": {
"command": "python",
"args": ["/path/to/image-convert-mcp/mcp_server.py"],
"disabled": false
}
}
}Or using Docker:
{
"mcpServers": {
"image-convert": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${workspaceFolder}:/workspace",
"image-convert-mcp"
],
"disabled": false
}
}
}📊 Output Format
Single Mode
{
"result": {
"input": "/path/to/input.png",
"webp": "/path/to/output/input.webp",
"avif": "/path/to/output/input.avif"
}
}Batch Mode
{
"result": [
{
"input": "/path/to/image1.png",
"webp": "/path/to/output/image1.webp"
},
{
"input": "/path/to/image2.jpg",
"webp": "/path/to/output/image2.webp"
}
]
}🎯 Supported Input Formats
PNG (
.png)JPEG (
.jpg,.jpeg)TIFF (
.tiff)BMP (
.bmp)WebP (
.webp)
🛠️ Development
Project Structure
image-convert-mcp/
├── mcp_server.py # Main MCP server implementation
├── requirements.txt # Python dependencies
└── Dockerfile # Docker container definition🤖 For AI Agents
Quick Summary: This MCP server converts images to WebP/AVIF formats for web optimization.
Task | Tool | Example |
Single image |
|
|
Batch directory |
|
|
📖 See AGENT_GUIDE.md for detailed usage patterns.
☕ Support This Project
If this MCP server saves you time or helps your projects, consider supporting its development:
Your support enables:
🚀 New format support (JPEG XL, HEIC)
📊 Progress reporting features
🔒 Security enhancements
📚 Better documentation
📝 License
MIT License
🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
🔮 Roadmap
Support for JPEG XL format
Metadata preservation options
Progress reporting for long operations
Comprehensive test suite
Input validation and security enhancements
Caching for frequently converted images
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ShanthiStream/image-convert-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server