Skip to main content
Glama
ZIP-MCP
by 7gugu

ZIP MCP 服务器

中文| English

项目介绍

ZIP MCP Server 是一个基于 fastMCP 和 zip.js 的压缩服务器,实现了模型上下文协议 (MCP)。该项目提供完全参数控制的 ZIP 压缩、解压以及查询压缩包信息功能。

Related MCP server: ZIP MCP Server

特征

  • 支持文件和数据的压缩和解压

  • 支持多文件打包压缩

  • 提供压缩级别控制(0-9)

  • 支持密码保护和加密强度设置

  • 提供压缩包元数据的查询功能

项目结构

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

安装

您可以使用 npm 全局安装 ZIP MCP 服务器:

npm install -g zip-mcp

MCP 配置

安装后,您可以在 MCP JSON 配置中配置 ZIP MCP:

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

在 AI 客户端中配置 MCP JSON

MCP 工具描述

ZIP MCP Server 提供了以下工具,可以通过 MCP 协议调用:

压缩工具(压缩)

将本地文件或目录压缩为 ZIP 文件。

参数:

  • input :要压缩的文件或目录的路径(字符串或字符串数组)

  • output :输出 ZIP 文件的路径

  • options :压缩选项(可选)

    • level :压缩级别(0-9,默认为5)

    • password :密码保护

    • encryptionStrength :加密强度(1-3)

    • overwrite :是否覆盖现有文件(布尔值)

返回:

  • 成功:包含成功信息的文本内容

  • 失败:包含错误信息的文本内容

解压工具(decompress)

将本地ZIP文件解压到指定目录。

参数:

  • input :ZIP 文件的路径

  • output :输出目录的路径

  • options :解压缩选项(可选)

    • password :解压密码

    • overwrite :是否覆盖现有文件(布尔值)

    • createDirectories :是否创建不存在的目录(布尔值)

返回:

  • 成功:包含解压结果信息的文本内容

  • 失败:包含错误信息的文本内容

ZIP 信息工具 (getZipInfo)

获取本地ZIP文件的元数据信息。

参数:

  • input :ZIP 文件的路径

  • options :选项(可选)

    • password :解压密码

返回:

  • 成功:包含ZIP文件详细信息的文本内容,包括:

    • 文件总数

    • 总大小

    • 压缩尺寸

    • 压缩比

    • 每个文件的详细信息

  • 失败:包含错误信息的文本内容

测试工具(echo)

返回输入消息来测试服务是否正常运行。

参数:

  • message :要返回的消息

返回:

  • 包含输入消息和当前时间戳的文本内容

示例

使用 MCP 客户端调用工具的示例:

// 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!",
});

接触

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

    • 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
      10 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
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that lets AI agents compress images, PDFs, video, audio, documents, and archives, writing the smaller versions back to disk via the MiCompress service.
      7 npm
      MIT