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