About FitFileSize
FitFileSize is an MCP server that adjusts PDFs and images to upload limits or specified form requirements. It serves people preparing application documents and supports batch processing, form presets, and preserving file formats where possible.
Key features
- 01Compress PDFs and images to a limit
- 02Apply form-specific size and pixel rules
- 03Process up to 10 files together
- 04Keep original format where possible
- 05List available form presets
Use cases
- 01Prepare documents for an online form
- 02Resize a signature image to stated dimensions
- 03Reduce several scans below an upload limit
- 04Fit an iPhone HEIC photo to an image requirement
MCP support
The MCP server exposes file fitting and form-listing tools to compatible clients. Files are sent to FitFileSize's server over HTTPS for compression and deleted after the result is saved.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
2Saved tool list · updated 1w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| fit | enum | No | When width and height change the shape: "crop" to fill (default) or "pad" with white.crop | pad |
| form | string | No | A form preset id or name from list_forms, like "ibps-photo". Use this or `limit`. |
| path | string | No | Full path to the file on this computer ("~/" is allowed). Use this or `paths`. |
| limit | string | No | Upload limit, like "200KB", "50 KB" or "1.5MB". Use this or `form`. |
| paths | array | No | Full paths to several files that share the same limit, up to 10. Use this or `path`. |
| width | integer | No | Exact width in pixels (images only). |
| height | integer | No | Exact height in pixels (images only). |
| output | string | No | Where to save the result, with `path` only. Defaults to "<name>.fit.<ext>" beside the original. |
| jpeg_ok | boolean | No | Let a PNG, WebP, TIFF or BMP come back as a JPEG when that is what fits. Only if the upload accepts JPEG; by default every file keeps its format. |
| minimum | string | No | Smallest allowed size, like "10KB", for forms that set one. A small JPEG is padded up to it. |
Details
From the project READMEFitFileSize 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_formsto 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"] }
}
}
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.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.