Back to MCP directory
publicPublicdnsLocal runtime

mcp-image-compression

基于MCP架构的高性能图片压缩微服务

article

README

🚀 mcp-image-compression

mcp-image-compression 是一款基于 MCP(Modal Context Protocol)架构的高性能图像压缩微服务。它能为开发者提供快速且高质量的图像压缩能力,助力优化网站和应用程序中的图像资源,提升加载速度与用户体验。

🚀 快速开始

mcp-image-compression 是基于 MCP 架构的高性能图像压缩微服务,为开发者提供便捷的图像压缩能力,以下将介绍其功能、安装和使用方法。

✨ 主要特性

  • 多格式支持:支持主流图像格式包括 JPEG、PNG、WebP、AVIF。
  • 离线使用:无需连接互联网即可使用。
  • 智能压缩:根据图像内容自动选择最优的压缩参数。
  • 批量处理:支持同时压缩多个图像以提高效率。
  • 质量控制:可自定义压缩质量,平衡文件大小和视觉质量。

📦 安装指南

使用 NPX

{
  "mcpServers": {
    "Image compression": {
      "command": "npx",
      "args": [
        "-y",
        "@inhiblab-core/mcp-image-compression"
      ],
      "env": {
        "IMAGE_COMPRESSION_DOWNLOAD_DIR": "<YOUR_DIR>"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

构建容器

docker build -t mcp-image-compression .

💻 使用示例

基础用法

image_compression 工具可实现图像压缩功能,以下是其使用说明:

输入参数:
- `urls`(字符串):待压缩图像的 URL 地址
- `quality`(整数):压缩质量(0 - 100)
- `format`(字符串):压缩后图像格式(例如 "jpeg"、"png"、"webp"、"avif")

返回值:压缩后的图像 URL 地址

📄 许可证

此 MCP 服务根据 MIT 许可证发布。这意味着您可以自由使用、修改和分发该软件,但需遵守 MIT 许可证的条款和条件。有关详细信息,请参阅项目仓库中的 LICENSE 文件。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client