easytiny-mcp
One-line summary: A batch image optimizer that compresses images visually losslessly into a temp directory for preview, then replaces the originals only after you approve the plan.
prepare_compression(read-only): compress files/directories of JPEG, PNG, WebP, AVIF, GIF, and SVG into a temp folder without touching originals; returns aplan_idplus a preview table (old size, new size, encoder used, SSIMULACRA2 score, skip reason).Options:
paths(required, absolute paths recommended),effort(fast/balanced/max),min_score(50–100, default 85 = visually lossless),recursive(default true).Each format has a fixed encoder ladder (e.g.
cjpegli→jpegtran,pngquant→oxipng,cwebp,avifenc,gifsicle, SVGO), accepting the first result that saves ≥3% at SSIMULACRA2 ≥85, with lossless fallback; files <10KB or already compressed are skipped.
apply_compression(destructive): atomically replace the originals for a givenplan_id, with optionalbackup: trueto copy originals into.image-backup/first. Intended only after the user has seen the preview table and explicitly agreed.cancel_compression: throw away a plan and delete its temp files; originals stay untouched.Plans are valid for 30 minutes and are invalidated by a server restart, so a new preview + approval is needed afterward.
Caveat: the schema's
apply_compressionrequires onlyplan_idand exposes noconfirmed: truefield, although the README states that flag is mandatory — a mismatch worth fixing before relying on the approval guarantee.
Compresses JPEG images losslessly or lossily using cjpegli/jpegtran, with SSIMULACRA2 quality checks and a preview/confirm workflow before replacing the originals.
Optimizes SVG files with a conservative SVGO configuration, verifying results via rendering comparison before the compressed file replaces the original.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@easytiny-mcpcompress all images in ./assets — preview first, then apply with backups"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
easytiny-mcp
视觉无损的图片批量压缩 MCP 服务。压缩结果先放在临时目录预览,用户确认后才原地替换原图。
工具
工具 | 作用 |
| 压缩到临时目录,返回 |
| 用户在聊天中确认后,传入 |
| 丢弃预览结果 |
Related MCP server: TinyPNG MCP Server
确认与替换流程
调用
prepare_compression,将返回的预览表完整展示给用户,原图保持不变。用户在聊天中明确同意替换该计划后,调用
apply_compression({ plan_id, confirmed: true });需要备份时额外传入backup: true。服务端校验确认参数和计划,再检查原图是否发生变化并执行替换。无论客户端是否支持 elicitation,都不会再次请求确认表单。
confirmed 无默认值:省略、传 false 或传字符串 "true" 都不会替换文件,计划仍可在有效期内重新提交。计划有效期为 30 分钟,失效或服务重启后需要重新生成预览并获得确认。
此参数是调用方对已有用户授权的明确声明;服务端能校验参数,不能直接读取或验证聊天内容。调用方必须确认授权对应当前 plan_id,不得自行填 true。客户端自身的工具审批策略仍然生效。
升级时,原先只传 { plan_id } 的调用及工作流说明需同步增加 confirmed: true(仅在用户已同意后)。已运行的 MCP 服务需重启或重新连接以加载新的工具定义;固定使用 npm 旧版本的配置不会自动使用本地修改。
压缩策略
每种格式一个主力编码器,按固定顺序尝试,采用第一个「节省 ≥3% 且 SSIMULACRA2 ≥85」的结果,最后以无损优化兜底。小于 10KB 或已压缩过的文件直接跳过。
格式 | balanced 尝试顺序 |
JPEG |
|
PNG |
|
WebP | 有损源 |
AVIF |
|
GIF |
|
SVG | SVGO(保守配置)+ 渲染比对 |
effort:fast 跳过 SSIMULACRA2 判定、参数更保守;max 从更激进的参数逐级放宽,更慢、压缩率更高。
开发
pnpm install
scripts/build-bins.sh # 编译编码器到 vendor/bin(也可用 EASYTINY_BIN_DIR 指定目录)
pnpm tsx scripts/gen-img.ts # 重新生成 img/ 下的测试图片(已提交,一般无需运行)
pnpm fixtures # 从 img/ 生成其他格式的测试样例
pnpm bench img bench/fixtures [--effort fast|balanced|max] [-v] # 只输出统计,不改动原图
pnpm test接入
支持 macOS(Apple Silicon / Intel)与 Windows x64,需要 Node.js ≥ 20。编码器随平台包自动安装,无需额外依赖。
# Claude Code:所有项目可用;只想在当前项目用就去掉 --scope user
claude mcp add --scope user easytiny -- npx -y easytiny-mcp其他客户端(Cursor 等)的 JSON 配置:
{ "mcpServers": { "easytiny": { "command": "npx", "args": ["-y", "easytiny-mcp"] } } }本地开发版:先 pnpm build,再把命令换成 node /path/to/easytiny-mcp/dist/index.js。
发布
推送 v* tag 后,GitHub Actions 会在各平台编译编码器、跑测试,并发布主包 easytiny-mcp 与平台包 easytiny-mcp-darwin-arm64、easytiny-mcp-darwin-x64、@easychan/easytiny-mcp-win32-x64:
git tag v0.2.0 && git push origin v0.2.0npm 认证使用 Trusted Publishing(OIDC),无需长期 token:
首次发布前包还不存在,需要在 npm 生成一个可发布的 Granular Access Token,填入仓库 Secrets 的
NPM_TOKEN。首次发布成功后,在 npmjs.com 上为 4 个包分别添加 Trusted Publisher(仓库
chaneasy/easytiny-mcp,工作流release.yml,环境npm),然后删除NPM_TOKEN。
Available Tools
3 toolsapply_compression替换原图ADestructive
用 prepare_compression 的结果替换原图。只能在用户看过预览表并明确同意后调用。
| Name | Required | Description | Default |
|---|---|---|---|
| backup | No | 替换前把原图备份到同目录的 .image-backup/ | |
| plan_id | Yes | prepare_compression 返回的 plan_id |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true, so the description does not need to argue that this mutates state. It still adds real value by disclosing the human-in-the-loop consent requirement, which annotations cannot express. It stops short of stating that the replacement is irreversible or what happens if backup is left at its default false, which would complete the picture.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences: the action first, the safety gate second. Nothing is padded and no sentence restates the tool name or annotations.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive, two-parameter mutation tool, the description covers the action, the upstream dependency, and the consent gate, with annotations handling the destruction signal. A note on irreversibility or on the consequence of the default backup=false would make it fully self-sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with backup's default false and backup directory documented inline and plan_id tied to prepare_compression's return value. The description only echoes the plan_id provenance already stated in the schema, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('用 prepare_compression 的结果替换原图' — replace the original image with the prepare_compression result), which is unambiguous and clearly distinct from prepare_compression (plans) and cancel_compression (aborts). The downstream artifact of the sibling tool is named directly, so the agent can place this in the workflow without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives an explicit gating precondition rather than a vague hint: call only after the user has seen the preview table and explicitly consented. This is effectively both a when-to-use and a when-not-to-use rule, and it ties the tool to the prepare_compression workflow, leaving no doubt about sequencing among the siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
cancel_compression取消压缩计划A
丢弃 prepare_compression 的结果并清理临时文件,原图不受影响。
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does disclose real side effects: temporary files are removed and the original image is explicitly left untouched, which answers the main safety question for a cancel tool. It omits failure behavior (e.g. invalid or already-consumed plan_id) and any permission requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One sentence, front-loaded with the primary action, with the clarifying guarantee (original unaffected) placed last. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter, no-output-schema cleanup tool the description covers purpose, side effects, and safety. It is only short of explaining where plan_id comes from and what happens on an invalid or expired plan.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is one parameter at 0% schema description coverage, so plan_id is undocumented in the schema. The description implies provenance (it comes from prepare_compression) but never states that plan_id is that identifier, nor its format, so it only partially compensates for the coverage gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific action pair — discarding the prepare_compression result and cleaning temporary files — so the agent immediately understands this is the abort path of a three-step workflow. It differentiates itself from prepare_compression by naming it, but never names apply_compression, the sibling it actually competes with when a prepared plan is outstanding.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
By stating that it discards the output of prepare_compression, the description anchors usage to a clear precondition: you have a prepared plan you no longer want. No explicit when-not or alternative (apply_compression) is offered, so the agent must infer the fork from the sibling list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
prepare_compression预览图片压缩ARead-only
视觉无损压缩图片(JPEG/PNG/WebP/AVIF/GIF/SVG),结果存放在临时目录,不修改原图。返回 plan_id 和预览表。必须把预览表完整展示给用户,并在用户明确同意后才能调用 apply_compression。
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | 图片文件或目录路径,建议使用绝对路径 | |
| effort | No | fast:跳过质量判定;balanced:默认;max:更高压缩率、更慢 | balanced |
| min_score | No | SSIMULACRA2 及格线,85 为视觉无损 | |
| recursive | No | 是否递归子目录 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
readOnlyHint=true is already declared, but the description adds real behavior the annotation cannot: output lands in a temp directory, the original files are untouched, and the call yields a plan_id plus a preview table. It does not cover failure modes or how long the plan_id remains valid, so not a full 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences: capability and safety first, return values next, mandatory workflow constraint last. No repetition of the title or schema, and nothing padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-phase prepare/apply workflow with no output schema, the description supplies the return contract (plan_id + preview table) and the human-approval gate, which is what an agent most needs. Minor gaps remain around plan expiry or preview-table scale limits.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the schema already documents paths, effort, min_score, and recursive in detail (including the SSIMULACRA2 threshold and enum meanings). The description adds no parameter-level information, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('视觉无损压缩图片') plus supported formats and output location (临时目录, 不修改原图). It also names the sibling it hands off to (apply_compression), so an agent can distinguish it from apply_compression and cancel_compression without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit sequencing rules: the preview table must be shown to the user in full, and apply_compression may only be called after the user's explicit consent. That is a when-to-use and when-not-to-use condition paired with the named alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
apply_compression - First observed
cancel_compression - First observed
prepare_compression
TDQS
Scored across 3 tools
Each tool has a clearly distinct role in the workflow: prepare generates a compression plan and preview, apply commits the changes, and cancel discards the plan. There is no overlap in purpose, and the descriptions explicitly state when each should be used.
All tool names follow a consistent verb_noun pattern in snake_case: prepare_compression, apply_compression, cancel_compression. The verbs are distinct and the noun is consistent, making the pattern predictable.
With only 3 tools, the set is minimal but perfectly scoped to the compression workflow. Each tool corresponds to a necessary step (prepare, apply, cancel), and no extraneous tools are present.
The surface covers the full lifecycle: creating a compression plan with preview, committing the result, and aborting the operation. There are no obvious missing operations for the stated purpose of safe, preview-based image compression.
Maintenance
Related MCP Connectors
List compression profiles, estimate gains, and compress images, PDFs, and Office files.
- MochifyOAuthapp.mochify
Image and PDF toolkit: convert to AVIF/WebP/JXL, resize, crop, remove backgrounds, optimize PDFs.
Compress, convert and resize images, and scan web pages for every image they load.
Resize, convert to WebP, compress, crop, rotate and strip EXIF from images
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables conversion between multiple image formats including JPG, PNG, WebP, GIF, BMP, TIFF, SVG, ICO, and AVIF with quality control and batch processing capabilities.498 npm2MIT
- AlicenseNot gradedqualityDmaintenanceEnables batch image compression and resizing using the TinyPNG API. Supports PNG, JPEG, WebP, and AVIF formats with detailed compression reports and multiple resize modes.8 npm2ISC
- FlicenseNot gradedqualityDmaintenanceEnables image and video processing through FFmpeg, including compression, format conversion, resizing, and batch processing operations for common media formats.-
- AlicenseDqualityDmaintenanceConverts PNG, JPG, and JPEG images to WebP format with configurable quality and lossless compression, supporting single and batch conversion.24 npm1MIT