Provides containerized deployment of the WebP batch conversion service, allowing users to run the converter in an isolated environment with volume mounting for image processing.
Integrates with Jest for testing the WebP conversion functionality, ensuring reliability of the batch processing capabilities.
Leverages Node.js runtime for the conversion service, providing the foundation for the WebP batch processing engine and MCP server implementation.
Uses Sharp as a fallback image processing engine when Google's cwebp tool is unavailable, providing pure JavaScript implementation for cross-platform WebP conversion without external dependencies.
Built with TypeScript for type safety, enabling more reliable development and maintenance of the WebP conversion codebase.
WebP Batch Converter
A Model Context Protocol (MCP) server for batch converting images to WebP format with cross-platform support. Works seamlessly with MCP-aware IDEs like Cursor.
🌟 Features
- 🖼️ Batch conversion of PNG, JPG, and JPEG files to WebP
- 🌍 Cross-platform support (macOS, Linux, Windows)
- ⚡ Multi-threaded processing for fast conversions
- 🎛️ Flexible options including quality control, lossless mode, and metadata preservation
- 📊 Detailed reporting with file sizes and savings statistics
- 🔧 Dual engine support - prefers Google's cwebp, falls back to Sharp
- 🎯 MCP integration for use in AI-powered development environments
📦 Installation
Global Installation
Local Development
Docker
🚀 Usage
Command Line Interface
Options
--src <dir>
- Source directory to scan (default: current directory)--quality <0-100>
- WebP quality setting (default: 75)--lossless
- Use lossless encoding (recommended for PNG)--overwrite
- Replace original files with WebP versions--threads <n>
- Number of concurrent conversions (default: CPU count)--preserve-meta
- Preserve EXIF and ICC metadata--flat <dir>
- Output all WebP files to specified directory
Examples
MCP Server
The MCP server exposes a single tool: convert_to_webp
Tool Parameters
⚙️ How to Add This Server in Cursor
- Clone and build the project:
- Open Cursor Settings
- Navigate to Features → MCP
- Add a new server configuration:
- Restart Cursor
- The
convert_to_webp
tool will be available in your AI conversations
🔧 Technical Details
Conversion Strategy
- Primary Engine: Google's
cwebp
tool (included in libwebp-tools)- Fastest performance
- Best compression
- Full feature support
- Fallback Engine: Sharp (Node.js)
- Pure JavaScript implementation
- No external dependencies
- Cross-platform compatibility
Output Behavior
- Default: Creates
.webp
files alongside originals - Overwrite mode: Replaces originals with WebP versions
- Flat mode: Outputs all WebP files to specified directory
- Metadata preservation: Maintains EXIF and ICC profiles when requested
Performance
- Utilizes all CPU cores by default
- Processes images concurrently using p-limit
- Provides real-time progress feedback
- Reports detailed conversion statistics
🛠️ Development
Building
Testing
Development Mode
📊 Test Results
Verified with real web images:
- JPEG (35KB → 17KB): 51% space savings
- PNG (7.9KB → 2.8KB): 65% space savings
- Overall: 53% average compression
📋 Dependencies
Runtime
@modelcontextprotocol/sdk
- MCP server frameworksharp
- Image processing fallbackchalk
- Colorized terminal outputcommander
- CLI argument parsingglob
- File pattern matchingp-limit
- Concurrency control
Development
typescript
- Type safetytsup
- Fast TypeScript bundlerjest
- Testing framework
📄 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
🆘 Support
For issues and feature requests, please use the GitHub issue tracker.
This server cannot be installed
An MCP server that enables batch conversion of images to WebP format with configurable options like quality settings, lossless mode, and multi-threading support.
Related MCP Servers
- AsecurityAlicenseAqualityAn intelligent MCP server with a fully automated batch pipeline for web-ready images. Features include noise reduction, auto levels/curves, JPEG artifact removal, 4K resizing, smart sharpening with shadow/highlight enhancement, and advanced WebP conversion.Last updated -15JavaScriptMIT License
- AsecurityAlicenseAqualityA powerful MCP server for fetching and transforming web content into various formats (HTML, JSON, Markdown, Plain Text) with ease.Last updated -414612TypeScriptMIT License
- AsecurityAlicenseAqualityAn MCP server for fetching and transforming web content into various formats.Last updated -44PythonMIT License
- -security-license-qualityAn MCP server that provides web development tools including taking screenshots of screens, enabling AI agents to capture and analyze visual content during development.Last updated -2TypeScript