Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trash-mcp

MCP server for safe file deletion via system trash. Moves files to macOS Trash, Linux freedesktop trash, or Windows Recycle Bin. Never permanently deletes files.

Installation

npm install -g trash-mcp

Usage

trash-mcp /allowed/dir1 /allowed/dir2

All arguments are directories that the server is allowed to trash files from. Paths outside these directories will be rejected.

The server also automatically adds its working directory (process.cwd()) as an allowed directory. This means when launched from a project folder, files in that folder can be trashed without explicitly listing it in the arguments.

Claude Code Configuration

Add to your Claude Code MCP settings:

{
  "mcpServers": {
    "trash": {
      "command": "npx",
      "args": ["trash-mcp", "/Users/you/Downloads", "/tmp"]
    }
  }
}

No need to add your project directory — the server picks it up automatically from the working directory.

Tool: trash

Moves files or directories to system trash.

Input:

  • paths (string[]) — array of absolute paths to move to trash

Example response:

🗑️ /Users/you/projects/old-file.txt
❌ /etc/passwd — Access denied — outside allowed directories

Security

  • Only files within explicitly allowed directories or the working directory can be trashed
  • Symlink targets are resolved and validated (prevents symlink attacks)
  • Server refuses to start without at least one accessible CLI arg directory
  • Files are moved to trash, never permanently deleted

About

MCP server for safe file deletion via system trash. Never permanently deletes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages