# FitFileSize [Health: Active]

**Category:** 🎥 Multimedia Process  
**Repository:** https://github.com/Gautamstar/fitfilesize  
**GitHub Stars:** 1  
**npm Downloads (last month):** 508  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/fitfilesize

## Description
Compress a PDF or image to fit an upload limit or a form's rules (visa photos, exam forms).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "fitfilesize": {
    "command": "npx",
    "args": ["-y","fitfilesize-mcp"]
  }
}
```

## Documentation

## What FitFileSize MCP server does

The supplied repository describes FitFileSize MCP server as a file-compression project, but it does not document an MCP transport, host connection, or MCP tool definitions. Its documented interfaces are a Python package, the `fitpdf` command-line program, a FastAPI web API, and a React frontend. These interfaces process PDFs and common image formats against a requested maximum size.

Supported input formats are PDF, JPEG, PNG, WebP, TIFF, BMP, and HEIC. HEIC input is returned as JPEG. In normal image processing, the output keeps the input format. An exception applies when an exact width and height are requested: the result is JPEG, because that mode is intended for forms that require fixed pixel dimensions.

## How it works

The compression engine starts with a lossless pass. PDF processing can recompress streams, remove unused resources, and use object streams. JPEG processing re-encodes existing DCT coefficients, preserving pixels while removing metadata. If the result remains above the requested limit, the engine searches a ladder of settings to find the least aggressive option that fits.

PDF attempts lower image resolution and JPEG quality through Ghostscript. JPEG processing reduces dimensions and quality. PNG, TIFF, and BMP processing can reduce dimensions and color depth, beginning with 256 colors while retaining the original format. WebP follows a size-and-quality approach similar to JPEG while remaining WebP.

The search uses binary search over up to twelve rungs and at most four attempts. If no rung reaches the requested limit, it returns the smallest result it can produce and reports that the target is below the achievable floor. Exact-dimension processing crops to fill the requested frame or can add white padding when requested; at that size, the ladder varies JPEG quality only.

## Setup and configuration

The documented project requires Python 3.10 or newer. Ghostscript is required for PDF processing and is not needed for image processing. Install the project with `pip install -e ".[dev]"`; if Ghostscript is not on `PATH`, set `FITPDF_GS` to its location.

The CLI accepts targets such as `4mb` or `500kb`. Without a target, it performs only the lossless pass. Exit code 0 means the target was met, 2 means the compression floor was reached, and 1 indicates an error.

The complete web stack can run with Docker Compose. A backend-only inline mode avoids Docker and Redis by setting `FITPDF_INLINE=1`. A queued deployment uses Redis and a separate worker. The documented configuration includes upload limits, retention periods, Ghostscript timeouts, rate limits, CORS origins, and client-IP header handling.

## Limitations and notes

It also does not identify any MCP-specific tools, schemas, authentication method, or MCP endpoint. Those details should not be assumed from the documented FastAPI API.

Web jobs use temporary stored files. The original input, output, and job metadata are removed on separate retention timers, and unfinished jobs use a pending-job timeout. Ghostscript may require several times the input size in memory, so the configured upload limit should remain below the workers' memory capacity.

_Full upstream README: https://allmcps.com/mcp/fitfilesize/readme_

