image
v0.2.0Compress, convert and resize images locally, with marketplace presets and rule rechecks.
This is the image suite of the yaktool MCP family. It ships the same engine as the browser compressor — same decision pipeline, same documented behaviours, same numbers for the same file. The pure-algorithm validators (GTIN, feeds, e-invoices…) live in the sibling package yaktool-mcp; the packages are split so nobody downloads wasm codecs they don't use. Returns { outcome, path, out?, originalBytes, outputBytes?, savedPercent?, report }. Animated PNGs are skipped, never flattened.
Summary extracted from the README.
yaktool-image-mcp
Local image tools as an MCP server — compress PNG/JPEG with a visually-guarded smart mode or true lossless mode, optionally converting to WebP/AVIF.
This is the image suite of the yaktool MCP family. It ships the same engine as the browser compressor — same decision pipeline, same documented behaviours, same numbers for the same file. The pure-algorithm validators (GTIN, feeds, e-invoices…) live in the sibling package yaktool-mcp; the packages are split so nobody downloads wasm codecs they don't use.
- Local & private — files are read and written on your machine over stdio; zero network calls
- Deterministic — same input and settings → same result, with a
reportthat shows the work (colours, measured PSNR dB, metadata removed, encoder used) - Safe by contract — the input file is never modified, an existing output is never overwritten, and if nothing beats the original size no file is written at all (
kept-original) - Honest about lossless — lossless mode keeps pixels byte-identical; smart mode enforces an alpha-weighted PSNR floor and falls back to lossless rather than degrade visibly
Install
Claude Code
claude mcp add yaktool-image -- npx -y yaktool-image-mcp
Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"yaktool-image": { "command": "npx", "args": ["-y", "yaktool-image-mcp"] }
}
}
Cursor / other MCP clients — any stdio-capable client works with command npx -y yaktool-image-mcp.
Requires Node.js ≥ 20.
Tools
compress_image — compress a local PNG or JPEG file by absolute path.
mode:smart(default, visually-guarded lossy) orlossless(pixels byte-identical; metadata and encoding only)quality: 0–100 (default 60) — sets the PNG PSNR floor and the JPEG/WebP/AVIF encoder quality in smart modeformat:same(default),webporavif— both support true losslessout: optional absolute output path (default:<name>-compressed.<ext>alongside the input)
Returns { outcome, path, out?, originalBytes, outputBytes?, savedPercent?, report }. Animated PNGs are skipped, never flattened.
convert_image — convert a local PNG/JPEG/WebP/AVIF file between formats, optionally resizing it to a marketplace preset, and recheck the output against that platform's published rules.
preset:amazon-main,gmcorebay— sets the target format and size, and the result carries a per-rule verdict list (recheck.verdicts, rule IDsMED-*/IMG-S01) plusrecheck.allPasstarget:jpeg|png|webp|avif(defaults to the preset's format, else jpeg)width/height+fit(fitnever crops,cropcentre-crops,padfills with white); a single dimension scales proportionallyallowUpscale: default false — when the target is larger than the source the image keeps its size and the report says so (ICV-002), because stretching adds blur, not detailout: optional absolute output path (default:<name>-converted.<ext>)
Animated GIFs are refused rather than flattened; JPEG output composites transparency onto white and says so; EXIF/GPS is not carried over and the report states what was dropped. Same resampler (lanczos3) and same rules as the browser converter — the full catalog lives at yaktool.com/mcp.
License
MIT © yaktool.com