Image and PDF toolkit: convert to AVIF/WebP/JXL, resize, crop, remove backgrounds, optimize PDFs.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
A command-line tool and MCP server for mochify.app β a fast, privacy-first image compression and conversion API powered by a native C++ engine.
Compress and convert images to modern formats (AVIF, JXL, WebP, Jpegli) from your terminal, work on PDFs, or give AI assistants like Claude direct access to the same engine over the Model Context Protocol β either as a local stdio server (mochify serve) or the hosted one at mcp.mochify.app, which needs no install at all.
Jump to: Installation Β· CLI usage Β· PDF processing Β· MCP server Β· Plans
macOS (Homebrew):
Windows (Scoop):
Linux / WSL:
Cargo (all platforms):
Requires Rust. Easiest option on Linux/WSL if you already have the toolchain.
Manual: All binaries at Releases.
From source:
Sign in with your mochify.app account to unlock your full quota:
This opens your browser, where you sign in and authorize the CLI. Credentials are saved automatically to ~/.config/mochify/credentials.toml β no environment variables or manual key copying required. Both the CLI and MCP server pick them up automatically.
Without an account you get 3 images per batch (IP-based). With a free account: 25 images/month. Sign up at mochify.app.
| Flag | Description |
|---|---|
-t, --type <FORMAT> | Output format: jpg, png, webp, avif, jxl |
-w, --width <N> | Target width in pixels |
-H, --height <N> | Target height in pixels |
--crop | Crop to exact dimensions (saliency-guided) |
-r, --rotation <DEG> | Rotation: 0, 90, 180, 270 |
-o, --output <DIR> | Output directory (default: same as input) |
-n, --name <NAME> | Base name for the output file (without extension) |
--clarity | Apply clarity (midtone contrast enhancement β crisper, more detailed look) |
--remove-bg | Remove the background (AI foreground isolation) |
--background <COLOR> | Composite colour for --remove-bg (white, #ff0000, β¦) |
--keep-metadata | Preserve EXIF/metadata (stripped by default) |
-q, --quality <N> | Output quality 1β100 (default: automatic) |
--smart-compress | Saliency-guided quality β detail keeps more, flat areas less |
--brightness <N> | Exposure, -100 (darkest) to +100 (brightest) |
--optimize-for-web | Progressive + 4:2:0 chroma β smallest file to serve |
--lossless | Pixel-exact output (jxl, webp, png only) |
--hdr [MODE] | Ultra HDR gain map: preserve (bare flag) or generate |
-p, --prompt <TEXT> | Natural-language prompt β resolves all params automatically |
-j, --jobs <N> | Files to process at once (default 4; 1 for strictly one at a time) |
-k, --api-key <KEY> | API key override (or set MOCHIFY_API_KEY env var) |
Quality is chosen automatically unless you say otherwise.
--lossless only works for jxl, webp and png β jpg and avif are rejected before the request goes out. It overrides -q and --smart-compress, and the output is usually larger than the input: lossless preserves pixels, not file size. A source that is already lossy (JPEG, AVIF, HEIC) comes back as the best lossy encode instead, since nothing can restore what that file discarded β the CLI says so when that happens.
--hdr controls the Ultra HDR / ISO 21496-1 gain map that makes a photo render with real headroom on an HDR display.
| Mode | What it does |
|---|---|
--hdr (or --hdr preserve) | Keeps a gain map the source already has. Never invents one, so it does nothing to an SDR photo. |
--hdr generate | Keeps an existing gain map and synthesises one when the source is plain SDR. This is the one for "make it HDR". |
Only jpg output can carry a gain map (jxl carries HDR by a different route; avif, webp and png cannot), so pair it with -t jpg. It is also skipped alongside --clarity or --remove-bg, which change the base the gain map is a ratio to. The CLI reads the X-Mochify-HDR response header and tells you when the output ended up with no gain map.
By default, when the output format and directory match the input, the result is saved as {name}_mochified.{ext} so it's always clear something happened. If that file already exists, a numeric suffix is added (_1, _2, etc.). When the format changes (e.g. .jpg β .webp), the extension change is already unambiguous so no suffix is added.
Use -n, --name to set an explicit base name: mochify photo.jpg -t webp -n hero saves hero.webp. The prompt path also supports this: mochify *.jpg -p "optimise for Shopify, name them product" will produce product.webp, product_1.webp, etc.
PDFs are detected automatically by the .pdf extension, and --op picks what to do with them. (PDFs and images can't be mixed in a single command β run them separately.)
create is the exception: its inputs are images, so there is nothing in a .jpg to route on. Pass --op create, or just say "pdf" in a prompt β mochify *.jpg -p "convert to pdf" builds one too.
| Op | Takes | Returns | What it does |
|---|---|---|---|
optimize | a PDF | .pdf | Recompresses the images inside the PDF. Text, fonts, vector art and layout are untouched, so the document stays searchable. |
extract | a PDF | .zip | Pulls out the images somebody placed into the document, at the resolution they were stored at. |
rasterize | a PDF | .zip | Renders every page to an image, text and all. |
split | a PDF | .zip | Explodes the PDF into one single-page PDF per page. |
create | images | .pdf | Builds a PDF from images, one page per image, in the order given. |
| Flag | Applies to | Description |
|---|---|---|
--op <OP> | all | optimize, extract, rasterize, split, create |
-t, --type <FORMAT> | rasterize, extract | png, jpg, webp, avif, jxl β plus original for extract (no re-encode) |
--dpi <N> | rasterize, optimize, create | Render resolution (rasterize, default 150), target resolution for the images kept inside the PDF (optimize), or page sizing (create) |
-q, --quality <N> | all but split | Output quality 1β100 (same flag as for images) |
--max-width <N> | extract, optimize, create | Cap image width in pixels; 0 leaves sizes alone |
--min-size <N> | extract, optimize | Skip images smaller than this on either axis; 0 takes everything |
--page <SIZE> | create | fit (default), a4, letter |
--no-combine | create | One single-page PDF per image, returned as a .zip |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mochify)<a href="https://allmcps.com/mcp/mochify"><img src="https://allmcps.com/api/badge/mochify?style=directory" alt="Mochify on AllMCPs" /></a>