shutil-mcp

v1.0.0
shutil-mcp Checked 1 day ago Published 2 months ago

MCP server for asynchronous shell utilities using aioshutil

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

make_archive

Create an archive file (zip, tar, etc.) with overwrite protection. Args: base_name: Name of the file to create (including path) format: Archive format (e.g., 'zip', 'tar', 'gztar') root_dir: Directory that will be the root of the archive (default: current) base_dir: Directory from which archiving starts (default: current) overwrite: Whether to overwrite existing archive file (default: True)

ParameterTypeDescription
base_name *string
format *string
base_dir
overwriteboolean
root_dir

unpack_archive

Unpack an archive file with zip-slip safety inspection and overwrite protection. Args: filename: Path to the archive extract_dir: Directory to extract into (default: current) format: Archive format (optional) overwrite: Whether to overwrite existing files (default: True)

ParameterTypeDescription
filename *string
extract_dir
format
overwriteboolean

get_archive_formats

Get a list of supported archive formats.

cp

Copy files or directories recursively with verification. Supports size verification and overwrite protection. Args: src: Source path dst: Destination path follow_symlinks: Whether to follow symlinks (default: True) overwrite: Whether to overwrite existing destination files (default: True)

ParameterTypeDescription
dst *string
src *string
follow_symlinksboolean
overwriteboolean

mv

Move or rename files or directories with fault tolerance. Destination is verified before deleting origin. If any error occurs during move, the original source file remains preserved intact. Args: src: Source path dst: Destination path overwrite: Whether to overwrite existing destination files (default: True)

ParameterTypeDescription
dst *string
src *string
overwriteboolean

rm

Remove a file or directory by moving it to the trash (soft-delete). rm NEVER permanently deletes anything. The target is moved into a .trash folder so it can be recovered later with the restore tool. The JSON response reports the current trash size, what share of total storage it occupies, and the contents of the trash (original path + deletion timestamp). To permanently purge the trash, use the empty_trash tool -- but only after the user has explicitly confirmed. Args: path: Path to remove (soft-deleted into trash)

ParameterTypeDescription
path *string

restore

Restore a file or directory from the trash folder. By default the item is restored to its original path (recorded when it was trashed). Provide ``dst`` to restore to a different location. Args: trash_path: Path to the trashed item dst: Destination path to restore to (default: original path from trash metadata) overwrite: Whether to overwrite an existing destination (default: False)

ParameterTypeDescription
trash_path *string
dst
overwriteboolean

empty_trash

Permanently delete everything in the trash folder. WARNING: This is the ONLY operation that permanently destroys data. It irreversibly removes all trashed items. Only call this after the user has explicitly confirmed they want to purge the trash. Args: path: Any path inside the jail; its trash folder (.trash) is emptied (default: current directory).

ParameterTypeDescription
pathstring

gc_trash

Garbage-collect trash entries older than max_age_seconds. Scans all .trash directories inside the jail (or the default .trash location when no jail is set) and permanently deletes entries whose timestamp prefix is older than max_age_seconds. Args: max_age_seconds: Maximum age in seconds before deletion (default: 86400 = 24 h).

ParameterTypeDescription
max_age_secondsinteger

chmod

Change file or directory permissions with automatic rollback on failure. If the operation fails, permissions stay intact or rollback to the original state. The response JSON includes 'previous_mode' to enable immediate 1-step undo. Args: path: Path to modify mode: Numeric mode (e.g., 0o755, 493, "755", "0755", "0o755")

ParameterTypeDescription
mode *
path *string

chown

Change file or directory ownership with automatic rollback on failure. If the operation fails, ownership stays intact or rolls back to previous user and group. The response JSON includes 'previous_user' and 'previous_group' to enable immediate 1-step undo. Args: path: Path to modify user: Username or numeric UID (default: None) group: Group name or numeric GID (default: None)

ParameterTypeDescription
path *string
group
user

which

Find the path to an executable. Args: cmd: Executable name path: Search path (default: None, uses system PATH)

ParameterTypeDescription
cmd *string
path

mkdir

Create a directory. Args: path: Directory path to create parents: Create parent directories if they don't exist (default: True)

ParameterTypeDescription
path *string
parentsboolean

touch

Create an empty file or update file timestamps. Args: path: File path to create or update

ParameterTypeDescription
path *string

cat

Read file content, optionally limited to a specific line range. Args: path: File path to read start_line: First line to include (1-based, inclusive). None for start of file. end_line: Last line to include (1-based, inclusive). None for end of file.

ParameterTypeDescription
path *string
end_line
start_line

ls

List directory contents with detailed metadata. Args: path: Directory path to list (default: ".")

ParameterTypeDescription
pathstring

disk_usage

Get disk usage statistics for a path. Args: path: Path to check disk usage for (default: ".")

ParameterTypeDescription
pathstring

stat

Get detailed file or directory metadata. Args: path: Path to the file or directory

ParameterTypeDescription
path *string

glob

Find files matching glob patterns. Args: pattern: Glob pattern (e.g., '**/*.py', '*.txt', 'src/**/*.ts') path: Root directory to search from (default: '.')

ParameterTypeDescription
pattern *string
pathstring

grep

Search file contents using regex patterns. Args: pattern: Regex pattern to search for path: File or directory to search in (default: '.') include: Optional file glob pattern to filter (e.g., '*.py') case_sensitive: Whether search is case-sensitive (default: True) max_results: Maximum number of matches to return (default: 100)

ParameterTypeDescription
pattern *string
case_sensitiveboolean
include
max_resultsinteger
pathstring

tree

Get a recursive directory tree as nested JSON. Args: path: Root directory to start from (default: '.') max_depth: Maximum depth to traverse (default: None = unlimited)

ParameterTypeDescription
max_depth
pathstring