AI & Automation 7 min read · March 9, 2026

How to Use Mochify via MCP: AI Agent Image Compression (2026)

Connect Mochify to Claude Desktop, Cursor, or any MCP-compatible assistant and compress images directly from a conversation. No browser tab, no manual settings — just describe what you want.

Published March 2026 by the Mochify Engineering Team. The Mochify MCP server exposes our squish engine as a callable tool for AI assistants. Same compression quality, zero-retention privacy — now accessible from inside your AI workflow.

What's in This Guide

30-second summary

The Mochify MCP server lets any MCP-compatible AI assistant — Claude, Cursor, or similar — compress and optimize images directly from a conversation. Describe what you want, and the assistant calls Mochify's squish engine with the right flags. No browser tab, no manual settings, no file management overhead.

What is the Mochify MCP server?

MCP (Model Context Protocol) is a standard that lets AI assistants call external tools and services mid-conversation. We've built a Mochify MCP server that exposes our squish engine as a callable tool — meaning any AI assistant with MCP support can compress, resize, and optimize your images on your behalf.

This is the agent-first version of Mochify. The same compression quality and zero-retention privacy you get from the web tool at mochify.xyz, accessed directly from your AI workflow without opening a browser.

How the MCP connection works

When you describe an image optimization task to your MCP-connected assistant, it parses your prompt and identifies the compression intent. It then calls the Mochify MCP server with the appropriate flags — type, resize dimensions, quality, EXIF handling — and returns the optimized file back into your workflow.

The flow looks like this:

  1. You describe the task in natural language to your AI assistant
  2. The assistant identifies it as an image compression job
  3. It calls the Mochify MCP tool with the right parameters
  4. Our squish engine processes the image in memory
  5. The optimized file is returned — no upload portal, no manual steps

The underlying engine is the same native C++ squish pipeline that powers the web tool. You're getting identical compression quality, just accessed from inside an AI agent context. (web.dev has a solid primer on why image optimization matters for Core Web Vitals if you want background on why this matters at scale.)

What the LLM controls: type, size, EXIF

The AI assistant connected via MCP makes the same decisions as the natural language feature on the web tool — but in an agentic, automated context. Here's exactly what it can set:

Output format

Based on your described use case, the model picks from WebP, AVIF, JPEG XL, or JPEG (jpegli). "Best for the web" leans WebP. "Smallest possible" picks AVIF, which at quality 60 produces files roughly 45% smaller than JPEG at quality 80. "Lossless" picks JPEG XL.

Resize and cropping

Dimension context ("Instagram square," "thumbnail banner," "half the size") maps to explicit --resize and crop flags. The model understands common publishing formats and translates them to pixel dimensions without you specifying numbers.

EXIF metadata stripping

Privacy-aware prompts ("strip location," "clean for public upload") enable metadata removal. Camera data, GPS coordinates, and device info are wiped before the file comes back.

How to connect Mochify via MCP

The Mochify CLI includes the MCP server. Install it, then point your client at it.

1. Install the CLI

macOS (Homebrew):

brew tap getmochify/mochify
brew install mochify

Linux / WSL:

# x86_64 (most Linux / WSL)
curl -L https://github.com/getmochify/mochify-cli/releases/latest/download/mochify-linux-x86_64 -o mochify
chmod +x mochify && sudo mv mochify /usr/local/bin/

# arm64 (Raspberry Pi, AWS Graviton, etc.)
curl -L https://github.com/getmochify/mochify-cli/releases/latest/download/mochify-linux-arm64 -o mochify
chmod +x mochify && sudo mv mochify /usr/local/bin/

All binaries are statically linked — no dependencies needed. Also available on the GitHub releases page.

2. Add to your MCP client config

For Claude Desktop, edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mochify": {
      "command": "mochify",
      "args": ["serve"]
    }
  }
}

If you have an API key (for higher limits), pass it via the environment:

{
  "mcpServers": {
    "mochify": {
      "command": "mochify",
      "args": ["serve"],
      "env": { "MOCHIFY_API_KEY": "your-key" }
    }
  }
}

Restart Claude Desktop after saving. The Mochify squish tool will appear in your assistant's available functions — test it with: "Compress this image as a WebP for the web."

Example: compressing images from a prompt

Say you're working in Claude Desktop and you say:

"Can you compress this product photo as an Instagram-ready WebP and strip the EXIF data?"

Behind the scenes, the assistant calls Mochify's MCP server with roughly:

  • --type webp
  • --resize 1080x1080
  • --strip-exif

The result comes back in seconds — a web-optimized 1080×1080 WebP with no metadata attached. You didn't touch a settings panel or look up Instagram's recommended dimensions. The agent handled the full decision chain.

MCP vs. the web tool: when to use each

Both options use the same squish engine and deliver the same output quality. The difference is workflow fit.

Web tool (mochify.xyz)MCP server
Best forOne-off compression, quick jobsAutomated workflows, agent pipelines
InterfaceBrowser, natural language fieldAI assistant (Claude, Cursor, etc.)
Setup requiredNoneMCP client configuration
Batch handlingUp to 25 filesDepends on agent implementation
PrivacyZero-retention, in-memoryZero-retention, in-memory
Format supportWebP, AVIF, JXL, JPEGWebP, AVIF, JXL, JPEG

If you're optimizing images as part of a larger agent workflow — content pipelines, automated publishing, code-adjacent tasks — MCP is the right path. For quick, individual jobs, the web tool is faster to reach.

Cheat sheet: prompt-to-flag mapping

PromptFormatResizeEXIF strip
"Instagram square"WebP1080×1080Optional
"Smallest possible, mobile"AVIF~800pxNo
"Blog hero, fast loading"WebP~1200pxNo
"Archive, no quality loss"JPEG XLOriginalNo
"Clean for public upload"WebPOptionalYes
"Email thumbnail"JPEG (jpegli)~600pxYes

FAQ

What is an MCP server?

MCP (Model Context Protocol) is an open standard that lets AI assistants call external tools and APIs mid-conversation. The Mochify MCP server exposes our compression engine as a callable tool any compatible assistant can use.

Which AI assistants support MCP?

Claude Desktop, Cursor, and a growing number of tools support MCP natively. Check your assistant's documentation for MCP tool configuration support.

Is image compression via MCP as good as the web tool?

Yes — the same native C++ squish engine handles both. Output quality and format support are identical.

Does using MCP mean my images are stored?

No. Mochify's zero-retention policy applies regardless of how you connect. Images are processed in memory and never written to disk or retained after the job completes.

Can I use MCP for batch jobs?

That depends on how your agent is set up to call the tool. The MCP server itself can handle individual calls in sequence — building a batch loop is possible within your agent's logic.

What formats does the MCP server support?

WebP, AVIF, JPEG XL, and JPEG (via jpegli). The connected AI assistant selects the format based on your prompt.

How does this differ from the natural language feature on the homepage?

The homepage feature is browser-based and designed for individual, manual use. The MCP server is for agent-driven workflows where an AI assistant is handling the task as part of a larger pipeline — without you touching a browser.

Free Tool

Try it without MCP — just describe what you need

No account. No dropdowns. The natural language feature on the web tool works the same way — type your goal, upload your image, done.

Start Optimizing Free