WebP Batch Converter

by mhe8mah

Not rated
GitHub

About

Batch convert PNG, JPG, and JPEG images to WebP format with options for quality, lossless mode, and multi-threaded processing.

Details

Author
mhe8mah
Categories
File Management, Other, Media

Setup

Install WebP Batch Converter in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/mhe8mah/webp-batch-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

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.

- πŸ–ΌοΈBatch conversionof PNG, JPG, and JPEG files to WebP
- 🌍Cross-platformsupport (macOS, Linux, Windows)
- ⚑Multi-threadedprocessing for fast conversions
- πŸŽ›οΈFlexible optionsincluding quality control, lossless mode, and metadata preservation
- πŸ“ŠDetailed reportingwith file sizes and savings statistics
- πŸ”§Dual engine support- prefers Google's cwebp, falls back to Sharp
- 🎯MCP integrationfor use in AI-powered development environments

git clone https://github.com/mhe8mah/webp-batch-mcp.git cd webp-batch-mcp npm install npm run build
docker build -t webp-batch . docker run -v /path/to/images:/data webp-batch

- --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

# Convert all images in current directory node dist/cli.js # High quality conversion of specific directory node dist/cli.js --src ./photos --quality 95 --preserve-meta # Lossless conversion with overwrite node dist/cli.js --src ./images --lossless --overwrite # Batch process to output directory node dist/cli.js --src ./input --flat ./output --threads 8

The MCP server exposes a single tool:convert_to_webp

{ "src": "string", // Source directory (default: ".") "quality": "number", // Quality 0-100 (default: 75) "lossless": "boolean", // Lossless mode (default: false) "overwrite": "boolean", // Replace originals (default: false) "threads": "number", // Concurrent threads (default: CPU count) "preserveMeta": "boolean", // Keep metadata (default: false) "flat": "string" // Output directory (optional) }
git clone https://github.com/mhe8mah/webp-batch-mcp.git cd webp-batch-mcp npm install npm run build

- Open Cursor Settings
- Navigate toFeatures→MCP
- Add a new server configuration:

{ "mcpServers": { "webp-batch": { "command": "node", "args": ["/path/to/webp-batch-mcp/dist/server.js"] } } }

- Restart Cursor
- Theconvert_to_webptool will be available in your AI conversations
-

Primary Engine: Google'scwebptool (included in libwebp-tools)

- Fastest performance
- Best compression
- Full feature support

- Pure JavaScript implementation
- No external dependencies
- Cross-platform compatibility

- Default: Creates.webpfiles 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

- Utilizes all CPU cores by default
- Processes images concurrently using p-limit
- Provides real-time progress feedback
- Reports detailed conversion statistics

- JPEG (35KB β†’ 17KB): 51% space savings
- PNG (7.9KB β†’ 2.8KB): 65% space savings
- Overall: 53% average compression

- @modelcontextprotocol/sdk- MCP server framework
- sharp- Image processing fallback
- chalk- Colorized terminal output
- commander- CLI argument parsing
- glob- File pattern matching
- p-limit- Concurrency control

- typescript- Type safety
- tsup- Fast TypeScript bundler
- jest- Testing framework

MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request

For issues and feature requests, please use theGitHub issue tracker.

Free file conversion between 999 routes (images, video, audio, documents, data, fonts, ebooks, archives) β€” no API key required.

Convert files between various formats, including images, documents, audio, video, and more.

MCP server for Audacity 3.x with 131 tools β€” effects, cleanup, mastering, format conversion, transcription.

A Python package for media processing using FFmpeg and FastMCP.

Batch audio processing and optimization using FFmpeg. Modify sample rate, bitrate, volume, channels, and apply effects.

A server for media processing, offering powerful video and image manipulation using FFmpeg and ImageMagick.

Convert video files between various formats using FFmpeg. Requires FFmpeg to be installed on the system.

Bitcoin-powered tools marketplace. Image, text, video, music, speech, 3D, file conversion, SMS β€” all via Lightning micropayments. No signup required.

Official MCP server for Very Good FFmpeg

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.