@image-converter/mcp

@image-converter/mcp

An MCP server for converting images to AVIF and WebP formats using ImageMagick, with batch conversion and quality control.

Category
访问服务器

README

@image-converter/mcp

An MCP (Model Context Protocol) server for converting images to AVIF and WebP formats using ImageMagick. Optimizes images for better web performance with support for batch conversion, quality control, and more.

Prerequisites

ImageMagick Installation

This package requires ImageMagick to be installed on your system.

Windows:

  • Download from https://imagemagick.org/script/download.php
  • Install and ensure magick command is in your PATH

macOS:

brew install imagemagick

Linux (Ubuntu/Debian):

sudo apt-get install imagemagick

Verify Installation:

magick -version

Installation

MCP Configuration

Add to your MCP configuration file:

For Claude Code (.claude.json):

{
  "mcpServers": {
    "image-converter": {
      "command": "node",
      "args": ["path/to/node_modules/@image-converter/mcp/src/index.js"]
    }
  }
}

For OpenCode (opencode.json):

{
  "mcp": {
    "image-converter": {
      "type": "local",
      "command": ["node", "path/to/node_modules/@image-converter/mcp/src/index.js"],
      "enabled": true
    }
  }
}

For Other MCP Clients:

# Install globally
npm install -g @image-converter/mcp

# Or use npx
npx @image-converter/mcp

Available Tools

convert_image

Convert a single image to AVIF or WebP format.

Parameters:

Parameter Type Required Default Description
inputPath string Yes - Path to input image
outputFormat string Yes - Output format: "avif" or "webp"
outputPath string No auto Custom output path
quality number No 75 Quality 1-100
critical boolean No false If true, applies 25% quality drop

Example:

convert_image({
  inputPath: "logo.png",
  outputFormat: "avif",
  quality: 75
})

convert_folder

Batch convert all images in a folder to AVIF or WebP format.

Parameters:

Parameter Type Required Default Description
inputFolder string Yes - Path to input folder
outputFolder string No same Output folder path
outputFormat string Yes - Output format: "avif" or "webp"
quality number No 75 Quality 1-100
critical boolean No false If true, applies 25% quality drop
recursive boolean No false Include subfolders
skipExisting boolean No true Skip if output exists

Example:

convert_folder({
  inputFolder: "./images",
  outputFormat: "avif",
  quality: 80,
  recursive: false,
  skipExisting: true
})

get_image_info

Get information about an image.

Parameters:

Parameter Type Required Description
path string Yes Path to image file

Example:

get_image_info({ path: "photo.jpg" })

list_images

List all images in a folder.

Parameters:

Parameter Type Required Default Description
folder string Yes - Path to folder
recursive boolean No false Include subfolders
formats array No all Filter by formats, e.g. ["png", "jpg"]

Example:

list_images({
  folder: "./assets",
  formats: ["png", "jpg", "webp"]
})

Usage Examples

Convert Single Image

User: "Convert logo.png to AVIF"
Agent calls: convert_image({ inputPath: "logo.png", outputFormat: "avif" })
Result: Creates logo.avif alongside logo.png

Batch Convert Folder

User: "Optimize all images in /assets to AVIF at quality 80"
Agent calls: convert_folder({ 
  inputFolder: "/assets", 
  outputFormat: "avif", 
  quality: 80 
})
Result: Creates .avif files for all supported images in /assets

Critical Mode (Maximum Compression)

User: "Convert image.jpg to AVIF with maximum compression"
Agent calls: convert_image({ 
  inputPath: "image.jpg", 
  outputFormat: "avif", 
  critical: true 
})
Result: Applies 75% of the quality setting (default 75 = ~56 effective)

Supported Formats

Input:

  • PNG, JPG/JPEG, WebP, GIF, BMP, TIFF

Output:

  • AVIF (default recommended)
  • WebP

Why AVIF?

AVIF offers significant advantages over traditional formats:

  • 50-70% smaller file sizes compared to JPEG/PNG
  • Better quality than WebP at similar file sizes
  • Supported by all modern browsers
  • Lossy & lossless compression options

Technology

This MCP server uses:

License

MIT License - see LICENSE file.

Author

Pratham Bindal

Contributing

Contributions welcome! Please open an issue or submit a PR.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选