All docs

MCP Server

Squeezr exposes an MCP (Model Context Protocol) server that allows AI tools to query and control the proxy programmatically. Claude Code and other MCP-compatible clients can use these tools directly from within a conversation.

Available tools

The MCP server provides 10 tools. Each tool is callable by the AI agent during a session.

squeezr_status

Returns the current proxy status: whether it's running, uptime, PID, ports, and version. Equivalent to running squeezr status from the CLI.

ParameterTypeDescription
No parameters

squeezr_stats

Returns compression statistics for the current session: total requests, tokens saved, compression ratio, cache hit rate, and per-tool breakdown.

ParameterTypeDescription
No parameters

squeezr_set_mode

Changes the compression mode on the fly. Useful for temporarily disabling compression or switching between aggressive and light modes during a session.

ParameterTypeDescription
modestringOne of: "soft", "normal", "aggressive", "critical"

squeezr_config

Returns the current resolved configuration, merging global squeezr.toml with any per-project .squeezr.toml overrides.

ParameterTypeDescription
No parameters

squeezr_habits

Returns learned compression habits and patterns observed from your usage. Shows which tools generate the most tokens, which patterns fire most frequently, and optimization suggestions.

ParameterTypeDescription
No parameters

squeezr_stop

Stops the Squeezr proxy daemon. Equivalent to squeezr stop.

ParameterTypeDescription
No parameters

squeezr_check_updates

Checks if a newer version of Squeezr is available on npm. Returns the current version and latest available version.

ParameterTypeDescription
No parameters

squeezr_update

Updates Squeezr to the latest version. Stops the proxy, installs the update from npm, and restarts automatically. Equivalent to squeezr update.

ParameterTypeDescription
No parameters

squeezr_set_project

Sets or changes the active project context. This affects which .squeezr.toml overrides are applied and how per-project stats are tracked.

ParameterTypeDescription
projectstringProject name to set, or empty string to clear and use auto-detection

squeezr_bypass

Toggles bypass mode on or off. When bypass is ON, all requests pass through uncompressed but are still logged for stats. Runtime-only — resets on proxy restart, does not modify config files. Use when you suspect compression is affecting results.

ParameterTypeDescription
enabledboolean (optional)true to enable bypass, false to disable. Omit to toggle.

How MCP integration works

When Squeezr starts, it registers itself as an MCP server. Claude Code and other MCP-compatible clients discover the tools automatically. The AI can then call any of these tools as part of a conversation — for example, checking stats, switching compression modes, or updating the proxy.

Example usage

In a Claude Code session, the AI might:

  • Call squeezr_stats to report how many tokens were saved so far
  • Call squeezr_set_mode("aggressive") when context is running low
  • Call squeezr_check_updates to see if a new version is available
  • Call squeezr_habits to suggest workflow optimizations
  • Call squeezr_set_project when switching between repositories
  • Call squeezr_bypass to temporarily disable compression for debugging