aiyogg_tinypng_mcp_server

aiyogg_tinypng_mcp_server

by aiyogg
An MCP server that enables image compression using TinyPNG through LLMs.

TinyPNG Image Compression via MCP Server

Overview

The TinyPNG Image Compression via MCP Server project is an integrated solution that allows users to quickly compress images using TinyPNG through Language Model (LLM) integrations. This MCP server provides a streamlined way to compress both local and remote images, making it an efficient tool for developers and users who need to optimize image sizes.

Tools

The project offers two main tools for image compression:

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

Configuration

To configure the MCP server, follow these steps:

  1. Install dependencies and build:
pnpm i
pnpm build
  1. 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"
      }
    }
  }
}

Usage

Run the server using bun or node:

bun /path/to/tinypng-mcp-server/src/index.ts

or

node /path/to/tinypng-mcp-server/dist/index.js

About

This project is designed to integrate TinyPNG with LLMs, providing a quick and efficient way to compress images. It supports both local and remote image compression, making it a versatile tool for developers.

Topics

License

This project is licensed under the Apache-2.0 license.

Features & Capabilities

Categories
mcp_server model_context_protocol tinypng image_compression api_integration typescript javascript

Implementation Details

Stats

0 Views
0 Favorites
1 GitHub Stars

Repository Info

aiyogg Organization

Similar Servers

continuedev_continue by continuedev
0
0
0