Tinify image tools
dev.tinify由 tinify.dev 發布v0.1.7更新於 Oct 24, 2026
Compress, resize, crop, and convert images with the Tinify.dev API from any MCP client.
概覽
本機 MCP 伺服器,讓助理透過 Tinify.dev API 壓縮、縮放、裁切與轉換圖片,並將結果寫入新檔案。
- 可以做什麼
- 壓縮 PNG、JPEG、WebP 與 AVIF 檔案,可選品質模式與目標大小
- 依寬度、高度或比例縮放圖片,可選擇維持長寬比
- 依矩形裁切圖片,並在 AVIF、WebP、JPEG、PNG 之間轉換格式
- 查詢方案、計費週期與剩餘操作次數
- 回傳精確的位元組數據,並說明檔案是否真的被最佳化
- 適用情境
- 適合讓助理處理本機上的圖片素材,例如批次壓縮截圖資料夾、為網頁調整照片尺寸,並查看實際的壓縮前後大小,而不是估算的節省比例。
- 執行需求
- 透過 npx 在本機執行,需要 Node.js 20 或更新版本。需在 TINIFY_API_KEY 環境變數中提供 Tinify.dev API 金鑰,免費額度為每月 500 次操作。選用環境變數 TINIFY_BASE_URL 可覆寫 API 位址。需要能連線至 Tinify.dev API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Tinify image tools,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@tinify-dev/mcp
MCP (Model Context Protocol) server for the Tinify.dev image API. Lets ChatGPT, Claude, Cursor, and other MCP clients compress, resize, crop, and convert images — with honest results.
- Never lies about savings — when the API cannot shrink a file it says so (
optimized: false) instead of writing a byte-identical "optimized" copy. - Never overwrites your originals silently — results go to
<name>.min.<ext>beside the input, or to an explicitoutput_path. Replacing a file requiresoverwrite: true. - Raw numbers in
structuredContenton every call, so agents can do math instead of parsing prose.
Not affiliated with TinyPNG. This server talks to the Tinify.dev API.
Requirements
- Node.js >= 20
- A Tinify.dev API key from tinify.dev/developers — free tier is 500 operations/month, no card required.
Setup
Claude Desktop
Add to claude_desktop_config.json (Settings → Developer → Edit Config):
Claude Code
Cursor
Create .cursor/mcp.json in your project (or ~/.cursor/mcp.json globally):
Remote server (hosted)
The same five tools are available as a hosted streamable-HTTP MCP server - no install, works from ChatGPT connectors, the claude.ai directory, and any registry that expects a URL:
Two ways to authenticate:
- OAuth (for connectors) - ChatGPT connectors and the claude.ai directory only speak "OAuth" or "no auth". Add the server by its URL (
https://api.tinify.dev/mcp) and pick OAuth; the client discovers the authorization and token endpoints automatically from the server's.well-knownmetadata, registers itself, and opens a Connect Tinify page where you paste your Tinify API key. Your key stays the credential - the client only ever holds an opaque token that maps back to it server-side. - Direct bearer (for scripts/CLIs) - send
Authorization: Bearer tnf_live_...(ortnf_test_...) and skip OAuth entirely. Unchanged.
ChatGPT developer-mode connection
-
In ChatGPT, open Settings → Security and login and enable Developer mode.
-
Open ChatGPT Plugins, select the plus button, and add
https://api.tinify.dev/mcp. -
Complete Connect Tinify with a Tinify API key.
-
Add the connection from the conversation's tools menu, attach a PNG/JPEG/WebP/AVIF, and ask:
The hosted server cannot access local paths, so each image tool accepts exactly one of:
image— the ChatGPT attachment object. ChatGPT fills this automatically because the descriptor advertisesopenai/fileParams.image_base64— a portable fallback for other MCP clients, capped at ~28 MB decoded.
ChatGPT attachment downloads are HTTPS-only, reject private/reserved network targets and redirects, time out after 30 seconds, and are capped at the Tinify API's 40 MB limit. Successful operations return exact byte metrics and a temporary MCP result link. Existing base64 callers also receive structuredContent.image_base64 for backwards compatibility. get_usage is identical to the local version. Nothing is written to the user's filesystem.
Try it with curl:
For local files, prefer the stdio server above - it reads and writes them directly with no base64 round-trip and no 28 MB cap.
One server, two transport adapters
This repository intentionally supports both OpenAI and Claude:
- The shared tool names, Tinify client, result metrics, errors, and annotations are platform-neutral.
- The stdio adapter uses absolute local paths and writes files for desktop/CLI clients such as Claude, Cursor, and Codex.
- The hosted adapter uses ChatGPT file attachments or base64 and returns temporary result links because hosted servers cannot read a user's filesystem.
An OpenAI-only repository would duplicate the Tinify logic and make behavior drift more likely. OpenAI-specific descriptor metadata stays as a small additive layer in the hosted adapter; a separate repository is not needed.
For public OpenAI submission, set the portal-provided domain token as
OPENAI_APPS_CHALLENGE_TOKEN in /etc/tinify/mcp-http.env and deploy the
matching nginx location from deploy/nginx-location.conf. The endpoint returns
only that token at /.well-known/openai-apps-challenge; do not commit the real
portal token.
Tools
All image tools require absolute paths (MCP servers run with an unpredictable working directory) and pre-check the 40 MB API limit locally. API errors come back as readable tool errors with the error code and request_id to quote to support.
Example prompts
- "Compress every PNG in /Users/me/site/static/img"
- "Resize /Users/me/photo.jpg to 1200px wide and tell me how many bytes it saved"
- "Convert /Users/me/hero.png to webp with best quality"
- "How many Tinify operations do I have left this month?"
Limits and privacy
- Max 40 MB / 50 MP per image; PNG, JPEG, WebP, AVIF.
- Uploaded images and results are deleted from Tinify.dev servers after 2 hours.
- The server only reads the files you point it at and only writes where it tells you it wrote.
Troubleshooting
- "TINIFY_API_KEY is not set" — the server exits at startup with the exact config snippet to fix it. Add the key to the
envblock of your MCP config. invalid_api_key— the key is wrong or revoked; create a new one at tinify.dev/developers.quota_exhausted(429) — the monthly quota is used up; runget_usageto see the period end.- "path must be absolute" — pass full paths like
/Users/you/img.png, not./img.png. - Logs go to stderr; in Claude Desktop see
~/Library/Logs/Claude/mcp-server-tinify.log.
Roadmap
- Batch tools (create/commit/wait/download) on top of the durable batch API — not in v1.
License
MIT © Stian Larsen
One-click / one-line installs
Cursor: Add to Cursor - then set your real key in Cursor's MCP settings.
VS Code:
Codex CLI:
or in ~/.codex/config.toml:
Claude Code plugin (MCP + image-optimization skill):
More: https://tinify.dev/mcp
來源:README.md,提交 957bc95
工具
0版本歷史
1- v0.1.7最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分