小图片mcp服务器
测试-1
可用工具 (3 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
compress_local_image 4 个参数 需填 1 项
Compress a local image file
必填参数:imagePath
compress_remote_image 3 个参数 需填 1 项
Compress a remote image file by giving the URL of the image
必填参数:imageUrl
resize_image 5 个参数 需填 3 项
Resize an image file
必填参数:imagePath、width、height
服务介绍
MCP 服务器用于 TinyPNG
使用方法
使用 bun 或 node 运行服务器
- 安装依赖并构建
pnpm i
pnpm build
- 编辑
mcp.json文件
{
"mcpServers": {
"tinypng": {
"command": "bun", // or "node"
"args": ["/path/to/tinypng-mcp-server/src/index.ts"], // or "dist/index.js"
"env": {
"TINYPNG_API_KEY": "your-tinypng-api-key"
}
}
}
}
通过 Smithery 安装
要通过 Smithery 自动安装适用于 Claude Desktop 的 TinyPNG MCP 服务器:
npx -y @smithery/cli install @aiyogg/tinypng-mcp-server --client claude
工具
- 压缩本地图片
{
name: 'compress_local_image',
description: 'Compress a local image file',
inputSchema: {
type: 'object',
properties: {
imagePath: {
type: 'string',
description: 'The ABSOLUTE path to the image file to compress',
example: '/Users/user/Downloads/image.jpg',
},
outputPath: {
type: 'string',
description: 'The ABSOLUTE path to save the compressed image file',
example: '/Users/user/Downloads/image_compressed.jpg',
},
outputFormat: {
type: 'string',
description: 'The format to save the compressed image file',
enum: SUPPORTED_IMAGE_TYPES,
example: 'image/jpeg',
},
},
required: ['imagePath'],
},
}
- 压缩远程图片
{
name: 'compress_remote_image',
description: 'Compress a remote image file by giving the URL of the image',
inputSchema: {
type: 'object',
properties: {
imageUrl: {
type: 'string',
description: 'The URL of the image file to compress',
example: 'https://example.com/image.jpg',
},
outputPath: {
type: 'string',
description: 'The ABSOLUTE path to save the compressed image file',
example: '/Users/user/Downloads/image_compressed.jpg',
},
outputFormat: {
type: 'string',
description: 'The format to save the compressed image file',
enum: SUPPORTED_IMAGE_TYPES,
example: 'image/jpeg',
},
},
required: ['imageUrl'],
},
}