io.github.onepunchtechnology/tinify-ai

编码与调试

by onepunchtechnology

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

什么是 io.github.onepunchtechnology/tinify-ai

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

README

@glassypic/mcp-server

npm version License: MIT MCP

MCP server for GlassyPic. One tool that turns raw images into production-ready assets. Support upscaling, resizing/cropping, compression, file format conversion, and SEO filename & alt text generation. Just describe the outcome you want in natrual language.

Quick Start

Add to your MCP client config:

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

No signup required. Works out of the box with 20 free daily credits.

Windows users: If the server doesn't appear after editing a JSON config, your client likely can't resolve npx from PATH (a common, silent failure). Wrap the command with cmd /c:

json
{
  "mcpServers": {
    "glassypic": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@glassypic/mcp-server@latest"]
    }
  }
}

This applies to the hand-edited JSON configs below (Claude Desktop, Cursor, Windsurf, Cline). The CLI commands (Claude Code, Gemini CLI, Codex CLI) are unaffected.

Client-Specific Setup

<details> <summary><strong>Claude Desktop</strong></summary>

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{
  "mcpServers": {
    "glassypic": {
      "command": "npx",
      "args": ["-y", "@glassypic/mcp-server@latest"]
    }
  }
}
</details> <details> <summary><strong>Claude Code</strong></summary>
bash
claude mcp add glassypic -- npx -y @glassypic/mcp-server@latest
</details> <details> <summary><strong>Cursor</strong></summary>

Add to .cursor/mcp.json in your project root:

json
{
  "mcpServers": {
    "glassypic": {
      "command": "npx",
      "args": ["-y", "@glassypic/mcp-server@latest"]
    }
  }
}
</details> <details> <summary><strong>Windsurf</strong></summary>

Edit ~/.codeium/windsurf/mcp_config.json:

json
{
  "mcpServers": {
    "glassypic": {
      "command": "npx",
      "args": ["-y", "@glassypic/mcp-server@latest"]
    }
  }
}
</details> <details> <summary><strong>Smithery</strong></summary> Install via Smithery: [![smithery badge](https://smithery.ai/badge/glassypic/mcp-server)](https://smithery.ai/servers/glassypic/mcp-server) </details> <details> <summary><strong>Cline</strong></summary>

Open Cline settings → MCP Servers → Add, then paste:

json
{
  "mcpServers": {
    "glassypic": {
      "command": "npx",
      "args": ["-y", "@glassypic/mcp-server@latest"]
    }
  }
}
</details> <details> <summary><strong>Gemini CLI</strong></summary>
bash
gemini mcp add --transport stdio glassypic npx -y @glassypic/mcp-server@latest

Or edit ~/.gemini/settings.json (global) or .gemini/settings.json in your project root:

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

Verify it's running inside Gemini CLI with /mcp list.

</details> <details> <summary><strong>OpenAI Codex CLI</strong></summary>
bash
codex mcp add glassypic -- npx -y @glassypic/mcp-server@latest

Or edit ~/.codex/config.toml manually:

toml
[mcp_servers.glassypic]
command = "npx"
args = ["-y", "@glassypic/mcp-server@latest"]
</details>

Tool: optimize_image

One tool that turns raw images into production-ready assets using AI-powered algorithm and multi-step agents (typically 60-80% size reduction), with optional resize, upscale, format conversion, and SEO metadata generation. Supports JPEG, PNG, WebP, HEIC, GIF, AVIF, TIFF, and BMP. Accepts absolute local file paths or remote URLs.

Parameters

ParameterTypeRequiredDefaultDescription
inputstringYesAbsolute local file path or remote URL
output_pathstringNoautoFile path or directory (ending in /). If omitted: saves next to original with SEO slug or .glassypic suffix
output_formatstringNooriginaljpg, png, webp, avif, gif, or original
output_width_pxintNoTarget width in pixels
output_height_pxintNoTarget height in pixels
output_upscale_factorintNoAI upscale factor: 2 (2×) or 4 (4×)
output_resize_behaviorstringNopadpad (white padding) or crop (smart crop). Only used when both width and height are set
output_seo_tag_genboolNotrueGenerate SEO metadata and rename file to SEO slug. Costs 1 extra credit
output_file_size_limitintNoTarget maximum output file size in bytes. Server attempts to meet this via additional compression. Not guaranteed
gif_frame_limitintNo100Max frames to process for animated GIFs (1–100). Reduces credit cost by sampling fewer frames
confirm_gif_costboolNoSet to true to proceed after reviewing the animated GIF cost warning. Required for animated GIFs

Resize Behavior

Dimensions providedBehavioroutput_resize_behavior
Width onlyProportional scaleN/A
Height onlyProportional scaleN/A
Width + HeightExact dimensions, white paddingpad (default)
Width + HeightExact dimensions, smart cropcrop

Examples

Basic compression — just compress, keep format and dimensions:

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

Convert to WebP:

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

Resize proportionally — set one dimension, the other scales:

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

Exact dimensions with padding — white bars fill the gap:

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

Exact dimensions with smart crop:

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

AI upscale 4x:

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

From URL, save to directory:

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

Skip SEO to save 1 credit:

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

Output

Returns a text summary and structured metadata:

code
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

Structured output fields:

json
{
  "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"
}

Supported Formats

FormatInputOutputNotes
JPGYesYes
PNGYesYes
WebPYesYes
AVIFYesYes
GIFYesYesAnimated GIFs preserved when output is GIF
SVGYesYesSVG→SVG optimized via SVGO; raster↔SVG conversion supported
ICOYesYesSmart rebuild: generates 16, 24, 32, 48, 256px favicon set
HEIC/HEIFYes*NoAuto-converted to JPG at upload
TIFFYes*NoAuto-converted to JPG at upload
BMPYes*NoAuto-converted to JPG at upload

GlassyPic supports high-quality conversion between any input and output format combination. Converting an animated GIF to a non-GIF format (JPG, PNG, WebP, AVIF) preserves only the first frame. Converting an animated GIF to a GIF format supports upscaling/resizing while preserving the animation and quality. You may also reduce animated GIF file size by decreasing the number of output frames.

Max upload file size: 50 MB.

SVG & ICO Examples

code
# 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

How It Works

code
Local file or URL
  → Upload to GlassyPic 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 .glassypic suffix if SEO disabled)

All processing happens server-side via the GlassyPic API. The MCP server is a thin client that orchestrates the pipeline.

Credits

GuestFreeProMax
Credits/day or month20/day50/day3,000/month10,000/month
Images/day (default settings)~5~12~750~2,500
Cost per image3 credits + 1 SEOsamesamesame
Signup requiredNoFree signupPaidPaid

Session data is stored locally at ~/.glassypic/session.json and persists across invocations.

Account & Credits

Log in to unlock more credits and share them across the web app and MCP server:

code
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.

login

Opens a browser window to complete login (Google, Facebook, or email/magic link). After approval, your account is linked and credits are shared with the web app.

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

status

Check your current account status and credits before batch processing:

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

logout

Revokes the session and reverts to guest mode (20 credits/day).

upgrade

Opens glassypic.com/pricing in your browser.

Tips for AI Agents

Paste this into your CLAUDE.md or system prompt to help agents use the tool effectively:

code
## GlassyPic 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.

Troubleshooting

Server not appearing in tool list:

  • Restart your MCP client after editing the config
  • Ensure Node.js >= 18 is installed: node --version
  • Try running directly: npx -y @glassypic/mcp-server@latest (should start without errors)
  • On Windows: if the server silently never loads, wrap the command with cmd /c ("command": "cmd", "args": ["/c", "npx", "-y", "@glassypic/mcp-server@latest"]) — see the Windows note under Quick Start

"Insufficient credits" error:

  • Use the status tool to check remaining credits
  • Use the login tool to sign in for more credits (free accounts get 50/day)
  • Use the upgrade tool to see paid plans (Pro: 3,000/month, Max: 10,000/month)
  • Disable SEO tags (output_seo_tag_gen: false) to reduce cost to 3 credits/image

Login browser window doesn't open:

  • Open this URL manually: https://glassypic.com/mcp/authorize and enter the code shown in the terminal
  • Ensure a browser is installed and accessible

Session token issues:

  • Session data is stored at ~/.glassypic/session.json
  • Delete this file to reset and start fresh
  • Use logout then login to re-authenticate

File not found:

  • Use absolute paths for local files
  • For URLs, ensure the image is publicly accessible

Timeout errors:

  • Large images or AI upscaling can take 30-60 seconds
  • The server has a 60-second timeout per job

Requirements

  • Node.js >= 18
  • An MCP-compatible client (Claude Desktop, Claude Code, Cursor, Windsurf, Cline, OpenAI Codex CLI, Gemini CLI, etc.)

License

MIT - see LICENSE.

常见问题

io.github.onepunchtechnology/tinify-ai 是什么?

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

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描165.3k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描165.3k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描165.3k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
89.1k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
60.0k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
49.5k

评论