MCP文件删除工具
一个提供文件删除功能的模型上下文协议(MCP)服务器。该服务器允许人工智能助手在需要时安全地删除文件,同时支持相对路径和绝对路径。
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
delete_file 1 个参数 需填 1 项
Delete a file at the specified path (supports both relative and absolute paths)
必填参数:path
服务介绍
@qpd-v/mcp-delete
一个提供文件删除功能的模型上下文协议(MCP)服务器。该服务器允许AI助手在需要时安全地删除文件,支持相对路径和绝对路径。
功能
- 使用相对或绝对路径删除文件
- 智能路径解析,尝试多种潜在路径
- 清晰的错误消息,包含详细的路径解析信息
- 在删除前进行安全的文件存在性检查
- 与Claude及其他兼容MCP的AI助手一起工作
示例
与Claude Desktop一起使用

与VSCode Roo Cline扩展一起使用

安装
通过Smithery安装
要通过Smithery自动为Claude Desktop安装文件删除功能:
npx -y @smithery/cli install @qpd-v/mcp-delete --client claude
手动安装
npx @qpd-v/mcp-delete
或者全局安装:
npm install -g @qpd-v/mcp-delete
配置
Claude Desktop
将服务器配置添加到您的Claude Desktop配置文件中:
Windows:
// %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-delete": {
"command": "npx",
"args": ["@qpd-v/mcp-delete"]
}
}
}
MacOS:
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-delete": {
"command": "npx",
"args": ["@qpd-v/mcp-delete"]
}
}
}
}
VSCode扩展
将服务器配置添加到您的Cline设置中:
Windows:
// %APPDATA%/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
{
"mcpServers": {
"mcp-delete": {
"command": "npx",
"args": ["@qpd-v/mcp-delete"]
}
}
}
MacOS:
// ~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
{
"mcpServers": {
"mcp-delete": {
"command": "npx",
"args": ["@qpd-v/mcp-delete"]
}
}
}
}
可用工具
delete_file
删除指定路径下的文件。
参数:
path(字符串, 必需): 要删除的文件路径(相对于工作目录或绝对路径)
在Claude中的示例用法:
You can ask me to delete a file like this:
"Please delete the file example.txt"
I will use the delete_file tool to safely remove the file.
路径解析
服务器通过尝试多种方法智能处理路径解析:
- 提供的确切路径
- 相对于当前工作目录的路径
- 相对于指定的基础目录的路径
这使其更加用户友好,因为可以通过相对路径引用文件,并且服务器会尝试正确地定位它们。
开发
克隆仓库:
git clone https://github.com/qpd-v/mcp-delete.git
cd mcp-delete
安装依赖项:
npm install
构建服务器:
npm run build
带有自动重建的开发:
npm run watch
调试
由于MCP服务器通过stdio通信,调试可能具有挑战性。请使用MCP Inspector进行调试:
npm run inspector
这将提供一个URL以便您在浏览器中访问调试工具。
许可证
MIT
作者
qpd-v