MCP tool that moves files and directories to macOS Trash ($HOME/.Trash) instead of permanently deleting them. Safe replacement for rm and rmdir.
go build -o delete .
cp delete /usr/local/bin/deleteRegister as an MCP server:
claude mcp add --transport stdio --scope user delete -- /usr/local/bin/deleteTool delete accepts a single parameter:
path(string, required) — absolute path to the file or directory to trash
delete --cli <path> [path...]- Moves files, directories, and symlinks to
$HOME/.Trash - Handles name collisions by appending a timestamp suffix
- Blocks system paths (
/System,/usr,/bin,/sbin,/etc,/var,/private,/Applications) - Refuses to trash
$HOME/.Trashitself
{
"original_path": "/tmp/example.txt",
"trash_path": "/Users/you/.Trash/example.txt",
"type": "file",
"size": 42
}For directories, an items field is included with the total entry count.