Skip to main content
Glama
ZIP-MCP
by 7gugu

ZIP MCP Server

中文 | English

Project Introduction

ZIP MCP Server is a compression server based on fastMCP and zip.js, implementing the Model Context Protocol (MCP). This project provides fully parameter-controlled ZIP compression, decompression, and query compression package information functions.

Related MCP server: ZIP MCP

Features

  • Supports compression and decompression of files and data

  • Supports multi-file packaging compression

  • Provides compression level control (0-9)

  • Supports password protection and encryption strength settings

  • Provides query function for compressed package metadata

  • Validates ZIP entry paths on decompression to prevent path traversal writes

Security

Versions 1.0.6 and later fix an arbitrary file write issue in the decompress tool: malicious ZIP entry names (for example ../outside.txt) could previously be joined with the output directory and written outside the intended extraction root. Extraction now resolves the output root once, validates each entry path, and rejects absolute paths, drive-letter paths, .. segments, and any path that would escape the output directory.

Thanks to Ryan (vonbrubeck@gmail.com) for responsibly reporting this issue.

Project Structure

zip-mcp
├── src
│   ├── index.ts               # Application entry point
│   ├── utils
│   │   ├── compression.ts     # Compression and decompression implementation
│   │   └── safePath.ts        # Safe ZIP entry path validation
├── tsconfig.json              # TypeScript configuration file
├── package.json               # npm configuration file
└── README.md                  # Project documentation

Installation

You can install ZIP MCP Server globally using npm:

npm install -g zip-mcp

MCP Configuration

After installation, you can configure ZIP MCP in your MCP JSON configuration:

{
  "mcpServers": {
    "zip-mcp": {
      "command": "zip-mcp",
      "args": []
    }
  }
}

Configure the MCP JSON in the AI Client

MCP Tool Description

ZIP MCP Server provides the following tools, which can be called through the MCP protocol:

Compression Tool (compress)

Compress local files or directories into a ZIP file.

Parameters:

  • input: Path of the file or directory to be compressed (string or string array)

  • output: Path of the output ZIP file

  • options: Compression options (optional)

    • level: Compression level (0-9, default is 5)

    • password: Password protection

    • encryptionStrength: Encryption strength (1-3)

    • overwrite: Whether to overwrite existing files (boolean)

Returns:

  • Success: Text content containing success information

  • Failure: Text content containing error information

Decompression Tool (decompress)

Decompress local ZIP files to the specified directory. Entry paths are validated before writing so files cannot be extracted outside output via .. or absolute paths.

Parameters:

  • input: Path of the ZIP file

  • output: Path of the output directory

  • options: Decompression options (optional)

    • password: Decompression password

    • overwrite: Whether to overwrite existing files (boolean)

    • createDirectories: Whether to create non-existent directories (boolean)

Returns:

  • Success: Text content containing decompression result information

  • Failure: Text content containing error information

ZIP Info Tool (getZipInfo)

Get metadata information of local ZIP files.

Parameters:

  • input: Path of the ZIP file

  • options: Options (optional)

    • password: Decompression password

Returns:

  • Success: Text content containing detailed information of the ZIP file, including:

    • Total number of files

    • Total size

    • Compressed size

    • Compression ratio

    • Detailed information of each file

  • Failure: Text content containing error information

Test Tool (echo)

Returns the input message to test if the service is running normally.

Parameters:

  • message: Message to be returned

Returns:

  • Text content containing the input message and current timestamp

Examples

Examples of calling tools using the MCP client:

// Compress files
await client.executeTool("compress", {
  input: "/path/to/files/or/directory",
  output: "/path/to/output.zip",
  options: {
    level: 9,
    comment: "Test compression",
    password: "secret",
    overwrite: true,
  },
});

// Decompress files
await client.executeTool("decompress", {
  input: "/path/to/archive.zip",
  output: "/path/to/extract/directory",
  options: {
    password: "secret",
    overwrite: true,
    createDirectories: true,
  },
});

// Get ZIP info
await client.executeTool("getZipInfo", {
  input: "/path/to/archive.zip",
  options: {
    password: "secret",
  },
});

// Test service
await client.executeTool("echo", {
  message: "Hello, ZIP MCP Server!",
});

Contact

Available Tools

4 tools
compressC

Compress local files or directories into a ZIP file

Inputs: input (required), output (required), options.

decompressC

Decompress local ZIP file to specified directory

Inputs: input (required), output (required), options.

echoB

Return the input message (for testing)

Inputs: message (required).

getZipInfoC

Get metadata information of a local ZIP file

Inputs: input (required), options.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 4 tools

    Disambiguation3/5

    Three tools (compress, decompress, getZipInfo) are clearly distinct and cover core ZIP operations, but the 'echo' tool is unrelated to the ZIP domain and could cause confusion as it serves a generic testing purpose rather than a ZIP-specific function.

    Naming Consistency3/5

    The naming is mixed: 'compress' and 'decompress' use consistent verb-based names, but 'getZipInfo' uses a verb_noun pattern with camelCase, and 'echo' is a standalone verb. This creates a readable but inconsistent convention across the tool set.

    Tool Count4/5

    With 4 tools, the count is reasonable for a ZIP utility server, though slightly thin for comprehensive coverage. The inclusion of 'echo' reduces the effective domain-specific tools to 3, which is borderline but still functional for basic operations.

    Completeness3/5

    The tool set covers basic ZIP operations (compress, decompress, get metadata), but lacks advanced features like listing contents without extraction, adding/removing files from archives, or handling password-protected ZIPs. The 'echo' tool does not contribute to ZIP functionality, creating a minor gap in domain coverage.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      A comprehensive Model Context Protocol server that provides over 50 file and system management tools for AI models, including navigation, file operations, search, compression, and system information capabilities.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      A powerful ZIP file processing tool that enables creating, extracting, listing, adding, deleting, viewing, and verifying ZIP files through MCP protocol integration with AI development environments.
      MIT
    • A
      license
      B
      quality
      F
      maintenance
      Provides tools for AI assistants to compress, decompress, and manage ZIP archives including metadata retrieval. It supports directory compression, password protection, and configurable extraction options.
      4
      12 npm
      ISC
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perform 13 PDF operations (merge, split, compress, watermark, encrypt, and more) on local files via MCP.
      3
      -