home / mcp / image compression mcp server

Image Compression MCP Server

A high-performance image compression microservice based on MCP (Modal Context Protocol)

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "inhiblabcore-mcp-image-compression": {
      "command": "npx",
      "args": [
        "-y",
        "@inhiblab-core/mcp-image-compression"
      ],
      "env": {
        "IMAGE_COMPRESSION_DOWNLOAD_DIR": "<YOUR_DIR>"
      }
    }
  }
}

You run a high-performance image compression service built on the MCP (Modal Context Protocol) architecture. It lets you compress images in multiple formats quickly, with smart quality control and batch processing, all in offline mode. This makes it easy to optimize images for fast loading on websites and apps while keeping visual quality high.

How to use

You connect to the image compression MCP server using a client and invoke the available tool to compress images. Provide the URLs of the images you want to process, choose a target format and a quality level, and the service will return URLs to the compressed images. You can batch multiple images for concurrent processing to improve throughput.

Key inputs you can provide include the following for each compression task: the list of image URLs, the desired quality on a scale from 0 to 100, and the target output format (jpeg, png, webp, avif). The service automatically selects compression parameters suitable for the image content to balance file size and visual quality. If you need to process many images, you can run multiple compression requests in parallel to maximize throughput.

When you receive the results, you will get URLs pointing to the compressed images in the requested formats. You can then host or cache these images as needed in your application workflow.

How to install

Prerequisites: ensure you have Node.js and npm available on your machine. You may also run the service via Docker if you prefer containerized deployment.

Option A — NPX (local run) using the MCP package:

Option B — Build and run with Docker (if you prefer containerized deployment): build the image and run a container using the following command sequence.

docker build -t mcp-image-compression .

docker run -e IMAGE_COMPRESSION_DOWNLOAD_DIR="<YOUR_DIR>" -p 8080:8080 --name mcp-image-compression mcp-image-compression

Available tools

image_compression

Image compression. Inputs: urls (strings) of images to compress, quality (int 0-100), format (string, e.g. jpeg/png/webp/avif). Returns: compressed image URLs.