Skip to main content
Glama

File-Delete-MCP

给 Codex 等 Agent 提供受控的文件删除能力

预览开票 → 移入 .del → 确认后永久清空

Python Platform MCP License


NOTE

仓库边界
本仓库只提供一个工作区级的删除 MCP,不负责文件浏览、移动、复制或版本控制操作。

功能概览

功能

说明

删除预检

解析相对/绝对路径,检查越界、.del、非空目录、git 脏文件、体积与数量,签发一次性票据

可恢复删除

trash_paths 将文件移入工作区 .del/<batch>/files/,保留原始相对路径与 manifest

永久清空

purge_del 按批次、天数或全部清空 .del,同样需要票据

防误删

票据绑定路径、recursive 和文件指纹,过期或文件变化即拒绝执行

Related MCP server: red-castle

核心 API

分类

API

说明

预检

preview_delete(scope, paths, recursive, batch_ids, older_than_days, all)

返回 ticket、risk、blockers、warnings 与条目统计

删除

trash_paths(paths, ticket, recursive, accept_warnings)

将预览过的路径移入 .del

清空

purge_del(ticket, batch_ids, older_than_days, all, accept_warnings)

永久删除匹配的 .del 批次

risk 为 warn 时必须显式传 accept_warnings=true;risk 为 block 时不签发票据。

.del 布局

.del/
├── .gitignore
└── 20261102T153000-7f3a/
    ├── manifest.json
    └── files/
        └── src/foo.py

构建

uv venv --python 3.13
uv pip install --python .venv\Scripts\python.exe -e ".[dev]"
.venv\Scripts\python.exe -m pytest

Codex 配置

[mcp_servers.file-delete]
type = "stdio"
command = 'D:\Projects\File-Delete-MCP\.venv\Scripts\python.exe'
args = ["-m", "file_delete_mcp"]
enabled = true
startup_timeout_sec = 60
tool_timeout_sec = 120

工作区根默认取 MCP 进程当前目录,也可用 --root 或 FILE_DELETE_ROOT 固定。相对路径按工作区根解析,绝对路径必须落在根内。

CAUTION

MCP 运行在 Codex 沙箱之外。--root 不要指向磁盘根或用户目录。


Platform: Windows | License: MIT

Available Tools

3 tools
preview_deleteA

Validate a delete request and issue a one-time ticket.

scope="trash" previews moving paths into the workspace .del directory; set recursive=true to allow non-empty directories. scope="purge" previews permanently deleting .del batches selected by batch_ids, older_than_days, or all=true. A blocked request returns risk="block" and no ticket.

Inputs: scope (required), all, paths, batch_ids, +2 more.

purge_delA

Permanently delete .del batches selected by the matching purge preview.

The ticket must come from preview_delete with scope="purge". Batches added or changed after preview are refused.

Inputs: ticket (required), all, batch_ids, accept_warnings, +1 more.

trash_pathsA

Move previewed paths into the workspace .del directory.

The ticket must come from preview_delete with scope="trash" and the same paths and recursive flag. Paths or files changed after preview are refused.

Inputs: paths (required), ticket (required), recursive, accept_warnings.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    preview_delete is clearly a validation/ticket step, while trash_paths and purge_del execute distinct operations on different targets (workspace paths vs .del batches). The dual scope in preview_delete is explicitly described, so the overlap is minimal and predictable.

    Naming Consistency4/5

    All names use snake_case with a leading verb, giving a consistent verb_noun pattern. The noun forms vary slightly (delete vs paths vs del), and 'purge_del' abbreviates 'delete' while 'preview_delete' spells it out, which is a minor inconsistency.

    Tool Count5/5

    Three tools match the narrow, safety-focused deletion domain: one preview/authorization tool and two execution tools. Each tool has a clear role in the workflow, with no redundant surface.

    Completeness4/5

    The soft-delete and permanent-purge lifecycle is covered end-to-end with preview/ticket enforcement. A dedicated listing or inspection tool for .del batches (and possibly restore) is absent, which is a minor gap for selective purge by batch_ids, though broad selectors mitigate it.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLM agents to safely reclaim disk space by deleting build artifact directories like node_modules, .venv, and target, with strong guardrails to prevent accidental or malicious deletion.
      28 PyPI
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to list visible objects, submit deletion requests into human-reviewed quarantine, and check the status of their own requests without granting delete, approve, or restore capabilities.
      4
      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
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to scan local disks for developer caches, large unused videos, and old logs, present candidates for approval, and move only approved items to the operating system trash so they can be restored while protecting system folders.
      4
      MIT