Mcp_image_processor_to_vercel_blob

Mcp_image_processor_to_vercel_blob

🚀 图像处理器MCP服务器

本MCP服务器提供图像处理工具,并可将处理后的图像上传至Vercel Blob存储。它具备以下功能:

  1. 优化和调整图像大小(支持本地文件或URL图像)
  2. 将图像转换为WebP格式
  3. 将处理后的PNG和WebP版本图像上传至Vercel Blob存储

✨ 主要特性

  • 图像优化:调整图像大小并进行优化,提升性能
  • WebP转换:将图像转换为WebP格式,减小文件大小
  • Vercel Blob集成:自动将处理后的图像上传至Vercel Blob存储
  • 自定义尺寸:指定图像调整大小的自定义尺寸
  • URL支持:支持处理外部URL的图像

📦 安装指南

服务器已在MCP设置文件中完成安装和配置。它会使用环境变量中的Vercel Blob令牌。

💻 使用示例

基础用法

你可以在Claude中使用use_mcp_tool函数来使用MCP服务器。

处理本地图像


image-processor
process_and_upload_image

{
"imagePath": "/path/to/image.png",
"newName": "new-image-name",
"width": 550,
"height": 300
}


处理URL图像


image-processor
process_and_upload_image_from_url

{
"imageUrl": "https://example.com/image.jpg",
"newName": "new-image-name",
"width": 550,
"height": 300
}


参数说明

本地图像参数

  • imagePath(必需):要处理的图像文件路径
  • newName(必需):处理后图像的新名称(不带扩展名)
  • width(可选):图像调整后的宽度(默认值:550)
  • height(可选):图像调整后的高度(默认值:300)

URL图像参数

  • imageUrl(必需):要处理的图像的URL
  • newName(必需):处理后图像的新名称(不带扩展名)
  • width(可选):图像调整后的宽度(默认值:550)
  • height(可选):图像调整后的高度(默认值:300)

响应结果

服务器将返回一个JSON响应,结构如下:

{
"success": true,
"message": "Successfully processed and uploaded image: new-image-name",
"results": {
"png": {
"fileName": "new-image-name_small.png",
"localPath": "/path/to/temp/new-image-name_small.png",
"blobUrl": "https://vercel-blob-url/new-image-name_small.png"
},
"webp": {
"fileName": "new-image-name.webp",
"localPath": "/path/to/temp/new-image-name.webp",
"blobUrl": "https://vercel-blob-url/new-image-name.webp"
}
}
}

高级用法

示例1:处理本地图像


<server_name>image-processorserver_name>
<tool_name>process_and_upload_imagetool_name>
<arguments>
{
"imagePath": "/pathto_file/image_name.png",
"newName": "test-processed-image",
"width": 550,
"height": 300
}
arguments>

示例2:处理URL图像


<server_name>image-processorserver_name>
<tool_name>process_and_upload_image_from_urltool_name>
<arguments>
{
"imageUrl": "https://pplx-res.cloudinary.com/image/upload/v1749567759/pplx_project_search_images/6dff647e4fb1083aecf9ea6b1d49ea19386be588.jpg",
"newName": "cloud-image",
"width": 550,
"height": 300
}
arguments>

以上两个示例将执行以下操作:

  1. 获取图像(本地路径或URL)
  2. 优化并将图像调整为550x300像素
  3. 创建带有"_small"后缀的PNG版本
  4. 创建WebP版本
  5. 将两个版本上传至Vercel Blob
  6. 返回上传图像的URL

🔧 技术细节

服务器使用了以下工具和库:

  • Sharp:用于图像处理和优化
  • @vercel/blob:用于上传至Vercel Blob存储
  • fs-extra:用于文件系统操作
  • 0 关注
  • 0 收藏,25 浏览
  • system 提出于 2025-10-01 11:27

相似服务问题

相关AI产品