Token导航 LogoToken导航TokenDH.com
Tinify AI MCP Server logo
设计创作未说明官方级别未说明来源级核验

Tinify AI MCP Server

MCP Server

AI驱动的图像优化服务器,支持图像压缩、调整大小/裁剪、放大以及SEO文件名和alt文本生成。

工具数

5

提示词数

0

GitHub Stars

2

资源数

0
图像处理格式转换TypeScriptClaudeClaude DesktopClaudeCursorWindsurfCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

onepunchtechnology

提供方

onepunchtechnology

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

@tinify ai/mcp服务器

](https://www.npmjs.com/package/@tinify-ai/mcp-server) ![License: MIT](https://opensource.org/licenses/MIT) ![MCP](https://modelcontextprotocol.io)

MCP服务器 tinify.ai 图像优化。AI支持的升级、调整大小/裁剪、压缩和SEO文件名和alt文本生成——所有这些都在一个工具中。

快速开始

添加到MCP客户端配置中:

{
  "mcpServers": {
    "tinify": {
      "command": "npx",
      "args": ["-y", "@tinify-ai/mcp-server@latest"]
    }
  }
}

无需注册。开箱即用,每天有20个免费积分。

客户端特定设置

Claude Desktop

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "tinify": {
      "command": "npx",
      "args": ["-y", "@tinify-ai/mcp-server@latest"]
    }
  }
}

Claude Code

claude mcp add tinify -- npx -y @tinify-ai/mcp-server@latest

Cursor

添加 .cursor/mcp.json 在项目根目录中:

{
  "mcpServers": {
    "tinify": {
      "command": "npx",
      "args": ["-y", "@tinify-ai/mcp-server@latest"]
    }
  }
}

Windsurf

编辑 ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "tinify": {
      "command": "npx",
      "args": ["-y", "@tinify-ai/mcp-server@latest"]
    }
  }
}

Cline

打开临床设置→ MCP服务器→ 添加,然后粘贴:

{
  "mcpServers": {
    "tinify": {
      "command": "npx",
      "args": ["-y", "@tinify-ai/mcp-server@latest"]
    }
  }
}

Gemini CLI

gemini mcp add --transport stdio tinify npx -y @tinify-ai/mcp-server@latest

或编辑 ~/.gemini/settings.json (全球)或 .gemini/settings.json 在项目根目录中:

{
  "mcpServers": {
    "tinify": {
      "command": "npx",
      "args": ["-y", "@tinify-ai/mcp-server@latest"]
    }
  }
}

验证它是否在Gemini CLI中运行 /mcp list.

OpenAI Codex CLI

codex mcp add tinify -- npx -y @tinify-ai/mcp-server@latest

或编辑 ~/.codex/config.toml 手动:

[mcp_servers.tinify]
command = "npx"
args = ["-y", "@tinify-ai/mcp-server@latest"]

工具: optimize_image

通过智能有损压缩(通常缩小60-80%)、可选的调整大小/升级/格式转换和AI生成的SEO元数据来优化图像。接受绝对本地文件路径或远程URL。

参数

参数类型必填默认说明
inputstring--绝对本地文件路径或远程URL
output_pathstringauto文件路径或目录(以结尾 /).如果省略:用SEO slug保存在原始文件旁边或 .tinified 后缀
output_formatstring原始jpg, png, webp, avif, gif,或 original
output_width_pxint--目标宽度(像素)
output_height_pxint--目标高度(像素)
output_upscale_factorint--AI高端因素: 2 (2×)或 4 (4×)
output_resize_behaviorstringpadpad (白色填充)或 crop (聪明的作物)。仅在同时设置宽度和高度时使用
output_seo_tag_genbooltrue生成SEO元数据并将文件重命名为SEO slug。额外收费1学分
output_file_size_limitint--目标最大输出文件大小(字节)。服务器试图通过额外的压缩来满足这一点。不保证
gif_frame_limitint100动画GIF要处理的最大帧数(1-100)。通过采样更少的帧来降低信用成本
confirm_gif_costbool--设置为 true 在查看动画GIF成本警告后继续。动画GIF需要

调整大小行为

提供的尺寸行为output_resize_behavior
仅限宽度比例比例N/A
仅限高度比例比例不适用
宽度+高度精确尺寸,白色填充pad (默认)
宽度+高度精确尺寸,智能裁剪crop

示例

基本压缩 --只需压缩,保持格式和尺寸:

{ "input": "/Users/me/photos/hero.png" }

转换为WebP:

{ "input": "/Users/me/hero.png", "output_format": "webp" }

按比例调整大小 --设置一个维度,其他比例:

{ "input": "/Users/me/hero.png", "output_width_px": 1200 }

带衬垫的精确尺寸 --白色条填补了空白:

{ "input": "/Users/me/hero.png", "output_width_px": 1080, "output_height_px": 1080 }

智能裁剪的精确尺寸:

{ "input": "/Users/me/hero.png", "output_width_px": 1080, "output_height_px": 1080, "output_resize_behavior": "crop" }

AI高档4x:

{ "input": "/Users/me/icon.png", "output_upscale_factor": 4 }

从URL保存到目录:

{ "input": "https://example.com/photo.jpg", "output_path": "/Users/me/assets/" }

跳过SEO可节省1学分:

{ "input": "/Users/me/hero.png", "output_seo_tag_gen": false }

输出

返回文本摘要和结构化元数据:

Optimized: /Users/me/photos/modern-office-workspace.webp
Size: 142.3 KB
Compression: 73%
Format: webp
Dimensions: 1920x1080
Alt text: Modern office workspace with laptop and coffee cup on wooden desk

结构化输出字段:

{
  "output_path": "/Users/me/photos/modern-office-workspace.webp",
  "output_size_bytes": 145715,
  "output_width_px": 1920,
  "output_height_px": 1080,
  "output_format": "webp",
  "compression_ratio": 0.27,
  "seo_alt_text": "Modern office workspace with laptop and coffee cup on wooden desk",
  "seo_keywords": ["office", "workspace", "laptop", "desk", "modern"],
  "seo_filename": "modern-office-workspace"
}

支持格式

格式输入输出注释
JPG
PNG
WebP
AVIF
GIF输出为GIF时保留动画GIF
SVGSVG→通过SVGO优化SVG;光栅↔支持SVG转换
ICO智能重建:生成16、24、32、48、256px的favicon集
HEIC/HEIF是\*上传时自动转换为JPG
TIFF是\*上传时自动转换为JPG
BMP是\*上传时自动转换为JPG

tinify.ai支持任何输入和输出格式组合之间的高质量转换。 将动态GIF转换为非GIF格式(JPG、PNG、WebP、AVIF)仅保留第一帧。 将动画GIF转换为GIF格式支持放大/调整大小,同时保留动画和质量。您还可以通过减少输出帧数来减小动画GIF文件的大小。

最大上传文件大小:50 MB。

SVG和ICO示例

# Optimize an SVG file (keeps as vector)
Optimize logo.svg and keep it as SVG

# Convert SVG to raster
Convert icon.svg to a 512x512 PNG

# Trace raster to vector SVG
Convert my logo.png to a vector SVG

# Generate favicon set from any image
Convert logo.png to an ICO favicon

# Generate single-size ICO
Convert logo.png to a 32x32 ICO

# Extract largest icon from ICO
Convert favicon.ico to PNG

运作原理

Local file or URL
  → Upload to Tinify.ai API
    → Smart compression (lossy, typically 60-80% reduction)
    → AI SEO tag generation (alt text, keywords, filename)
    → Optional: resize, upscale, format conversion
  → Download optimized file
    → Save with SEO filename slug (or .tinified suffix if SEO disabled)

所有处理都通过服务器端进行 Tinify.ai APIMCP服务器是一个编排管道的瘦客户端。

学分

访客免费专业最大
学分/天或月20/天50/天3000/月10000/月
图像/天(默认设置)~5~12~750~2500
每张图片的成本3个学分+1个搜索引擎优化相同相同同样
需要注册免费注册付费付费

会话数据存储在本地 ~/.tinify/session.json 并在调用之间持续存在。

账户和信用

登录以解锁更多积分,并在web应用程序和MCP服务器上共享:

Use the login tool to sign in.
Use the status tool to check your current credits.
Use the upgrade tool to open the pricing page.
Use the logout tool to sign out.

登录

打开浏览器窗口以完成登录(谷歌、脸书或电子邮件/魔术链接)。批准后,您的帐户将被链接,积分将与web应用程序共享。

Login complete: user@example.com (Pro tier, 2,850 of 3,000 credits remaining)

状态

在批处理之前,请检查您当前的帐户状态和信用:

Logged in as user@example.com (Pro tier)
Credits: 2,850 of 3,000 remaining
Resets: 03/01/2026, 12:00 AM PST

登出

取消会话并恢复到访客模式(20学分/天)。

升级

打开 tinify.ai/定价 在您的浏览器中。

AI代理提示

将此粘贴到您的 CLAUDE.md 或系统提示,以帮助代理有效地使用该工具:

## Tinify.ai MCP

Tools: optimize_image, login, logout, status, upgrade

- Use status to check credits before batch processing
- Each optimize_image call costs 3 credits + 1 if SEO enabled (default)
- Guest: 20 credits/day. Free account: 50/day. Pro: 3,000/month.
- Always use absolute file paths, not relative.
- Set only width OR height for proportional resize. Set both for exact dimensions.
- When both dimensions are set, use output_resize_behavior: "crop" for photos, "pad" for logos/icons.
- output_seo_tag_gen (default true) renames the file to an SEO slug and generates alt text + keywords.
- Set output_seo_tag_gen: false to save 1 credit when SEO metadata is not needed.
- GIF is supported for both input and output; animated GIFs stay animated when output_format is "gif".
- Converting an animated GIF to jpg/png/webp/avif preserves only the first frame.
- HEIC, TIFF, BMP inputs are auto-converted to JPG.
- For batch processing, call optimize_image once per file.
- If credits run out, use login to sign in or upgrade to open pricing.

故障排除

服务器未出现在工具列表中:

  • 编辑配置后重新启动MCP客户端
  • 确保已安装Node.js>=18: node --version
  • 尝试直接跑步: npx -y @tinify-ai/mcp-server@latest (应该开始时没有错误)

“信用不足”错误:

  • 使用 status 检查剩余积分的工具
  • 使用 login 登录以获取更多积分的工具(免费账户每天可获得50个积分)
  • 使用 upgrade 查看付费计划的工具(Pro:3000/月,Max:10000/月)
  • 禁用SEO标签(output_seo_tag_gen: false)将成本降低到3学分/张

登录浏览器窗口未打开:

  • 手动打开此URL: https://tinify.ai/mcp/authorize 并输入终端中显示的代码
  • 确保浏览器已安装且可访问

会话令牌问题:

  • 会话数据存储在 ~/.tinify/session.json
  • 删除此文件以重置并重新开始
  • 使用 logout 然后 login 重新验证

找不到文件:

  • 对本地文件使用绝对路径
  • 对于URL,确保图像可公开访问

超时错误:

  • 大图像或AI放大可能需要30-60秒
  • 服务器每个作业有60秒的超时时间

需求

  • Node.js>=18
  • MCP兼容客户端(Claude Desktop、Claude Code、Cursor、Windsurf、Cline、OpenAI Codex CLI、Gemini CLI等)

许可证

麻省理工学院-见 许可证.

目录标签

目录标签

图像处理格式转换TypeScriptClaude本地部署AI优化SEO工具图像压缩

支持客户端

Claude DesktopClaudeCursorWindsurfCline

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP