Skip to content

MCP tool that moves files and directories to macOS Trash instead of permanently deleting them

License

Notifications You must be signed in to change notification settings

hegner123/delete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

delete

MCP tool that moves files and directories to macOS Trash ($HOME/.Trash) instead of permanently deleting them. Safe replacement for rm and rmdir.

Installation

go build -o delete .
cp delete /usr/local/bin/delete

Register as an MCP server:

claude mcp add --transport stdio --scope user delete -- /usr/local/bin/delete

Usage

MCP Tool

Tool delete accepts a single parameter:

  • path (string, required) — absolute path to the file or directory to trash

CLI

delete --cli <path> [path...]

Behavior

  • 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/.Trash itself

Output

{
  "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.

About

MCP tool that moves files and directories to macOS Trash instead of permanently deleting them

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors