Skip to main content
Glama

mochify-cli

MCP Badge License: MIT

一个用于 mochify.app 的命令行工具和 MCP 服务器——这是一个由原生 C++ 引擎驱动的、注重隐私的快速图像压缩和转换 API。

在终端中将图像压缩并转换为现代格式(AVIF、JXL、WebP、Jpegli),或者通过 模型上下文协议 (Model Context Protocol) 让 Claude 等 AI 助手直接访问图像处理功能。

安装

macOS (Homebrew):

brew tap getmochify/mochify
brew install mochify

Linux / WSL:

# x86_64
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
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/

手动安装: 所有二进制文件均可在 Releases 找到。

从源码安装:

cargo install --path .

Related MCP server: tinypng-mcp-server

身份验证

登录您的 mochify.app 账户以解锁全部配额:

mochify auth login

这将打开您的浏览器,您可以在其中登录并授权 CLI。您的凭据会自动保存到 ~/.config/mochify/credentials.toml 中——无需环境变量或手动复制密钥。CLI 和 MCP 服务器都会自动读取它们。

mochify auth status   # check whether you're signed in
mochify auth logout   # remove saved credentials

免费层级(未认证)限制为每天 25 张图像。请在 mochify.app 注册。

CLI 使用方法

mochify [OPTIONS] <FILES>...

选项

标志

描述

-t, --type <FORMAT>

输出格式:jpg, png, webp, avif, jxl

-w, --width <N>

目标宽度(像素)

-H, --height <N>

目标高度(像素)

--crop

裁剪至精确尺寸

-r, --rotation <DEG>

旋转:0, 90, 180, 270

-o, --output <DIR>

输出目录(默认:与输入相同)

-p, --prompt <TEXT>

自然语言提示词——自动解析参数

-k, --api-key <KEY>

API 密钥覆盖(或设置 MOCHIFY_API_KEY 环境变量)

示例

# Convert a JPEG to AVIF
mochify photo.jpg -t avif

# Resize and convert to WebP
mochify photo.jpg -t webp -w 800

# Batch convert a folder to AVIF at 1200px wide
mochify ./images/*.jpg -t avif -w 1200 -o ./compressed

# Use a natural-language prompt instead of explicit flags
mochify photo.jpg -p "convert to avif and resize to 1200px wide"

# Prompt works with multiple files too
mochify ./images/*.jpg -p "compress for web, keep under 1000px wide" -o ./out

MCP 服务器 (Claude Desktop)

mochify 可以作为 MCP 服务器 运行,让 Claude 直接在对话中为您处理图像。

设置

首先运行 mochify auth login,然后将以下内容添加到您位于 ~/Library/Application Support/Claude/claude_desktop_config.json 的 Claude Desktop 配置文件中:

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

重启 Claude Desktop。mochify 服务器将出现在您的连接中,并自动使用您保存的凭据。

使用方法

只需用自然语言描述您的需求,并提供图像的完整路径:

"Convert /Users/me/Desktop/photo.jpg to AVIF at 1000px wide"

"Compress all the JPEGs in /Users/me/projects/blog/images/ to WebP and save them to /Users/me/projects/blog/compressed/"

Claude 将自动调用 squish 工具。

API

由位于 https://api.mochify.xyz/v1/squish 的 mochify API 提供支持。

  • 图像在内存中处理,绝不会存储在磁盘上

  • 支持 JPEG (Jpegli)、AVIF、JXL、WebP 和 PNG 输出

  • 每张图像最大 25MB

访问 mochify.app 获取网页界面。

A
license - permissive license
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
1wRelease cycle
21Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Normalize and convert more than 400 file types via TweekIT's hosted MCP streamable HTTP endpoint.

  • MCP server for Tinify image optimization — one tool, max optimization

  • Create App Store screenshots, icons, ASO copy, localization, and revisions via hosted MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/getmochify/mochify-cli'

If you have feedback or need assistance with the MCP directory API, please join our Discord server