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.app, 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:
- You describe the task in natural language to your AI assistant
- The assistant identifies it as an image compression job
- It calls the Mochify MCP tool with the right parameters
- Our squish engine processes the image in memory
- 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"]
}
}
} To unlock your plan's limits, authenticate once with a browser login:
mochify auth login This opens your browser, you sign in, and credentials are saved to ~/.config/mochify/credentials.toml. Both the CLI and the mochify serve MCP server pick them up automatically — no key to paste into your config. (MOCHIFY_API_KEY still works as an optional environment-variable override, but mochify auth login is the standard path.)
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."
Hosted MCP: zero-install, any AI client
The Mochify MCP server is also available as a hosted HTTP endpoint at https://mcp.mochify.app. No binary to install, no Rust toolchain, no config file — paste the URL, authorize your account, and the squish tool appears in your AI assistant instantly.
One behavioural note specific to the hosted server: it returns the compressed image as a short-lived download URL on files.mochify.app (about a five-minute window), not as inline binary. Your original is still processed in RAM and discarded immediately; only the compressed output sits briefly in a pickup store so the link can resolve. The local CLI never uses that pickup store — it writes results straight to disk.
| Hosted MCP (mcp.mochify.app) | Local CLI MCP (stdio) | |
|---|---|---|
| Setup | Paste a URL, click Authorize | Install CLI, edit config file |
| Works in Claude.ai web | Yes | No (desktop only) |
| Works in Claude Desktop | Yes | Yes |
| Works in Gemini / Cursor / Windsurf | Yes (remote MCP URL) | Varies by client |
| Image source | Public URLs (agent fetches) | Local files + public URLs |
| Auth | OAuth 2.0 (one-click) | Optional API key via env var |
| Can run simultaneously | Yes | Yes |
Claude.ai web (claude.ai)
In Claude.ai, go to Settings → Integrations and add a new integration with the URL:
https://mcp.mochify.app Claude will redirect you to Mochify to sign in and authorize. After that, just tell Claude to compress an image by URL and it will call the squish tool automatically.
Claude Desktop (remote server)
Add a remote entry to your Claude Desktop config alongside any local servers you already have:
{
"mcpServers": {
"mochify-hosted": {
"type": "http",
"url": "https://mcp.mochify.app/mcp"
}
}
} Claude Desktop will walk you through the OAuth flow the first time it connects. You can run both this remote entry and the local mochify serve entry at the same time — they use independent tokens.
Gemini, Cursor, Windsurf, and other MCP clients
Any client that supports remote MCP servers (HTTP+SSE or Streamable HTTP transport) works with the hosted endpoint. Add https://mcp.mochify.app/mcp as the server URL and follow the client's OAuth prompt.
Smithery & Glama
Mochify is listed on Smithery and Glama — MCP registries and marketplaces where you can discover and install MCP tools with a single click. Search for "Mochify" to add the hosted server directly from the registry without touching any config file.
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.app) | MCP server | |
|---|---|---|
| Best for | One-off compression, quick jobs | Automated workflows, agent pipelines |
| Interface | Browser, natural language field | AI assistant (Claude, Cursor, etc.) |
| Setup required | None | MCP client configuration |
| Batch handling | Up to 25 files | Depends on agent implementation |
| Privacy | Zero-retention, in-memory | Zero-retention, in-memory |
| Format support | WebP, AVIF, JXL, JPEG | WebP, 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
| Prompt | Format | Resize | EXIF strip |
|---|---|---|---|
| "Instagram square" | WebP | 1080×1080 | Optional |
| "Smallest possible, mobile" | AVIF | ~800px | No |
| "Blog hero, fast loading" | WebP | ~1200px | No |
| "Archive, no quality loss" | JPEG XL | Original | No |
| "Clean for public upload" | WebP | Optional | Yes |
| "Email thumbnail" | JPEG (jpegli) | ~600px | Yes |
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?
Your original image is processed in memory and discarded immediately — no disk writes, no logs containing image data — on every surface. One nuance for the hosted MCP: so it can return a download link instead of inline binary, the compressed result is held in a short-lived pickup store for about five minutes, then evicted whether or not it was fetched. The local CLI and mochify serve skip that pickup store entirely and write the compressed bytes straight to your disk. Originals are never retained on any path.
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.
Do I need to install anything to use the hosted MCP?
No. The hosted server at https://mcp.mochify.app runs in the cloud. Add the URL in your AI client's settings and authorize your Mochify account — that's it. You only need to install the CLI if you want to process local files via stdio.
Can I use Mochify MCP from Claude.ai in my browser?
Yes. Claude.ai's Integrations feature supports remote MCP servers. Go to Settings → Integrations, add https://mcp.mochify.app, and authorize. The local CLI MCP is not available on the web — it only runs in Claude Desktop and similar native clients.
Can I run both the hosted and local MCP at the same time?
Yes. They use independent OAuth tokens and can coexist in the same Claude Desktop config. A common setup is the hosted MCP for URL-based agent jobs and the local CLI for compressing files on your own machine — both active simultaneously.
Does the hosted MCP work with Gemini, Cursor, or Windsurf?
Yes, with any client that supports remote MCP servers over HTTP. Add https://mcp.mochify.app/mcp as the server URL in your client's MCP settings and follow the OAuth prompt. Mochify is also listed on Smithery and Glama if your client supports registry-based discovery.
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