The ZIP MCP Server is a compression server built on fastMCP and zip.js, implementing the Model Context Protocol (MCP). This project enables AI systems to compress, decompress, and query ZIP files with full parameter control, making it a powerful tool for managing local files and directories.
The project is organized as follows:
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
shell
git clone <repository-url>
cd zip-mcp
shell
npm install
shell
npm run json
json
{
"mcpServers": {
"zip-mcp": {
"command": "npx",
"args": [
"tsx",
"<ABSOLUTE PATH>src/index.ts"
]
}
}
}
compress
)Compress files or directories into a ZIP file.
Parameters:
- input
: Path of the file or directory to compress.
- output
: Path of the output ZIP file.
- options
: Optional settings like compression level, password, and overwrite behavior.
decompress
)Decompress ZIP files to a specified directory.
Parameters:
- input
: Path of the ZIP file.
- output
: Path of the output directory.
- options
: Optional settings like password and overwrite behavior.
getZipInfo
)Retrieve metadata about a ZIP file.
Parameters:
- input
: Path of the ZIP file.
- options
: Optional settings like password.
echo
)Test the service by returning a message.
Parameters:
- message
: Message to return.
// 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!",
});
This project is licensed under the MIT License.