返回市场
小图片-mcp服务器

小图片-mcp服务器

作者:aiyogg4 星标更新:2025-11-05

项目介绍

TinyPNG 的 MCP 服务器

smithery 徽章 MseeP.ai 安全评估徽章

<a href="https://glama.ai/mcp/servers/@aiyogg/tinypng-mcp-server"> <img width="380" height="200" src="https://gips1.baidu.com/it/u=2436565247,1715843160&fm=3081&app=3081&f=PNG?w=760&h=400" alt="tinypng-mcp-server MCP 服务器" /> </a>

使用方法

使用 bunnode 运行服务器

  1. 安装依赖并构建
pnpm i
pnpm build
  1. 编辑 mcp.json 文件
{
  "mcpServers": {
    "tinypng": {
      "command": "bun", // 或 "node"
      "args": ["/path/to/tinypng-mcp-server/src/index.ts"], // 或 "dist/index.js"
      "env": {
        "TINYPNG_API_KEY": "your-tinypng-api-key"
      }
    }
  }
}

通过 Smithery 安装

要通过 Smithery 自动安装 TinyPNG MCP 服务器到 Claude Desktop:

npx -y @smithery/cli install @aiyogg/tinypng-mcp-server --client claude

工具

  1. 压缩本地图片
{
  name: 'compress_local_image',
  description: '压缩一个本地图片文件',
  inputSchema: {
    type: 'object',
    properties: {
      imagePath: {
        type: 'string',
        description: '要压缩的图片文件的绝对路径',
        example: '/Users/user/Downloads/image.jpg',
      },
      outputPath: {
        type: 'string',
        description: '保存压缩后图片文件的绝对路径',
        example: '/Users/user/Downloads/image_compressed.jpg',
      },
      outputFormat: {
        type: 'string',
        description: '保存压缩后图片文件的格式',
        enum: SUPPORTED_IMAGE_TYPES,
        example: 'image/jpeg',
      },
    },
    required: ['imagePath'],
  },
}
  1. 压缩远程图片
{
  name: 'compress_remote_image',
  description: '通过提供图片的 URL 来压缩远程图片文件',
  inputSchema: {
    type: 'object',
    properties: {
      imageUrl: {
        type: 'string',
        description: '要压缩的图片文件的 URL',
        example: 'https://example.com/image.jpg',
      },
      outputPath: {
        type: 'string',
        description: '保存压缩后图片文件的绝对路径',
        example: '/Users/user/Downloads/image_compressed.jpg',
      },
      outputFormat: {
        type: 'string',
        description: '保存压缩后图片文件的格式',
        enum: SUPPORTED_IMAGE_TYPES,
        example: 'image/jpeg',
      },
    },
    required: ['imageUrl'],
  },
}