VisionSqueezer
Getting Started

MCP Setup

One-command MCP install for Claude Code, Cursor, VS Code, Windsurf, Claude Desktop, Codex, Gemini CLI, Qwen, and Kimi, plus a Zed config snippet.

VisionSqueezer ships an MCP (Model Context Protocol) server that exposes image optimization as a tool your AI agent can call. Thanks to npx -y, no global install is required.

Installing the server does not shrink images you paste or attach in the chat. The agent has to call the tool with an image path, or read the image from a project file (the Claude Code hook covers that). See where it saves tokens.

The server applies a 1600-token budget by default, see the token budget guide.

One command

Pick your client and run the line. Each one registers the server for you.

ClientCommand
Claude Codenpx vision-squeezer install --client claude --scope user --yes (plugin: MCP server, skills, image-read hook)
Codex CLIcodex mcp add vision-squeezer -- npx -y vision-squeezer
Gemini CLIgemini mcp add --scope user vision-squeezer -- npx -y vision-squeezer
Qwen Codeqwen mcp add vision-squeezer -- npx -y vision-squeezer
Kimi CLIkimi mcp add vision-squeezer -- npx -y vision-squeezer
VS Codecode --add-mcp '{"name":"vision-squeezer","command":"npx","args":["-y","vision-squeezer"]}'
Cursornpx vision-squeezer install --client cursor --yes
Windsurfnpx vision-squeezer install --client windsurf --yes
Claude Desktopnpx vision-squeezer install --client claude-desktop --yes
OpenCodenpx vision-squeezer install --client opencode --yes

The code --add-mcp line adds the server to your VS Code user profile and works in macOS and Linux shells. On PowerShell, escape the quotes as in the VS Code docs.

The Claude Code, Cursor, Gemini CLI, and OpenCode installs also add an image-read hook, so images the agent reads from your project are swapped for the optimized copy. See which clients get the hook.

Installer

Every client has one install path and the installer picks it. It pins the version and handles scope for Claude Code, Codex, Qwen, OpenCode, Gemini, Kimi, Cursor, Windsurf, Claude Desktop, and VS Code. For Cursor, Windsurf, Claude Desktop, and OpenCode it merges one entry into the JSON config: your other servers are kept, and a file it cannot parse (for example one with comments) is left untouched.

Terminal
npx vision-squeezer install                              # interactive
npx vision-squeezer install --client codex --yes         # scripted
npx vision-squeezer install --client claude --scope user --yes   # plugin: MCP + skills + image-read hook

Manual configuration

Prefer editing the file yourself, or use Zed (not in the installer: its settings.json allows comments)? Add one entry and restart the editor.

Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project):

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

More editors (JetBrains, Kiro, Antigravity) are listed in the README.

MCP tools

Once registered, the server exposes three tools:

ToolPurposeKey args
optimize_imageStandard optimization. Returns the optimized image plus a short JSON reportimage_path (preferred) or image_base64, target_model (core profiles plus kimi, glm, pixtral, gemma, internvl, llava, minimax, and other catalog aliases), max_tokens (token budget, default 1600, 0 disables), mode (standard / ocr / auto; only ocr drops colour), output_format (jpeg / webp / avif)
sandbox_executeThink-in-Code: run atomic ops locallyoperations[] — crop, grayscale, binarize, resize, contrast, brightness
get_savings_statsCumulative token / USD savings—
The snippets on this page omit the version for brevity. Pin it (npx -y vision-squeezer@X.Y.Z, or @latest) in shared configs: an unpinned npx cache can freeze users on whatever tarball resolved first. The installer pins for you.

Verify

Restart the client, then ask it to list its MCP tools. You should see optimize_image, sandbox_execute, and get_savings_stats. To check the package itself:

Terminal
npx -y vision-squeezer --version

If the MCP server fails to connect, run vision-doctor (Claude Code skill) — it probes the registered command and surfaces the root cause.