# halfsize [Health: Active]

**Category:** 🎥 Multimedia Process  
**Repository:** https://github.com/YKLovePython/halfsize  
**GitHub Stars:** 145  
**npm Downloads (last month):** 3427  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/halfsize

## Description
Compress any video to an exact size (Discord 20 MB, WeChat 20 MB, WhatsApp 16 MB) locally with FFmpeg - on Windows as a single .exe with nothing to install, or via npm. HDR tone-mapped, VMAF/SSIM prove the quality, and it runs as an MCP server.

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

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

## Documentation

## What halfsize does

halfsize exposes local video compression to MCP-compatible AI clients. The server uses FFmpeg and applies the same processing flow as the command-line interface: inspect the source, calculate a size-constrained encoding plan, encode the video, and produce a machine-readable quality report.

The target can be an explicit size such as 25 MB, or a platform-oriented limit supported by the CLI, including Discord, WeChat, WhatsApp, Gmail, Outlook, and X/Twitter. Compression happens on the machine running the server, so the input video is not sent to an external upload service.

## How it works

Before encoding, halfsize reads the video's duration, dimensions, frame rate, audio bitrate, rotation, and HDR metadata. It derives the available total bitrate from the requested byte limit and duration, subtracting audio and container overhead. The plan can select a smaller output resolution when the target requires it.

Encoding uses a two-pass process. HDR input is tone-mapped, and the completed file can be checked with VMAF and SSIM. The report includes the output size, target comparison, compression ratio, and quality measurements, allowing an agent to relay whether the result meets the requested limit and how much visual quality changed.

## Setup and configuration

Run the server through the npm package with a stdio configuration:

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

Node.js 18 or newer is required for the npm installation. FFmpeg is bundled during the first install; if that download is unavailable, halfsize can use an FFmpeg installation already present on the system. The server is stdio-only: it does not open a network port or run as a daemon.

A Windows executable is also available and combines the CLI, local web app, and MCP server without requiring Node.js. The full package includes FFmpeg; a smaller package can download FFmpeg into the user's cache when initialized.

## Tools and capabilities

The MCP interface provides one tool:

- `compress_video(input, target, output?, codec?, verify?)`: compresses a local video to the requested target, optionally chooses an output path and codec, and optionally verifies the result.

The tool uses the same JSON report as the CLI. The command-line interface also supports H.265 output, dry-run planning, multiple input files, and preset platform limits, but the MCP surface is centered on the single compression operation.

## Limitations and notes

The MCP transport is limited to stdio, so clients must launch the process rather than connect to a hosted endpoint. Processing depends on local FFmpeg availability, either from the package's download or from the system. Extremely small targets may require resolution reduction, and the quality report reflects the trade-off created by the requested size.

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

