Back to MCP directory
publicPublicdnsLocal runtime

Downloads Organizer

一个基于Cursor IDE的MCP服务,用于自动分类整理下载文件夹中的文件

article

README

🚀 使用 Cursor MCP 文件组织器管理 Downloads 文件夹

本项目是一个模型上下文协议(MCP)服务器,可借助 Cursor IDE 对 Downloads 文件夹中的文件进行高效组织与管理,有效提升文件管理效率。

🚀 快速开始

先决条件

  • Node.js(v14 或更高版本)
  • TypeScript
  • Cursor IDE

安装步骤

  1. 克隆仓库:
git clone https://github.com/AlexanderVTr/cursor-mcp-file-organizer.git
cd cursor-mcp-file-organizer
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build

配置指南

  1. 配置 Cursor IDE MCP 设置:
{
  "mcpServers": {
    "file-organizer": {
      "url": "http://localhost:3001",
      "port": 3001,
      "enabled": true,
      "description": "文件整理 MCP 服务器"
    }
  }
}
  1. 自定义整理规则在 mcp-config.json
{
  "version": "1.0",
  "rules": {
    "downloads": {
      "path": "~/Downloads",
      "organizeBy": {
        "images": {
          "extensions": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
          "destination": "~/Downloads/Pictures"
        }
        // 其他类别继续添加
      }
    }
  }
}

使用说明

  1. 启动服务器:
npm start
  1. 使用 Cursor IDE 发送命令:
// 示例命令用于整理文件
{
  command: "organizeFiles",
  args: {
    path: "~/Downloads"
  }
}

✨ 主要特性

  • 自动整理:自动对 Downloads 文件夹中的文件进行整理。
  • 多类别支持:支持多种文件类别,包括但不限于:
    • 图片 (jpg, jpeg, png, gif, webp, svg 等)
    • 文档 (pdf, doc, docx, txt 等)
    • 压缩包 (zip, rar, 7z, tar 等)
    • 代码文件 (js, ts, py, java 等)
    • 媒体文件 (mp4, mp3, wav 等)
    • 设计文件 (psd, ai, sketch 等)
    • 数据库文件 (sql, sqlite 等)
    • 字体文件 (ttf, otf, woff 等)
  • 规则可配置:支持用户自定义文件整理规则。
  • 实时监控:实时监控文件系统的变化。
  • 实时更新:支持 SSE(Server-Sent Events)实时更新。

💻 使用示例

基础用法

# 启动服务器
npm start

高级用法

// 使用 Cursor IDE 发送命令进行文件整理
{
  command: "organizeFiles",
  args: {
    path: "~/Downloads"
  }
}

📚 详细文档

可用命令

  • listDir:列出目录内容
  • readFile:读取文件内容
  • writeFile:写入文件内容
  • moveFile:移动文件到新位置
  • createDir:创建目录
  • organizeFiles:按类型整理文件

开发信息

# 以开发模式运行并启用热重载
npm run dev

# 构建项目
npm run build

# 启动服务器
npm start

项目结构

cursor-mcp-file-organizer/
├── src/
│   ├── server.ts      # 主服务器实现文件
│   └── organizer.ts   # 文件整理逻辑文件
├── dist/             # 编译后的 JavaScript 文件夹
├── package.json      # 项目依赖和脚本信息
├── mcp-config.json    # 整理规则配置文件
└── README.md         # 项目说明文档

贡献指南

欢迎社区贡献!请参考 CONTRIBUTING.md 参与项目。

📄 许可证

本项目遵循 MIT License

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client