mcpField
T
Tinypng Mcp Server

Tinypng Mcp Server

本地服务
github.com/aiyogg媒体与设计751 周前更新

关于 Tinypng Mcp Server

Tinypng Mcp Server 是将 TinyPNG 图像压缩接入 MCP 的服务,适合通过 LLM 处理图像的用户。它提供本地文件和远程图像 URL 两种压缩工具。

主要功能

  1. 01压缩本地图像文件
  2. 02通过 URL 压缩远程图像

适用场景

  1. 01压缩本地待处理图像
  2. 02压缩远程地址中的图像

MCP 相关

该 MCP 服务向 MCP 客户端提供 TinyPNG 图像压缩工具,支持本地文件路径和远程图像 URL。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"tinypng": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
启动命令npx -y @smithery/cli

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@smithery/cli

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

TinyPNG 的 MCP 服务

smithery badge MseeP.ai Security Assessment Badge

tinypng-mcp-server MCP 服务
使用方法
使用 bun 或 node 运行服务
  1. 安装依赖并构建
pnpm i
pnpm build
  1. 编辑 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 Server:

npx -y @smithery/cli install @aiyogg/tinypng-mcp-server --client claude
工具
  1. 压缩本地图片
{
  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'],
  },
}
  1. 压缩远程图片
{
  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'],
  },
}

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。