Skip to main content
Glama

FitFileSize MCP server

Let your AI assistant make a PDF or image fit an upload limit, or a form's exact rules, with FitFileSize.

"Make ~/Downloads/signature.jpg fit the IBPS signature rules"

Saved ~/Downloads/signature.fit.jpg for IBPS signature (JPEG, 140 × 60 pixels, 10 KB to 20 KB): 10,240 bytes (10.0 KB), under the 20,000 bytes limit.

  • Any limit: "get this scan under 300 KB", "this photo under 50 KB".

  • Form presets: US visa photo (DS-160), Indian e-Visa passport page and photo, IBPS, SBI, RRB, SSC, NEET, JEE Main, CUET and GATE uploads, IRCC documents, and Discord emoji, profile banners and message uploads. The preset sets the size limit, the minimum size and the exact pixels. Ask for list_forms to see them all.

  • Several files at once: "fit these five documents under 2 MB each".

  • Keeps as much quality as the limit allows, and saves the result next to the original as <name>.fit.<ext>. Every file keeps its format (a PNG stays a PNG) unless you say a JPEG is fine; iPhone HEIC photos come back as JPEG.

  • Free, no account, no API key. Files up to 50 MB.

Setup

Needs Node.js 20.10 or newer. Step-by-step setup with copy buttons: fitfilesize.com/claude.html.

Claude Code

claude mcp add fitfilesize -- npx -y fitfilesize-mcp

Claude Desktop, Cursor, Windsurf and other clients that use an mcpServers config file:

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

(Claude Desktop: Settings → Developer → Edit Config. Cursor: ~/.cursor/mcp.json.)

VS Code (.vscode/mcp.json):

{
  "servers": {
    "fitfilesize": { "command": "npx", "args": ["-y", "fitfilesize-mcp"] }
  }
}

Related MCP server: pdfcompress-mcp

Tools

fit_file

Argument

path

Full path to the file (~/ works). PDF, JPEG, PNG, WebP, TIFF, BMP or HEIC (returned as JPEG), up to 50 MB.

paths

Instead of path: up to 10 files that share the same limit. Each is saved beside its original; one that fails is reported without stopping the rest.

limit

The upload limit, like "200KB" or "1.5MB". KB and MB are 1000-based, so the result passes a check done either way.

form

Instead of limit: a form preset from list_forms, like "ibps-photo".

width, height

Optional exact pixel size, images only.

fit

"crop" (default) or "pad" with white, when the pixel size changes the shape.

minimum

Optional smallest size, like "10KB". A small JPEG is padded up to it; the picture is unchanged.

jpeg_ok

Optional. true lets a PNG, WebP, TIFF or BMP come back as a JPEG when that is what fits. Off by default; when it would have helped, the result says so.

output

Optional path for the result, with path only.

list_forms

The form presets, each with its rules and the official source they come from. The list is read from fitfilesize.com/forms.json, so new forms appear without an update; a copy is bundled for when the site cannot be reached.

Privacy

The file is sent to FitFileSize's server over HTTPS, compressed there, and deleted as soon as the result is saved on your computer. Requests name the package and its version (fitfilesize-mcp/0.2.1), nothing about you. Nothing else leaves your machine. See the privacy page. Uploads count against the site's free limit of 30 an hour.

Development

npm install
npm test          # the tools through an MCP client, against a stand-in API
npm run build     # bundles the form presets from the website's data

FITFILESIZE_API points the server at another API, such as a local one (http://127.0.0.1:8000).

Licence

MIT, see LICENSE. This covers the MCP server in this folder; the rest of the FitFileSize repository is not open source.

Available Tools

2 tools
fit_fileFit files under an upload limitA

Compress a PDF or image (JPEG, PNG, WebP, TIFF, BMP, or an iPhone HEIC photo, which comes back as a JPEG) on this computer so it fits an upload limit, keeping as much quality as the limit allows, and save the result next to the original as ".fit.". Give path for one file or paths for up to 10 that share the same limit. Give either limit (like "200KB" or "1.5MB"; KB and MB are 1000-based, so the file passes a check done either way) or form (a form preset from list_forms, like "ibps-signature" or "us-visa-photo-ds160", which sets the limit, minimum size and exact pixels that form requires). Every file keeps its format unless jpeg_ok is true. Files up to 50 MB are uploaded to fitfilesize.com over HTTPS, compressed there, and deleted from the server as soon as each result is saved. Free, no account.

Inputs: fit, form, path, limit, +6 more.

list_formsList form presetsA
Read-only

The upload forms FitFileSize has presets for (visa photos, Indian exam and bank applications, and more), each with its size limit, minimum and pixel size, and the official source of those rules. Pass an id to fit_file as form.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have completely distinct purposes: fit_file performs the compression and list_forms only enumerates presets. There is no plausible scenario where an agent would confuse which one to call, and the descriptions even state the relationship (pass a form id from list_forms into fit_file).

    Naming Consistency5/5

    Both names use the same snake_case verb_noun convention (fit_file, list_forms) with no mixed styles or casing deviations. The pattern is predictable and readable even for only two tools.

    Tool Count4/5

    Two tools is minimal, but this is a deliberately narrow single-purpose server (compress a file to a size limit), and each tool clearly earns its place. It is slightly thin in that a size-estimate or verification operation could reasonably exist, but nothing feels padded or missing for the core job.

    Completeness4/5

    The core lifecycle is covered: enumerate presets, then compress one or many files by limit or form, with format and output-location behavior documented. Minor gaps exist, such as no way to preview an estimated result size before compressing, no control over the output path, and no programmatic format list.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides tools to convert, resize, compress, crop, and rotate files (images, audio, video, PDF, archives, and more) through formatika.app, processing files locally and preserving existing files.
      38
      61 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to analyze, compress, and verify PDFs while preserving text, vectors, and document structure, with configurable presets and target-size limits.
      1
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI agents to convert documents, images, and data files across 50+ format pairs and to run PDF/image operations such as merge, split, compress, rotate, protect, unlock, extract text, and resize or compress images. Files are passed URL-in and returned URL-out (or saved locally in stdio mode), with tools for checking credits and generating Stripe checkout or billing-portal links.
      18
      37 PyPI
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Converts Office documents, images, and e-books to PDF and transforms PDFs by merging, splitting, rotating, numbering, watermarking, compressing, protecting, or unlocking them, plus PDF-to-Word and PDF-to-image conversion, all driven by natural language. Files stay on the user's computer apart from the conversion itself, which runs on EU-hosted servers in France.
      15
      317 npm
      MIT