TinyPNG

by aiyogg

2 stars
357 downloads
Not rated
GitHub

About

Integrates with TinyPNG API to compress and resize both local and remote images with detailed optimization statistics for efficient image processing workflows.

Details

Author
aiyogg
Repository
aiyogg/tinypng-mcp-server
GitHub stars
2
Downloads
357
License
Apache License 2.0
Categories
Productivity, Developer Tools, Design, AI, Media, Infrastructure, Frontend, Other
Tags
#analytics

- Compress local images via absolute file paths
- Compress remote images via URLs
- Optionally specify output path and output format
- Supports multiple image formats (enum SUPPORTED_IMAGE_TYPES)
- Lightweight setup with bun or node

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name TinyPNG
    Command (node, npx, python, etc.) bun
    Arguments
    • Argument 1 /path/to/tinypng-mcp-server/src/index.ts
    Environment
    • TINYPNG_API_KEY your-tinypng-api-key

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

To install TinyPNG MCP Server for Claude Desktop automatically via Smithery:

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

compress_local_image

Compress a local image file. Parameters: imagePath (string, required) - The ABSOLUTE path to the image file to compress, outputPath (string) - The ABSOLUTE path to save the compressed image file, outputFormat (string) - The format to save the compressed image file.

compress_remote_image

Compress a remote image file by giving the URL of the image. Parameters: imageUrl (string, required) - The URL of the image file to compress, outputPath (string) - The ABSOLUTE path to save the compressed image file, outputFormat (string) - The format to save the compressed image file.

1. Compress local image

{
  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'],
  },
}

2. Compress remote image

{
  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'],
  },
}

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "tinypng": {
            "env": {
                "TINYPNG_API_KEY": "your-tinypng-api-key"
            },
            "args": [
                "/path/to/tinypng-mcp-server/src/index.ts"
            ],
            "command": "bun"
        }
    }
}

Linux

{
    "env": {
        "TINYPNG_API_KEY": "your-tinypng-api-key"
    },
    "args": [
        "/path/to/tinypng-mcp-server/src/index.ts"
    ],
    "command": "bun"
}

Macos

{
    "env": {
        "TINYPNG_API_KEY": "your-tinypng-api-key"
    },
    "args": [
        "/path/to/tinypng-mcp-server/src/index.ts"
    ],
    "command": "bun"
}

Windows

{
    "env": {
        "TINYPNG_API_KEY": "your-tinypng-api-key"
    },
    "args": [
        "/path/to/tinypng-mcp-server/src/index.ts"
    ],
    "command": "bun"
}

MCP server for TinyPNG

smithery badge MseeP.ai Security Assessment Badge

<a href="https://glama.ai/mcp/servers/@aiyogg/tinypng-mcp-server">
tinypng-mcp-server MCP server
</a>

Usage

Use bun or node to run the server

1. Install dependencies and build

pnpm i
pnpm build

2. Edit the mcp.json file

{
  "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"
      }
    }
  }
}

Installing via Smithery

To install TinyPNG MCP Server for Claude Desktop automatically via Smithery:

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

Tools

1. Compress local image

{
  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'],
  },
}

2. Compress remote image

{
  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'],
  },
}
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.