# vision-squeezer [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/eralpozcan/vision-squeezer  
**GitHub Stars:** 2  
**npm Downloads (last month):** 1347  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/vision-squeezer

## Description
Cut vision API token costs by snapping images to tile boundaries. Claude, GPT-4o, GPT-5, Gemini.

## Tools
Capabilities this server exposes over MCP:

- **optimize_image** — Resize and optimize an image for LLM vision APIs, fitting it to a token budget (default 1600). Removes padding, snaps dimensions to the model grid and re-encodes. Returns the optimized image plus a short JSON report; with image_path the copy is also written to output_path. To save tokens, look at the returned image instead of the original.
- **optimize_image_batch** — Optimize multiple images in one call (max 64). Each entry takes the same arguments as optimize_image. Returns a per-image results array; a failing image yields an error entry without failing the whole batch.
- **get_savings_stats** — Retrieve cumulative token and bandwidth savings achieved through VisionSqueezer optimizations.
- **sandbox_execute** — Think in Code: Execute a sequence of atomic operations (crop, grayscale, binarize, resize, contrast, brightness) on an image to extract only necessary context and slash tokens.

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

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

## Documentation

## What vision-squeezer does

vision-squeezer prepares images for vision-language model requests by fitting them to a token budget before they reach the model. Its processing pipeline can resize images around tile boundaries, remove background padding, crop content, select an output format, and adjust compression quality. Model-aware resizing is available through a provider-alias option, while a maximum token setting can downscale an image until it fits the requested budget.

The project is distributed as a Rust library and binary, an npm package with an installer, a command-line interface, and an MCP server. It is intended for images sent through model APIs or exposed to an agent through files and tools, including screenshots, crawlers, and browser automation.

## How it works

The MCP server runs over standard MCP client configuration and only processes images that the agent passes to it. It does not intercept an image pasted, dragged, or attached with an `@` mention in a chat window; those attachments are handled and billed by the client before an MCP tool or hook can run.

The command-line pipeline accepts a single image or a directory for batch processing. Automatic mode uses standard colour processing by default, while OCR mode is opt-in. Output can be written as JPEG, WebP, or AVIF, and the result can be emitted as JSON for machine-readable workflows. A dry-run option runs the pipeline without writing the output file.

Tile size, maximum tile count, token budget, output quality, background tolerance, and cropping behavior are configurable. Automatic quality adjustment can search for a quality setting that meets an SSIM target. The default MCP token budget is 1600, and the CLI can disable token-budget fitting by setting its maximum-token value to zero.

## Setup and configuration

The npm installer can configure supported clients with a command such as:

```bash
npx vision-squeezer install --client cursor --yes
```

It can also prompt for the client and scope. Supported installation targets include Claude Code, Claude Desktop, Cursor, VS Code, JetBrains, Windsurf, Gemini CLI, Codex CLI, Qwen Code, OpenCode, Kimi CLI, Zed, Kiro, and Antigravity. The installer merges JSON configuration instead of replacing unrelated servers or hooks, and rerunning it updates the existing vision-squeezer entry.

For manual configuration, run `npx -y vision-squeezer` as the MCP command. Pin the npm package to a chosen version when reproducible configuration matters. A Rust binary can instead be installed from crates.io with `cargo install vision-squeezer`, or built from source with the repository's `make install` target. The resulting `vision-squeezer-mcp` binary can be referenced directly by an MCP client.

## Tools and capabilities

- Fit images to a configurable vision-model token budget.
- Resize around configurable tile boundaries and cap tile counts.
- Convert output to JPEG, WebP, or AVIF with adjustable quality.
- Remove background padding or apply smart edge-energy cropping.
- Support standard and opt-in OCR processing modes.
- Produce JSON output and process directories in batch workflows.

## Limitations and notes

The MCP workflow only covers images made available to the agent through files or tools. It does not reduce the cost of images directly attached in Claude Code, Cursor, ChatGPT, or another chat interface before tool execution. Model-aware behavior uses provider aliases and model-specific limits, so the selected alias and token settings affect the result.

_Full upstream README: https://allmcps.com/mcp/vision-squeezer/readme_

