QV

qpd-v/mcp-image-downloader

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

17 stars 7 forks 质量 58 趋势 21Apache-2.0

一个MCP服务器,提供下载和优化图像的工具. 使用"模型上下文协议"(MCP)构建,此服务器使AI助手能够从URL下载图像并实现基本的.

概览

一个MCP服务器,提供下载和优化图像的工具. 这个服务器使用"模型背景协议"(MCP)来构建,使得AI助手能够从URL下载图像并完成基本的图像优化任务. - 通过正确错误处理从 URL 从 URL 下载图像 - 优化图像的选项有: - 调整大小( 维护侧面比) - 质量调整( JPEG/WebP) - 格式转换 将服务器添加到您的 MCP 配置( 例如 Claude Desktop 配置中): 从 URL 下载图像到指定的路径。 参数: - url: 要下载的图像的 URL - 输出Path: 保存图像的路径 创建图像的优化版本.

概述(AI 翻译)

一个MCP服务器,提供下载和优化图像的工具. 这个服务器使用"模型背景协议"(MCP)来构建,使得AI助手能够从URL下载图像并完成基本的图像优化任务.

□ 特性

  • 从 URL 下载图像,并妥善处理错误
  • 用下列选项优化图像:
  • 调整规模(维持宽比)
  • 质量调整(JPEG/WebP)
  • 格式转换

□ 安装

□ 使用量

作为 MCP 服务器

将服务器添加到您的 MCP 配置( 例如 Claude Desktop 配置中):

可用的工具

QQ 下载( I) 从 URL 下载图像到指定的路径。

参数:

  • [[T0]:要下载的图像的 URL
  • [[T1]: 保存图像的路径

QQ 优化图像 创建图像的优化版本。

参数:

  • [[T2]: 输入图像的路径
  • [[T3]: 保存优化图像的路径
  • width(可选):目标宽度(如果只指定宽度,则保持宽度比)
  • height(可选):目标高度(如果只指定了高度,则保持宽比)
  • quality(可选):JPEG/WebP质量(1-100)

□ 发展

□ 要求

  • 节点.js 16或以上

本页由 AI 翻译,技术细节请以原文为准。

README

MCP Image Downloader

An MCP server that provides tools for downloading and optimizing images. Built using the Model Context Protocol (MCP), this server enables AI assistants to download images from URLs and perform basic image optimization tasks.

Features

  • Download images from URLs with proper error handling
  • Optimize images with options for:
    • Resizing (maintaining aspect ratio)
    • Quality adjustment (JPEG/WebP)
    • Format conversion

Installation

# Clone the repository
git clone https://github.com/qpd-v/mcp-image-downloader.git
cd mcp-image-downloader

# Install dependencies
npm install

# Build the project
npm run build

Usage

As an MCP Server

Add the server to your MCP configuration (e.g., in Claude Desktop’s config):

{
  "mcpServers": {
    "image-downloader": {
      "command": "node",
      "args": ["/path/to/mcp-image-downloader/build/index.js"]
    }
  }
}

Available Tools

download_image

Downloads an image from a URL to a specified path.

Parameters:

  • url: URL of the image to download
  • outputPath: Path where to save the image

optimize_image

Creates an optimized version of an image.

Parameters:

  • inputPath: Path to the input image
  • outputPath: Path where to save the optimized image
  • width (optional): Target width (maintains aspect ratio if only width is specified)
  • height (optional): Target height (maintains aspect ratio if only height is specified)
  • quality (optional): JPEG/WebP quality (1-100)

Development

# Run in development mode
npm run start

# Build the project
npm run build

Requirements

  • Node.js 16 or higher
  • NPM or compatible package manager

License

MIT License - see the LICENSE file for details.

Author

qpd-v

Version

0.1.0 - Initial release

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "image-downloader": { "command": "node", "args": ["/path/to/mcp-image-downloader/build/index.js"] } } }