Skip to main content

CLI Reference

mcpzip provides three commands: serve, init, and migrate.

mcpzip serve

Start the proxy server. This is the main command -- it starts mcpzip as an MCP server over stdio, ready for Claude Code to connect.

mcpzip serve [OPTIONS]

Flags

FlagDefaultDescription
--config <PATH>~/.config/compressed-mcp-proxy/config.jsonPath to config file

Examples

# Start with default config
mcpzip serve

# Start with a custom config file
mcpzip serve --config /path/to/my-config.json

Behavior

  1. Loads configuration from disk
  2. Loads cached tool catalog (instant -- no network required)
  3. Starts serving MCP over stdio immediately
  4. Spawns a background task to refresh the catalog by connecting to all upstream servers
  5. Handles Ctrl+C for graceful shutdown
Instant Startup

mcpzip serves from its disk cache on startup, so it is available immediately. The background refresh connects to upstream servers concurrently and merges any new or changed tools into the catalog. If a server fails to connect, its cached tools are preserved.

Logging

mcpzip logs to stderr (stdout is reserved for MCP protocol). Control log verbosity with RUST_LOG:

# Normal output (default)
mcpzip serve

# Debug logging
RUST_LOG=mcpzip=debug mcpzip serve

# Trace logging (very verbose)
RUST_LOG=mcpzip=trace mcpzip serve

mcpzip init

Interactive setup wizard. Guides you through creating a config file.

mcpzip init

This command has no flags. It will:

  1. Ask for your Gemini API key (optional, for semantic search)
  2. Walk you through adding MCP servers
  3. Write the config to ~/.config/compressed-mcp-proxy/config.json
tip

If you already have MCP servers configured in Claude Code, use mcpzip migrate instead -- it is faster and preserves your existing setup.


mcpzip migrate

Automatically migrate your Claude Code MCP configuration to mcpzip.

mcpzip migrate [OPTIONS]

Flags

FlagDefaultDescription
--config <PATH>~/.config/compressed-mcp-proxy/config.jsonOutput config file path
--claude-config <PATH>Auto-detectedPath to Claude Code config
--dry-runfalseShow what would happen without writing files

Claude Code Config Detection

If --claude-config is not specified, mcpzip searches these paths in order:

  1. ~/.claude.json
  2. ~/.claude/config.json

Examples

# Preview what will happen
mcpzip migrate --dry-run

# Migrate with defaults
mcpzip migrate

# Custom paths
mcpzip migrate --claude-config ~/.claude.json --config ~/my-mcpzip.json
warning

mcpzip migrate modifies your Claude Code config file. Use --dry-run first to verify what will change. See the Migration Guide for a detailed walkthrough.


Environment Variables

VariableDescription
GEMINI_API_KEYGemini API key for semantic search (overrides config file value)
RUST_LOGLog level control (e.g., mcpzip=debug)

Exit Codes

CodeMeaning
0Success
1Error (config invalid, server unreachable, etc.)

File Locations

PathPurpose
~/.config/compressed-mcp-proxy/config.jsonMain configuration
~/.config/compressed-mcp-proxy/cache/tools.jsonCached tool catalog
~/.config/compressed-mcp-proxy/auth/Persisted OAuth tokens
~/.claude.jsonClaude Code config (primary)
~/.claude/config.jsonClaude Code config (fallback)