FitFileSize logo

FitFileSize

Compresses PDFs and images toward a target size, preserving formats and reporting when the target cannot be reached.

Install FitFileSize

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "fitfilesize": {
      "command": "npx",
      "args": [
        "-y",
        "fitfilesize-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio fitfilesize -- npx -y fitfilesize-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

npx -y fitfilesize-mcp

initialize succeeded but no response to tools/list.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The documented project compresses PDFs and images through a Python engine, CLI, FastAPI API, and optional React web interface. It first applies lossless processing, then searches progressively smaller settings until the target is met or the smallest achievable result is reached. Reach for the documented FitFileSize project when uploads must satisfy a size limit or exact image dimensions.

Use cases

  • Compress a PDF below a portal's upload limit
  • Reduce an image to a specified file size
  • Prepare an image at exact form dimensions
  • Check whether a file can reach a target size

Key features

  • Compresses PDFs and common image formats
  • Applies lossless processing before lossy compression
  • Searches a ladder of size and quality settings
  • Reports the smallest achievable file when needed
  • Supports exact image dimensions with cropping or padding
  • Provides CLI, API, worker, and web interfaces

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

14/14 checks healthy over the last 68d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · fitfilesize-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads508Package downloads in the last 30 days.
Last commit11d agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.

How FitFileSize works

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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about FitFileSize

It documents a Python engine, CLI, FastAPI web API, Redis/RQ worker, and React interface for compressing PDFs and images toward target sizes. No MCP-specific transport or tool list is provided.

The documentation does not provide MCP-server installation instructions. For the documented Python project, use Python 3.10 or newer, install Ghostscript for PDF processing, and run `pip install -e ".[dev]"`.

Cursor compatibility is not documented.

Run `fitpdf scan.pdf -t 4mb`. The engine performs a lossless pass first, then searches progressively more aggressive Ghostscript settings; if 4 MB is impossible, it returns the smallest achievable file and a floor warning.

Yes, HEIC input is supported and is returned as JPEG. Other documented formats include JPEG, PNG, WebP, TIFF, BMP, and PDF.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewFitFileSize AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/fitfilesize?style=directory)](https://allmcps.com/mcp/fitfilesize)
HTML Embed
<a href="https://allmcps.com/mcp/fitfilesize"><img src="https://allmcps.com/api/badge/fitfilesize?style=directory" alt="FitFileSize on AllMCPs" /></a>