](https://mseep.ai/app/alexandervtr-cursor-mcp-file-organizer)
光标MCP文件管理器
一个模型上下文协议(MCP)服务器,用于使用Cursor IDE组织下载文件夹中的文件。
特性
- 按类型自动组织下载文件夹中的文件
- 支持多种文件类别:
- 图片(jpg、jpeg、png、gif、webp、svg等) - 文档(pdf、doc、docx、txt等) - 档案(zip、rar、7z、tar等) - 代码文件(js、ts、py、java等) - 媒体文件(mp4、mp3、wav等) - 设计文件(psd、ai、草图等) - 数据库(sql、sqlite等) - 字体(ttf、otf、woff等)
- 可配置的组织规则
- 实时文件系统监控
- SSE(服务器发送事件)支持实时更新
先决条件
- Node.js(v14或更高版本)
- TypeScript
- 光标IDE
安装
- 克隆存储库:
git clone https://github.com/AlexanderVTr/cursor-mcp-file-organizer.git
cd cursor-mcp-file-organizer- 安装依赖项:
npm install- 构建项目:
npm run build配置
- 配置游标IDE MCP设置:
{
"mcpServers": {
"file-organizer": {
"url": "http://localhost:3001",
"port": 3001,
"enabled": true,
"description": "File organization MCP server"
}
}
}- 在中自定义组织规则
mcp-config.json:
{
"version": "1.0",
"rules": {
"downloads": {
"path": "~/Downloads",
"organizeBy": {
"images": {
"extensions": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
"destination": "~/Downloads/Pictures"
}
// ... other categories
}
}
}
}用法
- 启动服务器:
npm start- 使用Cursor IDE发送命令:
// Example command to organize files
{
command: "organizeFiles",
args: {
path: "~/Downloads"
}
}可用命令
listDir:列出目录内容readFile:读取文件内容writeFile:将内容写入文件moveFile:将文件移动到新位置createDir:创建目录organizeFiles:按类型组织文件
发展
# Run in development mode with hot reload
npm run dev
# Build the project
npm run build
# Start the server
npm start项目结构
cursor-mcp-file-organizer/
├── src/
│ ├── server.ts # Main server implementation
│ └── organizer.ts # File organization logic
├── dist/ # Compiled JavaScript
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── mcp-config.json # Organization rules贡献
- 分叉存储库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add some amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
许可证
此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。
致谢
- MCP协议的Cursor IDE团队
- Node.js社区,提供优秀的工具和库
经MCP审查认证https://mcpreview.com/mcp-servers/alexandervtr/cursor-mcp-file-organizer
