by mhe8mah
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.
npm install -g webp-batch-mcp
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
node dist/cli.js [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# 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
*Configuration content*
git clone https://github.com/mhe8mah/webp-batch-mcp.git cd webp-batch-mcp npm install npm run build
*Configuration content*
convert_to_webp tool will be available in your AI conversationsPrimary Engine: Google's cwebp tool (included in libwebp-tools)
Fallback Engine: Sharp (Node.js)
.webp files alongside originalsnpm run build
npm test
npm run dev
Verified with real web images:
@modelcontextprotocol/sdk - MCP server frameworksharp - Image processing fallbackchalk - Colorized terminal outputcommander - CLI argument parsingglob - File pattern matchingp-limit - Concurrency controltypescript - Type safetytsup - Fast TypeScript bundlerjest - Testing frameworkMIT License - see LICENSE file for details.
For issues and feature requests, please use the GitHub issue tracker.
No version information available
0 contributors