Converts to and from JPG/JPEG format with quality control and resizing capabilities
Provides specific configuration paths for macOS when used with Claude Desktop
Runs on Node.js runtime with version requirements of Node.js >= 18.0.0
Available through npm package manager with requirements of npm >= 8.0.0
Uses Sharp as one of the image processing engines for high-performance image conversions
Supports SVG as an input format for conversion to other image formats
Built with TypeScript providing complete type safety
Uses Zod for runtime type checking to ensure data validity
Image Converter MCP Server
基于MCP(Model Context Protocol)协议的多格式图像转换服务器,支持JPG/PNG/WebP/GIF/BMP/TIFF/SVG/ICO/AVIF等格式互转。提供高性能的图像处理能力,支持批量转换、尺寸调整、质量控制等功能。
✨ 特性
- 🔄 多格式支持: 支持15+种图片格式互转
- 📁 批量处理: 一次性转换多个图片文件
- 🎯 智能输入: 支持文件路径和直接数据输入两种方式
- 📏 尺寸控制: 支持自定义宽高和保持宽高比
- 🎨 质量调节: 支持压缩质量控制(1-100)
- ⚡ 高性能: 基于Sharp和Jimp双引擎处理
- 🛡️ 类型安全: 完整的TypeScript支持
- 🔍 详细信息: 提供图片元数据查询功能
📦 安装
使用 npm
使用 yarn
从源码安装
🚀 使用方法
作为MCP服务器启动
在MCP客户端中使用
将以下配置添加到您的MCP客户端配置文件中:
📖 API参考
convert_image
转换单个图片文件
使用示例:
batch_convert_images
批量转换多个图片文件
get_image_info
获取图片文件信息
list_supported_formats
列出所有支持的图片格式
🎯 支持的格式
输入格式
- JPEG/JPG - 标准JPEG格式
- PNG - 便携式网络图形
- GIF - 图形交换格式
- BMP - 位图格式
- TIFF/TIF - 标记图像文件格式
- WebP - 现代Web图像格式
- SVG - 可缩放矢量图形
- ICO - 图标格式
- AVIF - AV1图像文件格式
- HEIC/HEIF - 高效图像格式(需要系统支持)
- PSD - Photoshop文档(有限支持)
输出格式
- JPEG/JPG - 有损压缩,适合照片
- PNG - 无损压缩,支持透明度
- WebP - 现代格式,优秀的压缩比
- GIF - 支持动画
- BMP - 无压缩位图
- TIFF - 高质量存档格式
- ICO - Windows图标格式
- AVIF - 下一代图像格式
- SVG - 矢量图形格式
⚙️ 配置
环境变量
配置文件
创建 config.json
文件:
📝 使用示例
基础转换
调整尺寸
批量转换
处理上传数据
🏗️ 开发
本地开发
项目结构
🚀 部署
Git仓库部署
- 初始化Git仓库
- 添加远程仓库
- 版本标签
NPM包发布
- 准备发布
- 发布到NPM
- 版本管理
必需的配置文件
package.json
.gitignore
.npmignore
🤝 贡献指南
我们欢迎所有形式的贡献!请遵循以下步骤:
报告问题
- 检查现有的Issues
- 创建新的Issue,包含:
- 问题描述
- 复现步骤
- 期望行为
- 实际行为
- 环境信息
提交代码
- Fork项目
- 创建功能分支
- 提交更改
- 推送分支
- 创建Pull Request
代码规范
- 使用TypeScript编写代码
- 遵循ESLint配置
- 添加适当的测试
- 更新相关文档
- 提交信息遵循Conventional Commits
提交信息格式
类型:
feat
: 新功能fix
: 修复bugdocs
: 文档更新style
: 代码格式调整refactor
: 代码重构test
: 测试相关chore
: 构建过程或辅助工具的变动
📄 许可证
本项目采用 MIT License 许可证。
👨💻 作者信息
CodeBuddy
- GitHub: @pickstar-2025
- Email: codebuddy@example.com
- 项目主页: https://github.com/pickstar-2025/image-converter-mcp
🙏 致谢
感谢以下开源项目:
- Sharp - 高性能图像处理库
- Jimp - JavaScript图像处理库
- Model Context Protocol - MCP协议规范
- TypeScript - 类型安全的JavaScript
- Zod - TypeScript优先的模式验证库
📊 统计信息
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables conversion between multiple image formats including JPG, PNG, WebP, GIF, BMP, TIFF, SVG, ICO, and AVIF with quality control and batch processing capabilities.
Related MCP Servers
- AsecurityAlicenseAqualityConverts various file types and web content to Markdown format. It provides a set of tools to transform PDFs, images, audio files, web pages, and more into easily readable and shareable Markdown text.Last updated -10111,966TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that provides tools for converting SVG code to high-quality PNG and JPG images with detailed customization options.Last updated -112JavaScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that converts SVG code to PNG images, offering two conversion methods (CairoSVG and Inkscape) with support for custom working directories.Last updated -3Python
- AsecurityAlicenseAqualityConverts video files to GIF animations with customizable settings like FPS, dimensions, and duration.Last updated -17JavaScriptMIT License