一个用于全面图像编辑操作的 Model Context Protocol (MCP) 服务器,包括调整大小、格式转换、裁剪、压缩等。
<a href="https://glama.ai/mcp/servers/@flowy11/imagician"> <img width="380" height="200" src="https://gips0.baidu.com/it/u=3929151576,3597198644&fm=3081&app=31&f=PNG?w=760&h=400" alt="Imagician MCP 服务器" /> </a>npm install -g @flowy11/imagician
git clone https://github.com/flowy11/imagician.git
cd imagician
npm install
npm run build
添加到你的 Claude Code 配置 (~/.config/claude/config/settings/mcp-servers.json):
{
"imagician": {
"command": "npx",
"args": ["-y", "@flowy11/imagician"]
}
}
添加到你的 Cursor 配置 (~/.cursor/mcp_settings.json):
{
"mcpServers": {
"imagician": {
"command": "npx",
"args": ["-y", "@flowy11/imagician"]
}
}
}
添加到你的 Claude Desktop 配置 (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"imagician": {
"command": "npx",
"args": ["-y", "@flowy11/imagician"]
}
}
}
{
"mcpServers": {
"imagician": {
"command": "imagician"
}
}
}
{
"mcpServers": {
"imagician": {
"command": "node",
"args": ["/path/to/imagician/dist/index.js"]
}
}
}
将图像调整到指定尺寸,并提供多种适配选项。
参数:
- inputPath: 输入图像路径
- outputPath: 调整大小后保存图像的路径
- width: 目标宽度(像素,可选)
- height: 目标高度(像素,可选)
- fit: 如何调整大小(cover, contain, fill, inside, outside)
- preserveAspectRatio: 是否保持宽高比(默认: true)
在图像格式之间转换,并进行质量控制。
参数:
- inputPath: 输入图像路径
- outputPath: 转换后保存图像的路径
- format: 目标格式(jpeg, png, webp, avif)
- quality: 有损格式的质量(1-100,默认: 80)
从图像中提取特定区域。
参数:
- inputPath: 输入图像路径
- outputPath: 裁剪后保存图像的路径
- left: 左偏移量(像素)
- top: 上偏移量(像素)
- width: 裁剪区域宽度
- height: 裁剪区域高度
通过质量设置减少图像文件大小。
参数:
- inputPath: 输入图像路径
- outputPath: 压缩后保存图像的路径
- quality: 压缩质量(1-100,默认: 80)
- progressive: 对于 JPEG 是否使用渐进编码(默认: true)
以任意角度旋转图像。
参数:
- inputPath: 输入图像路径
- outputPath: 旋转后保存图像的路径
- angle: 旋转角度(度数,正值表示顺时针)
- background: 显示区域的背景颜色(默认: #000000)
水平或垂直镜像图像。
参数:
- inputPath: 输入图像路径
- outputPath: 镜像后保存图像的路径
- direction: 镜像方向(horizontal, vertical, both)
提取关于图像的元数据和信息。
参数:
- inputPath: 图像文件路径
返回:格式、尺寸、色彩空间、文件大小等。
从一张图像生成多个尺寸(适用于响应式图像)。
参数:
- inputPath: 输入图像路径
- outputDir: 保存调整大小后的图像目录
- sizes: 包含 {width, height?, suffix} 的数组
- format: 所有尺寸的输出格式(可选)
"请将 image.jpg 调整为 800x600 像素"
"将 photo.png 转换为 WebP 格式,质量为 90%"
"从 (100, 100) 开始裁剪 avatar.jpg,尺寸为 200x200"
"生成缩略图尺寸:150px、300px 和 600px 宽"
# 安装依赖
npm install
# 构建 TypeScript
npm run build
# 开发模式运行
npm run dev
MIT