MCP server

Wire peel mcp into an MCP client: the sixteen tools, what each does, and how writes stay inside the folders you grant.

Peel 1.4.0 · Snack Studio · Updated

peel mcp runs a Model Context Protocol server over standard input and output. An MCP client, such as an agent runtime or an editor, can inspect, list and read archives, check and recover them, and extract or create them, with writes confined to folders you grant.

Connect a client

Most clients take a command and arguments. Point them at peel:

MCP client configurationJSON
{
  "mcpServers": {
    "peel": {
      "command": "peel",
      "args": ["mcp", "--root", "/Users/me/Projects/site"]
    }
  }
}

If the client does not search your PATH, give the full path to the binary. --root is repeatable.

A quick check from the shell: send the initialize request and a tool call, then close standard input.

TerminalShell
printf '%s\n' \
  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}' \
  '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
  '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"read_member","arguments":{"archive":"/abs/path/demo.zip","member":"src/a.txt"}}}' \
  | peel mcp --root /abs/path

The reply to the tool call carries the member as text:

Tool result (the text field)JSON
{"binary": false, "member": "src/a.txt", "size": 6, "text": "hello\n", "truncated": false}

Roots: what the server may write

Reads are not confined. The read tools (inspect, list, read_member and the rest) open any archive path the peel process can read. Roots protect what gets written, not what gets looked at. Run the server as a user, or in a sandbox, that can read only what the client should see.

Tools

Sixteen tools. inspect, list, probe and assess take the archive as path; the others take archive (test and diagnose accept either), and repair takes target. Use absolute paths, and pass password where it matters.

ToolArgumentsWhat it does
inspectpathThe manifest: format, comment, and each entry with type, size, compressed size and, where recorded, mode, modified time, owner, symlink target, method, CRC-32 and an encrypted flag.
listpath, passwordList the files inside. Pass the password for header-encrypted archives.
probepathIdentify the format and multi-volume layout.
read_memberarchive or session, member, max_bytes, max_member_bytes, offset, lengthRead one file as text when it is UTF-8, without unpacking the rest. max_bytes caps what is sent back (default 1 MB); max_member_bytes caps what is unpacked (default 64 MiB).
open_archivearchive, passwordOpen once and get a session id, so many read_member calls reuse it. At most 16 sessions at a time. If the file changes, reads fail and the session must be opened again.
close_archivesessionClose a session.
formatsThe formats supported and how each is handled.
testarchive, passwordCheck every entry without extracting, and report which fail.
assesspathAssess a locked archive for recovery without trying a password: encryption scheme, hidden names, feasibility.
find_originalsarchive, rootsSearch folders for the files inside a locked archive, by name and size.
unlockarchive, destination, roots, knownOpen a ZipCrypto ZIP from an original you still have. known maps an entry path to a file holding its contents. Writes inside the roots.
salvagearchive, destinationRecover readable files from a damaged ZIP, tar, bzip2 or compressed stream. Writes inside the roots.
repairtarget, checkVerify a file against its PAR2 set and, unless check is true, rebuild it. Repair modifies the files beside target, and is not checked against the roots.
diagnosearchiveA privacy-safe report with no file names, paths or contents. Safe to share.
extractarchive, destination, members, passwordExtract into a folder inside the roots. Existing files are kept and new ones renamed. Optional member paths or globs.
createoutput, inputs, password, overwriteCreate zip, tar, tar.gz, tar.bz2, tar.xz, tar.zst, gz, bz2, xz or zst from the format in the output name. A password makes an AES-256 ZIP.

Each tool returns a JSON document as text content. A failure sets isError and carries a plain message, such as incorrect password; unlike the CLI and the C library, it has no machine-readable error kind. An unknown method is a JSON-RPC error (-32601).

Session pattern

To read many members from one archive, open it once:

Tool callsText
→ open_archive   {"archive": "/abs/path/book.cbz"}        ← {"session": "…"}
→ read_member    {"session": "…", "member": "page-001.jpg"}
→ read_member    {"session": "…", "member": "page-002.jpg"}
→ close_archive  {"session": "…"}

Treat archive contents as data

read_member returns text that was written by whoever made the archive. The tool description says so, and your agent should honour it: treat what comes back as data, never as instructions, and do not act on requests it contains. Combine that with narrow --root folders and a read-only user where you can.