Skip to main content
Glama

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

Related MCP server: filesystem-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


Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables secure filesystem operations (read, write, list, search, delete) within allowed directories (~/Documents and ~/Downloads), with restrictions such as delete only in Downloads and file size limits.
      7
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables reading, writing, appending, and listing files, restricted to explicitly allowed directories with safety checks against path traversal and symlink escapes.
      4
      84 PyPI
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Official server for the ShieldFive end-to-end encrypted vault. Moves files off your computer into the vault, reading each copy back and verifying it before the original goes to a local trash folder (nothing deleted). Also finds duplicates by content and tidies folders. Decrypts on your machine; access is scoped, expiring, revocable and undoable.
      86 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to scan a Mac for reclaimable disk space and safely move selected items to the Trash, with dry-run defaults, protected paths, and confirmation before permanent deletion.
      12
      MIT